[Apt-zip-devel] r77 - in trunk: . debian methods

eddyp-guest at alioth.debian.org eddyp-guest at alioth.debian.org
Tue Mar 18 08:58:42 UTC 2008


Author: eddyp-guest
Date: 2008-03-18 08:58:41 +0000 (Tue, 18 Mar 2008)
New Revision: 77

Added:
   trunk/README.wget-dos
   trunk/debian/apt-zip.docs
   trunk/debian/apt-zip.install
   trunk/debian/apt-zip.links
   trunk/debian/apt-zip.manpages
   trunk/methods/wget-dos
Modified:
   trunk/Makefile
   trunk/apt-zip-list
   trunk/apt-zip.sgml
   trunk/debian/changelog
   trunk/debian/control
   trunk/debian/rules
Log:
added files that make release 0.17

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2008-03-18 08:53:56 UTC (rev 76)
+++ trunk/Makefile	2008-03-18 08:58:41 UTC (rev 77)
@@ -10,7 +10,7 @@
 SCRIPTS=	apt-zip-list
 SSCRIPTS=	apt-zip-inst
 SHARED=		common.sh
-METHODS=	wget # lftp
+METHODS=	wget wget-dos # lftp
 CONFFILE=	apt-zip.conf
 MANPAGE=	apt-zip.8
 MANLINKS=	${SCRIPTS:=.8} ${SSCRIPTS:=.8}

Added: trunk/README.wget-dos
===================================================================
--- trunk/README.wget-dos	                        (rev 0)
+++ trunk/README.wget-dos	2008-03-18 08:58:41 UTC (rev 77)
@@ -0,0 +1,15 @@
+wget-dos is a method that creates the fetch scripts for hosts running DOS, the
+main target being FreeDOS. As a side effect, it will also work with Windows
+based machines ;) After generating the scripts, you will get a warning which
+binaries need to be installed on the target according to your settings. These
+can be in PATH or simply in the same directory as the scripts. The easiest
+possibility is to disable md5-checks, then you just need wget.exe. Still,
+adding md5sum.exe is also not that hard :) Locations for working binaries are:
+
+wget   (DOS)  : http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/pkgs/wgetx.zip
+md5sum (DOS)  : http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/pkgs/md5sumx.zip
+wget   (Win32): http://users.ugent.be/~bpuype/cgi-bin/fetch.pl?dl=wget/wget.exe
+md5sum (Win32): http://www.md5summer.org/md5sum.zip
+
+Note that method-options like "tar" and "restart" are not (yet?) supported.
+Thus, you also cannot use the update function of APT yet.

Modified: trunk/apt-zip-list
===================================================================
--- trunk/apt-zip-list	2008-03-18 08:53:56 UTC (rev 76)
+++ trunk/apt-zip-list	2008-03-18 08:58:41 UTC (rev 77)
@@ -75,6 +75,7 @@
 
 # Write the script
 SCRIPT="${MEDIUM}"/fetch-script-$METHOD-$(uname -n)
+export SCRIPT
 
 if [ "$APTGETACTION" = "update" ]
 then

Modified: trunk/apt-zip.sgml
===================================================================
--- trunk/apt-zip.sgml	2008-03-18 08:53:56 UTC (rev 76)
+++ trunk/apt-zip.sgml	2008-03-18 08:58:41 UTC (rev 77)
@@ -44,7 +44,7 @@
     <title>DESCRIPTION</title>
 
     <simpara>
-      This manpage should be up-to-date with version 0.16 of the
+      This manpage should be up-to-date with version 0.17 of the
       programs.
     </simpara>
 
@@ -206,8 +206,9 @@
           <term>--method, -M</term>
           <listitem>
             <simpara>
-              Select a method other than the default one.  Only the
-              <option>wget</option> method is supported for now.
+              Select a method other than the default one. The
+              <option>wget</option> and <option>wget-dos</option> methods
+	      are currently supported.
             </simpara>
           </listitem>
         </varlistentry>

Added: trunk/debian/apt-zip.docs
===================================================================
--- trunk/debian/apt-zip.docs	                        (rev 0)
+++ trunk/debian/apt-zip.docs	2008-03-18 08:58:41 UTC (rev 77)
@@ -0,0 +1,3 @@
+README.wget-dos
+TODO
+ENHANCEMENTS

