apt-zip-0.18/0000755000232200023220000000000010750545464013226 5ustar pbuilderpbuilderapt-zip-0.18/debian/0000755000232200023220000000000010750545377014453 5ustar pbuilderpbuilderapt-zip-0.18/debian/control0000644000232200023220000000157410750544420016051 0ustar pbuilderpbuilderSource: apt-zip Section: admin Priority: extra Build-Depends-Indep: docbook-utils, docbook Build-Depends: debhelper (>= 5), cdbs Maintainer: Giacomo Catenazzi Uploaders: Eddy Petrișor , François Févotte Standards-Version: 3.7.3 Homepage: http://alioth.debian.org/projects/apt-zip Package: apt-zip Architecture: all Depends: apt (>= 0.7.7) Description: Update a non-networked computer using apt and removable media These scripts simplify the process of using dselect and apt on a non-networked Debian box, using removable media like ZIP floppies and USB keys. One generates a `fetch' script (supporting backends such as wget and lftp, in a modular, extensible way) to be run on a host with better connectivity, check space constraints of your removable media, and then install the package on your Debian box. apt-zip-0.18/debian/compat0000644000232200023220000000000210650351714015636 0ustar pbuilderpbuilder5 apt-zip-0.18/debian/changelog0000644000232200023220000003232310750543711016316 0ustar pbuilderpbuilderapt-zip (0.18) unstable; urgency=medium * Use sha256 instead of md5 for checksum, as in apt 0.7.7. Patch from Sandro Tosi (Closes: #455577), thanks! * correct dir in apt-zip-inst (Closes: #385087), thanks Reinhardt A.W. Maier * fix typo in manpage (Closes: #441207), thanks Ferdinand Rissner -- Giacomo Catenazzi Fri, 01 Feb 2008 08:18:47 +0100 apt-zip (0.17) unstable; urgency=low * Add 'wget-dos' method. Now you can use a DOS/Windows target machine to download packages. Thanks to Wolfram Sang (Closes: #224321) * Use CDBS -- Giacomo Catenazzi Fri, 12 Oct 2007 18:48:41 +0200 apt-zip (0.16) unstable; urgency=low [Eddy Petrișor ] * more indenting improvement in common.sh.in file [François Févotte] * add possibility to run update, too, thanks to François Févotte for the patch (Closes: #43622, #133117, #223372) [Giacomo Catenazzi] * correct docbook dependencies, update doc version -- Giacomo Catenazzi Wed, 20 Jun 2007 17:42:19 +0200 apt-zip (0.15) unstable; urgency=low [ Eddy Petrișor ] * BIG, FAT warning added: /ZIP is no longer used, we use /media/zip * Added myself to the uploaders list * Standard version 3.7.2 (nothing to do) * move debhelper in Build-Depends because is used in clean target -- Eddy Petrișor Mon, 5 Jun 2006 22:41:28 +0300 apt-zip (0.14) unstable; urgency=low [ Eddy Petrișor ] * corrected example for GREP in apt-zip.conf (closes: #347261) * use a FHS compliant path for medium (closes: #344243) * correct inline help related to version (closes: #347260) * no longer FTBFS on binNMUs, thanks Daniel Schepler (closes: #359636) the version check is now a warning which appears when the man page seems to be outdated * corrected type of --skip-mount element in manual (closes: #358678) * documented in man page the newly added option: -S/--use-sleep * document apt-zip-list being runable by non-root * reinsert the md5 sums as optional (closes: #184354) * corrected indentation in (all?) apt-zip files * no longer uses "which" as is broken on some Solaris versions (closes: #131354) -- Eddy Petrișor Sat, 11 Mar 2006 02:09:20 +0200 apt-zip (0.13.7) unstable; urgency=low [ Eddy Petrișor ] * Improved the sleep code * Improved handling of the PACKAGES list not to depend on GNU sed (removed "\+") * disabled BLOCKSIZE unused code [ Giacomo Catenazzi ] * fix change directory in tar mode. Thanks to Yuri I. Kornilov (closes: #355150) -- Giacomo Catenazzi Tue, 7 Mar 2006 08:06:53 +0100 apt-zip (0.13.6) unstable; urgency=low The Eddy Petrișor release: * added hint related to --skip-mount in -m discussion (closes: #176631) * added alias -s for --skip-mount in man page * added possibility to run apt-zip-list as non-root (suggested in #101307) * added --use-sleep parameters to allow delayed downloads * show the file count along with the download size (closes: #177261) * add option to override the name of apt-zip.options file (closes: #180946) * renamed TODO to ENHANCEMENTS * added TODO in order to store devlopment related info in it * added info regarding updates via modem and apt-zip (closes: #181042) -- Giacomo Catenazzi Tue, 28 Feb 2006 22:25:09 +0100 apt-zip (0.13.5) unstable; urgency=low [ Giacomo Catenazzi ] * Correct an other bug. And this time I tested more. (closes: #326946) * apt-zip-inst now find the apt-zip.options file! [ Eddy Petrișor ] (closes: #319887) * relative paths for mount points are now supported * fixed broken formating in generated scripts * the download size is exact, not aproximative * added aptitude-update method in the TODO list * added more space protections, where necessary * updated copyright owners list -- Giacomo Catenazzi Wed, 21 Sep 2005 09:04:14 +0200 apt-zip (0.13.4) unstable; urgency=low * Really remove download test (closes: #326946) -- Giacomo Catenazzi Tue, 6 Sep 2005 22:41:15 +0200 apt-zip (0.13.3) unstable; urgency=low [ Giacomo Catenazzi ] * Bug fix: Download only once, and don't download already fetched packages (Closes: #216320). * Removed md5 check (at download). It cause a lot of problems (Closes: #184354). * Some other small corrections * Updated to debian policy 3.6.2 * Updating to debhelper 4 [ Eddy Petrișor ] * paths containing spaces are now supported * generator and fetch scripts are now nicely indented and more readable * display download size after generation and before download * replaced tabs with spaces in the changelog, where appropriate -- Giacomo Catenazzi Fri, 26 Aug 2005 08:09:14 +0200 apt-zip (0.13.2) unstable; urgency=low * build dependence: replaced obsolete doocbook2man with the newer docbook-utils, and use the docbook2man command (closes: #117078) -- Giacomo Catenazzi Fri, 2 Nov 2001 10:16:12 +0100 apt-zip (0.13.1) unstable; urgency=low * Removed generated man page from sources. * Inverted -m and -M in the command help (closes: #106042) * Fix typo in documentation (closes: #105692) -- Giacomo Catenazzi Thu, 30 Aug 2001 21:20:05 +0200 apt-zip (0.13) unstable; urgency=low * New maintainer: (Closes: #101092). -- Giacomo Catenazzi Tue, 28 Aug 2001 21:55:40 +0200 apt-zip (0.12.1) unstable; urgency=low * Sponsorized upload. * Change apt-zip.deb for apt-zip.options for clarity. * Fix some typos. * Fix the broken apt-zip-inst. -- Santi Bejar Fri, 3 Nov 2000 00:48:10 +0100 apt-zip (0.12) unstable; urgency=low * New not-yet-official-maintainer upload sponsorized by previous maintainer. * Added a filter to accept/reject protocols to download (Closes: #63150). * Some internal cleanups. * Added an option to choose the apt-get action (Closes: #65396). * Added an option to just install a list of packages. * wget: RESTART options without TAR (Closes: #56362). * Added a generated file to save the options used by apt-zip-inst. * New version (Closes: #72829) -- Santi Bejar Tue, 31 Oct 2000 01:04:03 +0100 apt-zip (0.11.1) unstable; urgency=low * Added GNUTAR and SOLARISTAR options. TAR now specifies POSIX tar, and is automatically set if one of GNUTAR or SOLARISTAR is set. * Write errors to stderr. * Some internal cleanups. * wget: do not "set -e" the fetch script. * wget: make use of SOLARISTAR "-n" option as a speedup. Require a GNUTAR for RESTART (needs "-A"). * wget: fixed return value from check() - dollar sign was not backslashed. * wget: produce a more readable script, by not stripping leading tabs. * wget: do not print misleading "md5sum failed" message during a restarted fetch when requested deb is not present. * wget: print progression of "already got" packages during a restarted fetch. -- Yann Dirson Sun, 27 Feb 2000 22:55:12 +0100 apt-zip (0.11) unstable; urgency=low * Recognize "name=value" options as known when "name" is known. * Fixed finding of method scripts to work when calling tools in the source tree, but from outside the source tree - forgotten from 0.8. * Changed the location of method files to /usr/share/apt-zip/methods/. * Added FILES section in the manpage. * Fixed the Makefile not to refer to ./sgmlspl. * wget: do not use &> kshism. * wget: fix tar option to really use tar - how did I miss that ? * debian/rules: fixed version check to be more robust. * Mention restart option, and argument to tar option, in default conffile. -- Yann Dirson Thu, 24 Feb 2000 01:05:41 +0100 apt-zip (0.10) unstable; urgency=low * Export APTZIPVERSION and OPTIONS to method scripts. * Ensure OPTION_ vars are set either to 0 or 1 when option is known. * New known feature RESTART, causing an already existing set of .deb files to be used when possible, instead of re-downloading everything. * Fix handling of --options to concatenate them to those specified in conffile. * Added support for "no" prefix to options, to allow overriding conffile from command-line. * Added support for valued options. As a side-effect of implementation, OPT=0 is equivalent to NOOPT. Checking values are valid is left to the methods using them. * TAR option is now valued, with a default of "tar" when option is required without a value. No check is done by wget method. * Documented the methods API in the manpage. * Added "make clean" to remove docbook2man auxiliary files. * wget: print version number in fetch scripts and options list used. * wget: moved .deb checking code into its own func. * wget: implemented RESTART option when TAR is in use (ie. RESTART is not supported yet without TAR). * wget: fixed quoting for $? which got expanded at list time instead of fetch time. * wget: go on getting files even if one fails. -- Yann Dirson Sat, 19 Feb 2000 23:27:08 +0100 apt-zip (0.9) unstable; urgency=low * Made apt-zip-inst using tar unmount its removable medium after untarring, since it don't need it within apt-get. * Changed versionned dep on apt to 0.3.10 as suggested by apt team. * Fixed description for typos (Closes: #54525), and reformulated parts of it. -- Yann Dirson Tue, 11 Jan 2000 15:44:03 +0100 apt-zip (0.8) unstable; urgency=low * Depends on apt (>= 0.3) because we need --print-uris (Closes: #54161). * Check there is no mismatch between version in source and in this file (0.7 told it was 0.6 :). * Made check for mounted media more reliable. * Check that there is a mountpoint for medium to be used. * Corrected erroneous occurences of "media" (Closes: #51006). * Minor manpages update. * Better support for running from the source tree (more robust; need not to cd to the source tree). * Added support for updating several machines at the same time using the same removable medium, by using machine name in filenames (I have slink and potato machines to upgrade). * Added Build-Depends. * Bumped Standards-Version to 3.1.1. -- Yann Dirson Fri, 7 Jan 2000 13:14:14 +0100 apt-zip (0.7) unstable; urgency=low * Updated conffile to use OPTIONS, not STORAGE. -- Yann Dirson Sun, 21 Nov 1999 23:48:12 +0100 apt-zip (0.6) unstable; urgency=low * Renamed library file apt-zip.sh to common.sh. * Added OPTIONS parameter. * Removed STORAGE parameter. The old STORAGE=tar now corresponds to the TAR option. * Extended parsing of long options to accept "--name=value" in addition to "--name value". * Allow proper execution from the source tree. * Better error message on unknown option. * Savagely strip single quotes around the URI, which confused sh, but removing all single quotes from "apt-get --print-uris" output (maybe not wise). * wget method: ** Rewritten to produce smaller and more readable scripts, using shell functions. ** Made less verbose, so that output is useful. ** Let wget retry 3 times. ** If possible, do not trust wget exit code, test ourselves the integrity of the .deb file (using md5sum, or gzip -t on included data.tar.gz). ** Use "set -e" instead of "sh -e" because the script may not be made executable. -- Yann Dirson Sat, 30 Oct 1999 19:28:20 +0200 apt-zip (0.5) unstable; urgency=low * Added --fix-broken (-f) option to be passed to apt-get (Closes: #46997). * Added --skip-mount option to allow using a non-removable media (requested by Peter Vreman ). * Some manpage updates. * Do not ship full docbook2x source package inside apt-zip source package ! -- Yann Dirson Thu, 14 Oct 1999 21:56:50 +0200 apt-zip (0.4) unstable; urgency=low * Moved manpage to docbook SGML, converting with docbook2man. * Removed install-stamp breakage from debian/rules. * Added --storage option; use APTZIPSTORAGE parameter to control script generation. * Method "wget" with storage "plain" now moves complete files in "disk" directory. * Added storage "tar", using APTZIPTARFILE parameter. * Switched to FHS - bumped Standards-Version to 3.0.1. -- Yann Dirson Wed, 22 Sep 1999 20:34:28 +0200 apt-zip (0.3) unstable; urgency=low * wget method: use partial/ directory as temporary download dir. * Fixed a bug in exit handler causing syntax errors. * Implemented already documented --help and --version options, whose absence triggered above bug. * Improved options handling. * Added in TODO file all current enhancement ideas. -- Yann Dirson Fri, 3 Sep 1999 21:57:59 +0200 apt-zip (0.2) unstable; urgency=low * Fixed apt-zip-inst missing exithook(). * Made sure in apt-zip-list exithook() is always found. * Made apt-zip-inst use bash, not sh. * Now robust with write-protected removable media. -- Yann Dirson Fri, 27 Aug 1999 02:57:22 +0200 apt-zip (0.1) unstable; urgency=low * Initial Release. -- Yann Dirson Wed, 25 Aug 1999 01:45:12 +0200 apt-zip-0.18/debian/copyright0000644000232200023220000000053610650351714016377 0ustar pbuilderpbuilderThis software was written for Debian GNU/Linux by Yann Dirson Copyright: Yann Dirson - initial writing Eddy Petrișor - improvements Giacomo Catenazzi - bug fixing, improvements This software is covered by the GPL (see /usr/share/common-licenses/GPL for details). apt-zip-0.18/debian/rules0000755000232200023220000000137610703615203015522 0ustar pbuilderpbuilder#!/usr/bin/make -f #-*- makefile -*- # Test that the update was done while the man page was updated # according to new changes in the source, too DVERSION=$(shell dpkg-parsechangelog | grep '^Version: ' | cut -d' ' -f2) MVERSION=$(shell grep 'up-to-date with version ' apt-zip.sgml | tr -s 'a-zA-Z-' ' ' | tr -d ' ' ) DEB_MAKE_INSTALL_TARGET=install configure/apt-zip:: @test "$$DEV" = "yes" -o "${DVERSION}" = "${MVERSION}" || \ echo 'WARNING: The man page seems to be outdated, but it would be good to update it; Continuing, anyway...' include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/makefile.mk DEB_MAKE_CLEAN_TARGET = clean DEB_MAKE_BUILD_TARGET = build DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(CURDIR)/debian/tmp/ apt-zip-0.18/debian/NEWS0000644000232200023220000000054510750545377015156 0ustar pbuilderpbuilderapt-zip (0.15) unstable; urgency=low Please note that apt-zip does no longer use by default /ZIP as a mount point. Instead, /media/zip is used in order to achieve FHS compliancy (#344243). This is true since version 0.14. Files affected: /etc/apt/apt-zip.conf -- Eddy Petri<99>or Mon, 5 Jun 2006 22:41:28 +0300 apt-zip-0.18/debian/README.Debian0000644000232200023220000000055010650351714016501 0ustar pbuilderpbuilderThis file contains a few hints and questions about the usage of apt-zip. Q: Is it safe to update a few small files by modem while expecting to fetch others remotely through apt-zip's fetch script? How about upgrade and dist-upgrade? A: It might be safe to update, upgrade or even dist-upgrade, but that is not guaranteed. Short answer: do it on you own risk. apt-zip-0.18/debian/apt-zip.docs0000644000232200023220000000004210703614227016672 0ustar pbuilderpbuilderREADME.wget-dos TODO ENHANCEMENTS apt-zip-0.18/debian/apt-zip.manpages0000644000232200023220000000005010703617343017536 0ustar pbuilderpbuilderdebian/tmp/usr/share/man/man8/apt-zip.8 apt-zip-0.18/debian/apt-zip.install0000644000232200023220000000055510703616715017425 0ustar pbuilderpbuilderdebian/tmp/usr/bin/apt-zip-list usr/bin/ debian/tmp/usr/sbin/apt-zip-inst usr/sbin/ debian/tmp/usr/share/apt-zip usr/share/ debian/tmp/usr/share/apt-zip/methods/wget usr/share/apt-zip/methods/ debian/tmp/usr/share/apt-zip/methods/wget-dos usr/share/apt-zip/methods/ debian/tmp/usr/share/apt-zip/common.sh usr/share/apt-zip/ debian/tmp/etc/apt/apt-zip.conf etc/apt/ apt-zip-0.18/debian/apt-zip.links0000644000232200023220000000017710703722426017074 0ustar pbuilderpbuilderusr/share/man/man8/apt-zip.8 usr/share/man/man8/apt-zip-list.8 usr/share/man/man8/apt-zip.8 usr/share/man/man8/apt-zip-inst.8 apt-zip-0.18/methods/0000755000232200023220000000000010750542027014661 5ustar pbuilderpbuilderapt-zip-0.18/methods/lftp0000755000232200023220000000024210650351714015552 0ustar pbuilderpbuilder#!/usr/bin/awk -f BEGIN { print("#!/bin/sh"); print("# auto-generated file from apt-zip-list"); } /'http:/ { exit 1; } { print "wget -O " $2 " " $1; } apt-zip-0.18/methods/wget0000755000232200023220000000750110750541055015560 0ustar pbuilderpbuilder#!/bin/bash -e error() { echo >&2 "apt-zip/methods/$(basename $0) ERROR: $*" exit 1 } warn() { echo >&2 "apt-zip/methods/$(basename $0) WARNING: $*" } ############### # write header # cat <<-EOF #!/bin/sh # This file was auto-generated by apt-zip-list ${APTZIPVERSION} # Method: wget - Options: ${OPTIONS} err(){ echo >&2 "Fetching \$1 failed (\$2)" } EOF ############### # add check code, if is wanted # [ ! "${USECHECKSUMS}" = 'no' ] && cat <<-EOF check(){ [ ! -r "\$1" ] && return 1 [ "\$2" = "0" ] && return \$3 [ "\$2" = "" ] && return \$3 [ "\`type sha256sum\`" ] && if [ "\`sha256sum \$1 | cut -d' ' -f1\`" = \$2 ] then return 0 else err \$1 "wrong checksum"; return 1 fi [ "\`type gzip\`" ] && if ar p \$1 data.tar.gz | gzip -t then return 0 else err \$1 "wrong contents"; return 1 fi return \$3 } EOF ############### # Differences between gnutar and solaris # if [ "$OPTION_SOLARISTAR" != 0 ] ; then TAR="${OPTION_SOLARISTAR}" TAREXTRACT=xnf TARTEST=tnqif TARADD=rnf elif [ "$OPTION_GNUTAR" != 0 ] ; then TAR="${OPTION_GNUTAR}" TAREXTRACT=xf TARTEST=tf TARADD=rf else TAR="${OPTION_TAR}" TAREXTRACT=xf TARTEST=tf TARADD=rf fi [ "$OPTION_RESTART" = 0 -a "$OPTION_GNUTAR" != 0 -a "$OPTION_SOLARISTAR" = 0 ] && warn "RESTART without SOLARISTAR is currently awfully slow" ############### # Stuff dependant on RESTART option # if [ "$OPTION_RESTART" = 0 ] then cat <<-EOF do_wget() { wget -t3 -nv -O \$2 \$1 ${CHECK} \$2 \$4 \$? ${SLEEPCMD} return \$? } EOF else if [ "$OPTION_GNUTAR" != 0 ] then OLDTARFILE="old-$APTZIPTARFILE" cat <<-EOF [ -r "$APTZIPTARFILE" ] && if [ -r "$OLDTARFILE" ] then "$OPTION_GNUTAR" Af "$OLDTARFILE" "$APTZIPTARFILE" else mv "$APTZIPTARFILE" "$OLDTARFILE" fi do_wget() { if [ -r "$OLDTARFILE" ] && "$TAR" "$TARTEST" "$OLDTARFILE" \$2 >/dev/null 2>&1 then "$TAR" "$TAREXTRACT" "$OLDTARFILE" \$2 if [ -r \$2 ] && ${CHECK} \$2 \$4 \$? ; then echo "Already got \$2"; return 0; fi fi wget -nc -t3 -nv -O \$2 \$1 ${CHECK} \$2 \$4 \$? ${SLEEPCMD} return \$? } EOF elif [ "$OPTION_TAR" = 0 ] ; then cat <<-EOF do_wget() { if [ -r ../\$2 ] && ${CHECK} ../\$2 \$4 \$? ; then echo "Already got \$2"; return 1; fi wget -t3 -nv -O \$2 \$1 ${CHECK} \$2 \$4 \$? ${SLEEPCMD} return \$? } EOF else # OPTION_GNUTAR == 0 and OPTION_TAR != 0 error "RESTART only supported with GNUTAR or without TAR" fi fi ############### # Stuff dependant on TAR option # if [ "$OPTION_TAR" = 0 ] then cat <<-EOF getfile(){ ( [ -r ../\$2 ] && ${CHECK} ../\$2 \$4 \$? && echo \$2 already downloaded.) || (do_wget \$1 \$2 \$3 \$4 && mv \$2 ../) } mkdir -p partial && cd partial || echo >&2 "Cannot change to directory ./partial" EOF else cat <<-EOF getfile(){ EOF ################# # Stuff dependent on the update action # if [ "$APTGETACTION" = "update" ] ; then cat <<-EOF FILE="" for EXT in ".bz2" ".gz" "" do do_wget \$1\$EXT \$2\$EXT \$3 \$4 && FILE=\$2\$EXT && break rm -f \$2\$EXT done [ "\$FILE" = "" ] && return 1 EOF else cat <<-EOF do_wget \$1 \$2 \$3 \$4 || return 1 FILE=\$2 EOF fi cat <<-EOF $TAR $TARADD $APTZIPTARFILE \$FILE && rm \$FILE } touch foo-stamp && "$OPTION_TAR" cf "$APTZIPTARFILE" foo-stamp && rm foo-stamp EOF fi ############### # Feed the data to the core function # cat <<-EOF echo Download will be of size: "$DWLSIZE" in "$PACKCOUNT" files while read URL FILE SIZE CHECKSUM do getfile \$URL \$FILE \$SIZE \$CHECKSUM || true done <&2 "apt-zip/methods/$(basename $0) ERROR: $*" exit 1 } warn() { echo >&2 "apt-zip/methods/$(basename $0) WARNING: $*" } print_header() { cat $1 <<-EOF :: This file was auto-generated by apt-zip-list ${APTZIPVERSION} :: Method: wget-dos - Options: ${OPTIONS} EOF } add_check() { cat >>${SCRIPT}.bat <<-EOF set to_check=$1 goto check :$1_searched EOF [ "$WARNINSTALLED" ] && WARNINSTALLED+=" and " WARNINSTALLED+="$1" } ############### # Stuff dependant on TAR option # DOS: not yet ############### # Stuff dependant on restart option # DOS: not yet [ "$OPTION_RESTART" != 0 -o "$OPTION_TAR" != 0 ] && error "Sorry, options not supported (yet)" ############### # Make the batch file for downloading and checking # print_header >${SCRIPT}.utils cat >>${SCRIPT}.utils <<-EOF set file_to_check=%2 goto check_file :get_file wget -t3 -nv -O partial\\%2 %1 set file_to_check=partial\\%2 goto check_file :file_ok move partial\\%2 . EOF [ "$SLEEPTIME" -ne "0" ] && echo "if %HAS_sleep.exe%==1 sleep $SLEEPTIME" >>${SCRIPT}.utils cat >>${SCRIPT}.utils <<-EOF goto end :check_file if not exist %file_to_check% goto failed EOF [ ! "${USECHECKSUMS}" = 'no' ] && cat >>${SCRIPT}.utils <<-EOF if "%3"=="" goto checksum_ok if "%3"=="0" goto checksum_ok if %HAS_sha256sum.exe%==1 echo %3 *%file_to_check% | sha256sum -c if errorlevel 1 goto failed :checksum_ok EOF cat >>${SCRIPT}.utils <<-EOF if "%file_to_check%"=="partial\\%2" goto file_ok echo %2 already downloaded. goto end :failed if "%file_to_check%"=="%2" goto get_file echo Failed to get %2! :end EOF ############### # Make the main batch file which sets all up # SCRIPTNAME=${SCRIPT##*/} WARNINSTALLED= print_header >${SCRIPT}.bat echo "@echo off" >>${SCRIPT}.bat add_check wget.exe [ ! "${USECHECKSUMS}" = 'no' ] && add_check sha256sum.exe [ "$SLEEPTIME" -ne "0" ] && add_check sleep.exe #FIXME: could not make dir? cat >>${SCRIPT}.bat <<-EOF set to_check= if %HAS_wget.exe%==0 goto main_failed mkdir partial >NUL copy ${SCRIPTNAME}.utils u.bat >NUL copy ${SCRIPTNAME} main.bat >NUL call main.bat set file_to_check= del u.bat main.bat >NUL goto end :check set HAS_tmp=0 if exist %to_check% set HAS_tmp=1 for %%d in (%path%) do if exist %%d\%to_check% set HAS_tmp=1 if %HAS_tmp%==0 echo Warning: %to_check% not found! set HAS_%to_check%=%HAS_tmp% set HAS_tmp= goto %to_check%_searched :main_failed echo Critical error! :end set HAS_wget.exe= set HAS_sha256sum.exe= set HAS_sleep.exe= EOF ############### # Feed the data to the core function # print_header echo "echo Download will be of size: $DWLSIZE in $PACKCOUNT files" # '%' needs to be escaped twice here, so it will stay as a character inside a filename if [ ! "${USECHECKSUMS}" = 'no' ]; then awk '{gsub(/%/,"%%%%",$2); printf "call u.bat \"%s\" %s %s\n",$1,$2,$4}' else awk '{gsub(/%/,"%%%%",$2); printf "call u.bat \"%s\" %s\n",$1,$2}' fi warn "Make sure you have $WARNINSTALLED installed on the target machine." apt-zip-0.18/apt-zip-inst0000755000232200023220000000334210750542471015510 0ustar pbuilderpbuilder#!/bin/bash exithook() { true } SHAREDIR="$(cd $(dirname $0) && pwd)" [ -r "${SHAREDIR}/common.sh" ] || SHAREDIR=/usr/share/apt-zip . "${SHAREDIR}/common.sh" check_medium az_mount APTZIPINSFILE="${MEDIUM}/${APTZIPINSFILE}" if [ -r "${APTZIPINSFILE}" ] ; then . "${APTZIPINSFILE}" else [ -z "$PACKAGES" -a -z "$APTGETACTION" ] && error "There is no ${APTZIPINSFILE} file. Set --aptgetaction or --packages instead." fi [ -z "$PACKAGES" ] && PACKAGES=${DEF_PACKAGES} [ -z "$APTGETACTION" ] && APTGETACTION=${DEF_APTGETACTION} [ -z "$APTGETEXTRAOPTS" ] && APTGETEXTRAOPTS=${DEF_APTGETEXTRAOPTS} if [ -r "${MEDIUM}/${APTZIPTARFILE}" ] then if [ "$APTGETACTION" = "update" ] then EXTRACTDIR=/var/lib/apt/lists echo >&2 "Uncompressing index archives..." ( cd $EXTRACTDIR tar xvf ${MEDIUM}/${APTZIPTARFILE} | while read FILE do [ `basename "$FILE" .bz2` != "$FILE" ] && bunzip2 -f "$FILE" [ `basename "$FILE" .gz` != "$FILE" ] && gunzip -f "$FILE" done rm -f foo-stamp ) else EXTRACTDIR=/var/cache/apt/archives echo >&2 "Unpacking tarball..." ( cd $EXTRACTDIR ; tar xvf ${MEDIUM}/${APTZIPTARFILE} ) fi else [ "$APTGETACTION" = "update" ] \ && echo "Error: the \`tar' option should be set when using" \ "\`--aptgetaction update'" \ && exit 1 APTGETCACHE="-o dir::cache::archives=${MEDIUM}" fi APTGETEXTRAOPTS="${APTGETEXTRAOPTS} ${APTGETCACHE}" [ -n "$PACKAGES" ] && apt-get ${APTGETEXTRAOPTS} install $PACKAGES [ -n "$APTGETACTION" ] && apt-get ${APTGETEXTRAOPTS} ${APTGETACTION} az_umount # vim: nowrap:ts=4:sw=4:et:tw=78 apt-zip-0.18/TODO0000644000232200023220000000011310650351714013701 0ustar pbuilderpbuilderHey Emacs, this is -*- text -*- file. * -- File last reviewed: 2006/06/05 apt-zip-0.18/apt-zip.sgml0000644000232200023220000003461010750543264015476 0ustar pbuilderpbuilder--help --version --medium=mountpoint --aptgetaction=action --packages=package,package... --fix-broken --skip-mount"> ]> apt-zip 8 Debian GNU/Linux apt-zip-list apt-zip-inst Use apt with removable media apt-zip-list &commonopts; --method=method --options=opt,opt... --accept=accept,accept... --reject=reject,reject... apt-zip-inst &commonopts; DESCRIPTION This manpage should be up-to-date with version 0.17 of the programs. The apt-zip-list and apt-zip-inst commands simplify the upgrade process of a non-networked Debian host using , by using (preferably high-capacity) removable media, like a ZIP drive. apt-zip-list produces two files. One is a script that can be used on another host (maybe not running a Debian system) to fetch packages previously selected in or indicated in the command line, the other apt-zip.options saves the options used by apt-zip-list to indicate to apt-zip-inst what action to perform and/or which packages to install. Various types of scripts can be generated, by specifying a fetch method supported by the host that will fetch the packages. If you prefer, the script may generate a tarball containing the fetched packages. Note that apt-zip-list can be called as a non-root user. The name of the script (as well as the name of the tarfile when using the option) contains the name of the Debian host for which the packages are to be fetched. Thus you can, using the same medium, upgrade several hosts at the same time, provided you have enough space on this disk. This should work with or without the option. The script is written to the removable medium, which is mounted if necessary, and then restored to the original unmounted state when applicable. It is the responsibility of the user then to run the script on a host that will fetch the packages, and to have them (or the generated archive) copied to the removable medium. When back on your Debian host, you just run to install the packages on your disk. OPTIONS Common options --help, -h Show summary of options. --version, -V Show version of program. --medium, -m Select a removable medium other than the site default. See also . --aptgetaction, -a Select the action done by apt-get. Possible actions are , and . If is not set the default is (See also apt-zip.conf), if it is set none is selected. --packages, -p Comma-separated list of extra packages to install. --fix-broken, -f Run apt-get with the option. See for more details. --skip-mount, -s Allow specifying a non-mountpoint directory to the option. This may help on laptops only getting point-to-point networking without being routed to. This is also useful while testing the program, as it allows sending the script into /tmp. --use-sleep=SEC, -S Introduces waiting times between downloaded files. Allows the genearation of a fetch script that will wait some time (configurable). The number parameter represents the delay between consecutive dowloads. Note that this option is safe: even if the connected machine does not have a wait command, the script will not fail. --no-checksum, --no-md5, -5 This option will command to apt-zip-list to create a script which does not make any sha256sum checks. Note that if this option is not given at script generation time, the sha256sum command will be called only after it has been found in the system. (--no-md5 is maintained for script compatibility, but there is only sha256) Options for <command>apt-zip-list</command> --method, -M Select a method other than the default one. The and methods are currently supported. --options, -o Specifies a set of options to be used while generating the script. A warning is issued only if an option is unkown to apt-zip-list, but all known options may not be supported by all methods. Options may be given a value, with the option=value syntax. Currently available options include: causes the dowloaded files to be grouped into a tarball. The name of a tar program on the download machine can be specified, if different from tar. Example: . When used in conjunction with the option, a GNU tar must be specified, so that 2 tarballs man be concatenated - this is only needed on the 3rd and subsequent runs of the fetch script. causes the downloaded files to be grouped into a tarball. --accept , -A / --reject , -R Comma-separated list of accepted/rejected protocols for download. By default are only accepted http and ftp. CONFIG FILE The /etc/apt/apt-zip.conf file can be used to set defaults: method, removable medium, options, apt-get action and accepted/rejected protocols. It is a self-explainatory bourne-shell script snippet. It allows to provide site defaults for command-line options. METHOD API A method is handled by an executable object (usually a script) placed in the /usr/share/apt-zip/methods/ directory. This executable is fed on standard input with the output of apt-get --print-uris. It is communicated the state of requested options using for each option an environment variables named OPTION_OPTNAME, where OPTNAME is the uppercased name of an option. Additional environment variables are also set, such as APTZIPVERSION, APTZIPTARFILE, APTZIPINSFILE, and OPTIONS. LIMITATIONS Only one disk can be used. If your packages do not fit on one, you have to deselect some packages using or you have to select a suitable list of package. The files on an Internet distribution site can change rather frequently. It is up to the user to make sure the site was not updated between the build of the fetch script by apt-zip-list and the fetch itself, otherwise some required files may not be possible to fetch. FILES /etc/apt/apt-zip.conf /usr/share/apt-zip/methods/ BUGS The feature is really slow. The tar command on Solaris(tm) has an option to seek in the file instead of assuming a non-seekable device, which greatly improves performance. GNU tar does not seem to be able to do that. Virtually no error-checking is done. Examples of such error conditions include: - out-of-diskspace on both the removable medium and in apt archive cache when using option. Somewhat consequently, error-recovery also nears non-existence. As examples, an interrupted fetch in tar mode has to be restarted from zero; changes in status file between runs of apt-zip-list and apt-zip-inst are not detected and may lead to failure. AUTHOR The programs were written by The source for this reference page is an SGML file, which can be converted to UNIX manpages using SEE ALSO , , . apt-zip-0.18/common.sh.in0000644000232200023220000002111610750541735015455 0ustar pbuilderpbuilder# library file sourced by apt-zip-* APTZIPVERSION=#will be filled at package build time export APTZIPVERSION CONFFILE=/etc/apt/apt-zip.conf METHODSDIR=/usr/share/apt-zip SKIPMOUNT=no APTGETEXTRAOPTS="" KNOWNAPTGETACTIONS=" dselect-upgrade upgrade dist-upgrade update " KNOWNOPTIONS="TAR GNUTAR SOLARISTAR RESTART" DEFAULT_TAR=tar DEFAULT_GNUTAR=tar DEFAULT_SOLARISTAR=tar APTZIPTARFILE=debs-$(uname -n).tar APTZIPINSFILE=apt-zip.options export APTZIPINSFILE export APTZIPTARFILE error() { echo >&2 "$(basename $0): $*" exit 1 } version_exit() { echo "$(basename $0) version ${APTZIPVERSION}" exit 0 } usage() { cat <&1 "$(basename $0): $*" usage exit 1 } check_method() { FILTER="${SHAREDIR}/methods/$METHOD" if [ ! -x "$FILTER" ] then error "No $METHOD method installed." fi } check_medium() { [ -d "$MEDIUM" ] || error "$MEDIUM does not exist (no mountpoint)" } az_filter() { [ -n "$GREP" ] && GREP=${GREP//^/^\'} if [ -n "$ACCEPT" ] ; then ACCEPT=${ACCEPT#, } ACCEPT=^$(echo "$ACCEPT" | sed -e "s/[, ]\+/\\\|^/g") GREP="'$ACCEPT" elif [ -n "$REJECT" ] ; then REJECT=${REJECT#, } REJECT=^$(echo "$REJECT" | sed -e "s/[, ]\+/\\\|^/g") GREP="-v '$REJECT" fi } check_packages() { PACKAGES=$(echo "$PACKAGES" | sed -e "s/[, ]/ /g" | tr -s ' ') } check_aptgetaction() { [ -n "$APTGETACTION" ] && echo "$KNOWNAPTGETACTIONS" | grep " $APTGETACTION " &> /dev/null || error "Unknown apt-get action $APTGETACTION" } az_loadconf() { # make sure that we will have a valid command for sleep SLEEPTIME=0 SLEEPEVALCMD='true' CHECKEVALCMD='echo "check"' USECHECKSUMS='yes' [ -r $CONFFILE ] && . $CONFFILE METHOD=${METHOD-wget} MEDIUM=${MEDIUM-/ZIP} GREP=${GREP-^http\\\|^ftp} } az_process_commandline () { while [ $# -gt 0 ] do case $1 in --method=*) METHOD=${1#--method=} shift ;; --method|-M) if [ $# -lt 2 ]; then syntax_error "$1 needs an argument"; fi METHOD=$2 shift shift ;; --medium=*) MEDIUM=${1#--medium=} #mount point might be relative ( . or .. are legal ;-) CWD=`pwd` cd "$MEDIUM" MEDIUM=`pwd` cd "${CWD}" #if path is relative, it might contain spaces shift ;; --medium|-m) if [ $# -lt 2 ]; then syntax_error "$1 needs an argument"; fi MEDIUM=$2 #mount point might be relative ( . or .. are legal ;-) CWD=`pwd` cd "$MEDIUM" MEDIUM=`pwd` cd "${CWD}" #if path is relative, it might contain spaces shift shift ;; --options=*) OPTIONS="$OPTIONS, ${1#--options=}" shift ;; --options|-o) if [ $# -lt 2 ]; then syntax_error "$1 needs an argument"; fi OPTIONS="$OPTIONS, $2" shift shift ;; --no-checksum|--no-md5|-5) CHECKEVALCMD='echo "echo"' USECHECKSUMS='no' shift ;; --use-sleep=*) SLEEPTIME="${1#--use-sleep=}" SLEEPEVALCMD='echo "[ ! -z \"\`type sleep\`\" ] && sleep ${SLEEPTIME}"' shift ;; --use-sleep|-S) if [ $# -lt 2 ]; then syntax_error "$1 needs an argument"; fi SLEEPTIME=$2 SLEEPEVALCMD='echo "[ ! -z \"\`type sleep\`\" ] && sleep ${SLEEPTIME}"' shift shift ;; --aptgetaction=*) APTGETACTION=${1#--aptgetaction=} shift ;; --aptgetaction|-a) if [ $# -lt 2 ]; then syntax_error "$1 needs an argument"; fi APTGETACTION=$2 shift shift ;; --packages=*) PACKAGES="$PACKAGES, ${1#--packages=}" shift ;; --packages|-p) if [ $# -lt 2 ]; then syntax_error "$1 needs an argument"; fi PACKAGES="$PACKAGES, $2" shift shift ;; --accept=*) ACCEPT="$ACCEPT, ${1#--accept=}" shift ;; --accept|-A) if [ $# -lt 2 ]; then syntax_error "$1 needs an argument"; fi ACCEPT="$ACCEPT, $2" shift shift ;; --reject=*) REJECT="$REJECT, ${1#--reject=}" shift ;; --reject|-R) if [ $# -lt 2 ]; then syntax_error "$1 needs an argument"; fi REJECT="$REJECT, $2" shift shift ;; --zipopt-file=*) APTZIPINSFILE="${1#--zipopt-file=}" shift ;; --zipopt-file|-z) if [ $# -lt 2 ]; then syntax_error "$1 needs an argument"; fi APTZIPINSFILE="$2" shift shift ;; --fix-broken|-f) APTGETEXTRAOPTS="${APTGETEXTRAOPTS} $1" shift ;; --skip-mount|-s) SKIPMOUNT=yes shift ;; --version|-V) version_exit ;; --help|-h) usage_exit ;; -*) syntax_error "Unknown option \`$1'" ;; *) syntax_error "No non-option arguments allowed" ;; esac done } az_process_options() { OPTIONS=$(echo "$OPTIONS" | awk 'BEGIN { RS = ", *" ; ORS = " " ; FS = "=" } { print toupper($1) ( $2 != "" ? "=" $2 : "" ) }' ) export OPTIONS # ensure known opts are set to 0 if not requested for kopt in $KNOWNOPTIONS do eval export OPTION_${kopt}=0 done for opt in $OPTIONS do # Warn if unknown option local opt_known=0 for kopt in $KNOWNOPTIONS do case $opt in $kopt|NO$kopt|$kopt=*) opt_known=1 ;; esac done [ $opt_known = 0 ] && echo >&2 "WARNING: Unknown option \`$opt'" # Export option case ${opt} in *=*) eval export OPTION_${opt} #eval export OPTION_${opt%=*}=${opt#*=} ;; NO*) eval export OPTION_${opt#NO}=0 ;; *) eval export OPTION_${opt}=\${DEFAULT_${opt}-1} ;; esac done # Special case: set TAR to the 1st of GNUTAR and SOLARISTAR if one is set if [ "$OPTION_TAR" = 0 ] ; then [ "$OPTION_SOLARISTAR" != 0 ] && OPTION_TAR=$OPTION_SOLARISTAR [ "$OPTION_GNUTAR" != 0 ] && OPTION_TAR=$OPTION_GNUTAR fi } az_mount() { if [ "$SKIPMOUNT" = no ] then # Maybe mount removable medium MNTENTRY=$(mount | egrep "^[^ ]+ on $MEDIUM type ") if [ "$MNTENTRY" ] then WAS_MOUNTED=1 if mount | grep "${MEDIUM}.*[(,]ro[,)]" >/dev/null then error "$MEDIUM is mounted READ ONLY" fi else WAS_MOUNTED=0 echo "Mounting $MEDIUM" local out=$(env LC_ALL=C mount $MEDIUM 2>&1) if [ "$out" != "" ] then if echo $out | grep "write-protected" >/dev/null then error "$MEDIUM is write-protected" else error $out fi fi fi fi } az_umount() { if [ "$SKIPMOUNT" = no ] then # Maybe umount removable medium if [ "$WAS_MOUNTED" = 0 ] then echo "UnMounting $MEDIUM" umount "$MEDIUM" fi fi } az_exit() { az_umount exithook } az_init() { az_loadconf az_process_commandline $* az_process_options check_packages az_filter check_method check_medium az_mount } # # Init code # trap az_exit EXIT || error "error setting EXIT trap" az_init $* # vim: nowrap:ts=4:sw=4:et:tw=78 apt-zip-0.18/ENHANCEMENTS0000644000232200023220000000271710650351714015020 0ustar pbuilderpbuilderHey Emacs, this is -*- text -*- file. Here are features that may be nice to have in future releases of apt-zip: * aptitude-update action - make the package list based on the selections made in aptitude * other fetch methods (also from other common OS) ** apt ** lftp backend ** traditional ftp client (if at all possible) ** liburi-perl * use a litprog tool to be able to document wget method without producing tens of comments in the fetch script. * auto remove old-debs-*.tar when not needed any more ? * space checking - partly done Unfortunately a simple file-size-rounded-media-blocksize sum does not properly model a VFAT partition, as it seems. More tests needed to find an accurate algorithm. * tar space-saving when space is overflowed. ** auto-add "tar" command at end of script if blocksize-caused space-overflow detected, and tarfile would fit - maybe add "autotar" option for this. ** auto-detection of tarball by apt-zip-inst, so that it can take a relevant action: - using removable media as spool dir (no tar - is what we currently do) - untar into apt spool dir - use userfs on the tarball to still prevent copying the files in local spool dir (I don't even know whether this fancy is realistic - never looked at userfs seriously) * multi-zip support When one zip is not enough, maybe 2 can be good. This may require nice optimization algorithm if we want to combine this with tar support. -- File last reviewed: 2000/10/21 for 0.12 release apt-zip-0.18/apt-zip.conf0000644000232200023220000000213010650351714015445 0ustar pbuilderpbuilder# Configuration file for apt-zip. # This is a /bin/sh code snippet. # METHOD is taken from /usr/share/apt-zip/. METHOD=wget # MEDIUM should be defined in /etc/fstab with option `noauto'. # It is possible to use an already mounted device or one which is not in # /etc/fstab by using the option --skip-mount|-s in the command line MEDIUM=/media/zip # OPTIONS is a comma-separated list of options. # Possible options include: tar[=posixtarprogram], gnutar[=gnutarprogram], # solaristar[=solaristarprogram], restart # Examples: # OPTIONS=tar=gtar # OPTIONS=solaristar,restart # OPTIONS="gnutar, restart=1" # Recommended for a Solaris download host when possible: # OPTIONS=solaristar,gnutar=gtar,restart OPTIONS= # DEFAULT_APTGETACTION is the action taken by apt-get when neither # the --aptgetaction nor the --packages options are given. # Possible actions include: dselect-upgrade(default), upgrade and dist-upgrade DEFAULT_APTGETACTION=dselect-upgrade # The regexp applied to filter (with grep) the files to download. # Examples: # GREP="^http\|^ftp" # GREP="-v ^cdrom\|^file" GREP="^http\|^ftp" apt-zip-0.18/Makefile0000644000232200023220000000216510703611126014655 0ustar pbuilderpbuilderDESTDIR= CONFDIR= ${DESTDIR}/etc/apt SHAREDIR= ${DESTDIR}/usr/share/apt-zip BINDIR= ${DESTDIR}/usr/bin SBINDIR= ${DESTDIR}/usr/sbin MANDIR= ${DESTDIR}/usr/share/man MAN8DIR= ${MANDIR}/man8 METHDIR= ${SHAREDIR}/methods SCRIPTS= apt-zip-list SSCRIPTS= apt-zip-inst SHARED= common.sh METHODS= wget wget-dos # lftp CONFFILE= apt-zip.conf MANPAGE= apt-zip.8 MANLINKS= ${SCRIPTS:=.8} ${SSCRIPTS:=.8} VERSION=$(shell dpkg-parsechangelog | grep 'Version: ' | cut -f2 -d' ') build: common.sh ${MANPAGE} common.sh: sed "s/^[[:space:]]*\(APTZIPVERSION=\).*$$/\1$(VERSION)/" common.sh install: build install -d ${BINDIR} ${SBINDIR} ${CONFDIR} ${SHAREDIR} ${METHDIR} ${MAN8DIR} install -m755 ${SCRIPTS} ${BINDIR} install -m755 ${SSCRIPTS} ${SBINDIR} install -m755 $(patsubst %,methods/%,${METHODS}) ${METHDIR} install -m644 ${SHARED} ${SHAREDIR} install -m644 ${CONFFILE} ${CONFDIR} install -m644 ${MANPAGE} ${MAN8DIR} for i in ${MANLINKS}; do \ ln -s ${MANPAGE} ${MAN8DIR}/$$i ;\ done clean: rm -f manpage.* ${MANPAGE} rm -f common.sh apt-zip.8: apt-zip.sgml docbook2man apt-zip.sgml .PHONY: clean build install apt-zip-0.18/apt-zip-list0000755000232200023220000000615310750541275015512 0ustar pbuilderpbuilder#!/bin/bash exithook() { #rm -f "$TMP" "$TEMP" "$BSTMP" rm -f "$TMP" "$TEMP" } SHAREDIR=$(cd $(dirname $0) && pwd) [ -r "${SHAREDIR}/common.sh" ] || SHAREDIR=/usr/share/apt-zip . "${SHAREDIR}/common.sh" # options to take care [ -z "$APTGETACTION" -a -z "$PACKAGES" ] && eval export APTGETACTION=\${APTGETACTION-${DEFAULT_APTGETACTION}} [ -n "$APTGETACTION" ] && check_aptgetaction # option to run apt-zip-list as non-root APTGETEXTRAOPTS="${APTGETEXTRAOPTS} -o Debug::NoLocking=true" # Find block size on zip #BSTMP=$(tempfile -d "$MEDIUM" -p aptzip) #if [ $? != 0 ] #then # error "Could not create temporary file" #fi #echo "bs test" > "$BSTMP" #BLOCKSIZE=$(du -b "$BSTMP" | cut -f1) #rm "$BSTMP" #echo >&2 "Block size = $BLOCKSIZE" TMP=$(tempfile -p aptzip) TEMP=$(tempfile -p aptzip) [ -n "$PACKAGES" ] && apt-get ${APTGETEXTRAOPTS} -qq --print-uris install $PACKAGES > "$TMP" [ -n "$APTGETACTION" ] && apt-get ${APTGETEXTRAOPTS} -qq --print-uris ${APTGETACTION} >> "$TMP" grep $GREP < "$TMP" | tr -d "'" | sed 's/SHA256://' | sort -u > "$TEMP" if [ $? != 0 ] then error "apt-get failed" fi # We will tell the user how much it is to download and in how many packages # (even on a fast connection there could be restrictions) DWLSIZE=$( cut -d' ' -f3 < "$TMP" | { _SZ=0 while read val do # nblocks=$[ ( $val / $BLOCKSIZE ) + 1 ] _SZ=$[ $_SZ + $val ] # _SZ=$[ $_SZ + $nblocks ] done echo $_SZ } ) [ "$DWLSIZE" -eq "0" ] && DWLSIZE=unknown export DWLSIZE PACKCOUNT=`cat "$TMP" | wc -l` export PACKCOUNT # Check requested size against free space #SIZE0=$(echo 'n' | apt-get ${APTGETEXTRAOPTS} dselect-upgrade | grep '^Need to get' | cut -d' ' -f4) #error "Size0 = $SIZE0 - Size = $SIZE blocks = $[ $SIZE * $BLOCKSIZE ]" #export the sleep command so it is visible in the method script export SLEEPTIME export SLEEPCMD=`eval "$SLEEPEVALCMD"` export CHECK=`eval "$CHECKEVALCMD"` export APTGETACTION # Write the script SCRIPT="${MEDIUM}"/fetch-script-$METHOD-$(uname -n) export SCRIPT if [ "$APTGETACTION" = "update" ] then [ "$OPTION_TAR" = "0" ] \ && echo "Error: the \`tar' option should be set when using" \ "\`--aptgetaction update'" \ && exit 1 # Remove .bz2 and .gz extension from the `Packages' and # `Sources' index files perl -pn -i.bak \ -e 's/Packages\.bz2\s/Packages /;' \ -e 's/Packages\.gz\s/Packages /;' \ -e 's/Sources\.bz2\s/Sources /;' \ -e 's/Sources\.gz\s/Sources /;' \ $TEMP fi # --print-uris shows: URI filename size-in-bytes checksum $FILTER < "$TEMP" >"$SCRIPT" if [ $? != 0 ] then echo >&2 "WARNING: an error occured in the $SCRIPT script" exit 1 fi cat > "${MEDIUM}/${APTZIPINSFILE}" <