Search:  
Gentoo Wiki

Offline

Gentoo Offline Mode Script

#!/bin/sh
# Author: ArYiX <aryixb -> gmail -> com>
# LICENSE: GPL 
# Version: 1.0
# Inspiration from fetch_script.py by Martin Wegner. Thanks Martin.
# Goal: Download only needed packages

echo "--------------------------------------------------------------------"
echo "| gentoo_get_offline.sh v 1.0 by ArYiX  <aryixb -> gmail dot com>  |"
echo "| Sun Aug 27 06:03:21 2006                                         |"
echo "| License: GPL                                                     |"
echo "--------------------------------------------------------------------"

# for fetch in win32 using wget.exe
#FILE=/root/myfetch.bat

# for fetch in *ix using wget
FILE=/root/myfetch.sh

LOGFILE="myfetch.log"

# command used to get URI's
GET="wget -a ${LOGFILE} -nc -t 2 -c"

#GETWIN32="c:\windows\wget.exe -c"

#GET=${GETWIN32}

# for specific packages. ex ./gentoo_get_offline.sh sylpheed apache mysql ...
MERGE="emerge -f $*"

# for update world ./gentoo_get_offline.sh -uD world

RESUMECOMMAND="echo ${GET} \${URI} >> ${FILE}" \
FETCHCOMMAND=${RESUMECOMMAND} \
${MERGE} ;

echo "your fetch file is ${FILE}"
echo "Have Fun!"

Usage

Save this script as gentoo_get_offline.sh

and run:

chmod u+rx gentoo_get_offline.sh

./gentoo_get_offline.sh all packages you want

or

./gentoo_get_offline.sh -uD world

Finally you have this file /root/myfetch.sh or /root/myfetch.bat

Use this file to get these packages in another machine

NOTE: if you want to download on win32 boxes, you need wget.exe

and do:

copy wget.exe %systemroot%

Have Fun!

Mail: ArYiX <aryixb -> gmail dot com>

Retrieved from "http://www.gentoo-wiki.info/Offline"

Last modified: Fri, 05 Sep 2008 23:00:00 +0000 Hits: 902