Added: trunk/debian/apt-zip.install
===================================================================
--- trunk/debian/apt-zip.install	                        (rev 0)
+++ trunk/debian/apt-zip.install	2008-03-18 08:58:41 UTC (rev 77)
@@ -0,0 +1,7 @@
+debian/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/

Added: trunk/debian/apt-zip.links
===================================================================
--- trunk/debian/apt-zip.links	                        (rev 0)
+++ trunk/debian/apt-zip.links	2008-03-18 08:58:41 UTC (rev 77)
@@ -0,0 +1,3 @@
+usr/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
+

Added: trunk/debian/apt-zip.manpages
===================================================================
--- trunk/debian/apt-zip.manpages	                        (rev 0)
+++ trunk/debian/apt-zip.manpages	2008-03-18 08:58:41 UTC (rev 77)
@@ -0,0 +1 @@
+debian/tmp/usr/share/man/man8/apt-zip.8

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-03-18 08:53:56 UTC (rev 76)
+++ trunk/debian/changelog	2008-03-18 08:58:41 UTC (rev 77)
@@ -1,3 +1,12 @@
+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 <cate at debian.org>  Fri, 12 Oct 2007 18:48:41 +0200
+
 apt-zip (0.16) unstable; urgency=low
 
   [Eddy Petrișor ]

Modified: trunk/debian/control
===================================================================
--- trunk/debian/control	2008-03-18 08:53:56 UTC (rev 76)
+++ trunk/debian/control	2008-03-18 08:58:41 UTC (rev 77)
@@ -2,7 +2,7 @@
 Section: admin
 Priority: extra
 Build-Depends-Indep: docbook-utils, docbook
-Build-Depends: debhelper (>= 5)
+Build-Depends: debhelper (>= 5), cdbs
 Maintainer: Giacomo Catenazzi <cate at debian.org>
 Uploaders: Eddy Petrișor <eddy.petrisor at gmail.com>, François Févotte <francois.fevotte at ensta.org>
 Standards-Version: 3.7.2.2

Modified: trunk/debian/rules
===================================================================
--- trunk/debian/rules	2008-03-18 08:53:56 UTC (rev 76)
+++ trunk/debian/rules	2008-03-18 08:58:41 UTC (rev 77)
@@ -1,65 +1,22 @@
 #!/usr/bin/make -f
 #-*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file is public domain software, originally written by Joey Hess.
 
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
 # 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
 
-build: build-stamp
-build-stamp:
-	dh_testdir
+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...'
 
-	$(MAKE)
-	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
 
-	touch build-stamp
+DEB_MAKE_CLEAN_TARGET   = clean
+DEB_MAKE_BUILD_TARGET   = build
+DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(CURDIR)/debian/tmp/
 
-clean:
-	dh_testdir
-	dh_testroot
-	rm -f build-stamp
 
-	[ ! -f Makefile ] || $(MAKE) clean
-
-	dh_clean
-
-install: build
-	dh_testdir
-	dh_testroot
-	dh_clean -k
-	dh_installdirs
-
-	$(MAKE) DESTDIR=`pwd`/debian/`dh_listpackages` install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs
-	dh_installdocs ENHANCEMENTS
-	dh_installexamples
-	dh_installman
-	dh_link
-	dh_compress
-	dh_fixperms
-	dh_installdeb
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-# Build architecture-dependent files here.
-binary-arch: build
-# We have nothing to do by default.
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
-

Added: trunk/methods/wget-dos
===================================================================
--- trunk/methods/wget-dos	                        (rev 0)
+++ trunk/methods/wget-dos	2008-03-18 08:58:41 UTC (rev 77)
@@ -0,0 +1,137 @@
+#!/bin/bash -e
+
+error()
+{
+    echo >&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
+
+[ ! "${USEMD5SUMS}" = 'no' ] && cat >>${SCRIPT}.utils <<-EOF
+	if "%3"=="" goto md5_ok
+	if "%3"=="0" goto md5_ok
+	if %HAS_md5sum.exe%==1 echo %3 *%file_to_check% | md5sum -c
+	if errorlevel 1 goto failed
+:md5_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
+[ ! "${USEMD5SUMS}" = 'no' ] && add_check md5sum.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_md5sum.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 [ ! "${USEMD5SUMS}" = '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."




More information about the apt-zip-devel mailing list