[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#422088: marked as done ([Patch] wish preseed_fetch could distinguish between non-existance of a requested file and other failures to fetch file.)



Your message dated Tue, 17 Jun 2008 12:32:10 +0000
with message-id <E1K8aM6-00023M-JZ@ries.debian.org>
and subject line Bug#422088: fixed in debian-installer-utils 1.58
has caused the Debian Bug report #422088,
regarding [Patch] wish preseed_fetch could distinguish between non-existance of a requested file and other failures to fetch file.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
422088: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=422088
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: preseed-common
Severity: wishlist
Version: 1.29

Attached is a patch against d-i SVN trunk so that file_preseed can
distinuish between a failure to fetch a file because it does not exist
and any other failure.

If a file does not exist then exit status is 4 otherwise it is 1.
I chose 4 as shorthand for HTTP 404 error.

This should be backwards compatable with existing code that just
checks for sucsess/fail.
New code (I'm thinking custom preseed systems here) can then pase the
exit code.

A custom preseed setup could have 2 dirs such as:
$base/standard
$base/local

a master preseed script could then try to do
 "preseed_fetch $base/local/script"
and if this exits with status 4 fall back to
 "preseed_fetch $base/standard/script"

If some other failure occurs the master preseed script can act accordingly.
I'm thinking of the "Hands-Off" preseed system here.

Feel free to change the exit code 4 to someother non-zero value if you will!
I'm afraid this code is as yet untested.

Regards

Alex Owen
Index: preseed/fetch-methods/file
===================================================================
--- preseed/fetch-methods/file	(revision 46683)
+++ preseed/fetch-methods/file	(working copy)
@@ -1,6 +1,8 @@
 protocol_fetch() {
 	FILE="${1#file://*}"
-	if [ ! -e "$FILE" ] || ! cp "$FILE" $2; then
+	if [ ! -e "$FILE" ] ; then
+		return 4
+	elif ! cp "$FILE" $2; then
 		return 1
 	else
 		return 0
Index: preseed/fetch-methods/http
===================================================================
--- preseed/fetch-methods/http	(revision 46683)
+++ preseed/fetch-methods/http	(working copy)
@@ -1,6 +1,7 @@
 protocol_fetch() {
 	local url="$1"
 	local file="$2"
+	local log=/tmp/preseed_fetch_http
 	iters=0
 
 	# use the proxy for wgets (should speed things up)
@@ -10,10 +11,15 @@
 
 	while [ $iters -lt 3 ]; do
 		# TODO add progress bar
-		if wget -q "$url" -O "$file"; then
+		if wget -q "$url" -O "$file" 2>$log ; then
+			rm -f $log
 			return 0
+		elif	grep "server returned error 404" $log >/dev/null ; then
+			rm -f $log
+			return 4			
 		fi
 		iters=$(($iters + 1))
 	done
+	rm -f $log
 	return 1
 }
Index: preseed/fetch-methods/floppy
===================================================================
--- preseed/fetch-methods/floppy	(revision 46683)
+++ preseed/fetch-methods/floppy	(working copy)
@@ -4,7 +4,9 @@
 	mountfloppy || true
 	touch /var/run/preseed-usedfloppy
         
-	if [ ! -e "$FILE" ] || ! cp "$FILE" $2; then
+	if [ ! -e "$FILE" ] ; then
+		return 4
+	elif ! cp "$FILE" $2; then
 		return 1
 	else
 		return 0

--- End Message ---
--- Begin Message ---
Source: debian-installer-utils
Source-Version: 1.58

We believe that the bug you reported is fixed in the latest version of
debian-installer-utils, which is due to be installed in the Debian FTP archive:

debian-installer-utils_1.58.dsc
  to pool/main/d/debian-installer-utils/debian-installer-utils_1.58.dsc
debian-installer-utils_1.58.tar.gz
  to pool/main/d/debian-installer-utils/debian-installer-utils_1.58.tar.gz
di-utils-exit-installer_1.58_all.udeb
  to pool/main/d/debian-installer-utils/di-utils-exit-installer_1.58_all.udeb
di-utils-mapdevfs_1.58_amd64.udeb
  to pool/main/d/debian-installer-utils/di-utils-mapdevfs_1.58_amd64.udeb
di-utils-reboot_1.58_all.udeb
  to pool/main/d/debian-installer-utils/di-utils-reboot_1.58_all.udeb
di-utils-shell_1.58_all.udeb
  to pool/main/d/debian-installer-utils/di-utils-shell_1.58_all.udeb
di-utils-terminfo_1.58_all.udeb
  to pool/main/d/debian-installer-utils/di-utils-terminfo_1.58_all.udeb
di-utils_1.58_amd64.udeb
  to pool/main/d/debian-installer-utils/di-utils_1.58_amd64.udeb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 422088@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Frans Pop <fjp@debian.org> (supplier of updated debian-installer-utils package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Tue, 17 Jun 2008 14:20:06 +0200
Source: debian-installer-utils
Binary: di-utils-shell di-utils-reboot di-utils-exit-installer di-utils di-utils-mapdevfs di-utils-terminfo
Architecture: source all amd64
Version: 1.58
Distribution: unstable
Urgency: low
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Frans Pop <fjp@debian.org>
Description: 
 di-utils   - Miscellaneous utilities for the debian installer (udeb)
 di-utils-exit-installer - Exit installer (udeb)
 di-utils-mapdevfs - mapdevfs utility for the debian installer (udeb)
 di-utils-reboot - Reboot (udeb)
 di-utils-shell - Execute a shell (udeb)
 di-utils-terminfo - Terminfo entries needed by newt/slang in debian installer (udeb)
Closes: 422088
Changes: 
 debian-installer-utils (1.58) unstable; urgency=low
 .
   [ Evan Dandrea ]
   * Avoid triggering sound events, which can cause audio to be played every
     time update-dev runs; only relevant in live CD environments such as
     Ubuntu's (LP: #178057).
 .
   [ Philip Hands ]
   * Move fetch-url here from preseed.
   * Take inspiration from cdebconf about wget -c.
   * Add wrapper to wget that allows it to differentiate 404s as originally
     suggested by Alex Owen (closes: #422088).
   * Modify all fetch methods to return 4 for missing files.
   * Incorporate loads of suggestions from Frans Pop.
 .
   [ Frans Pop ]
   * in-target: accept --pass-stdout option and pass it on to log-output.
     Allows more flexible use of in-target, especially for single commands
     that need a correct target environment.
   * chroot-setup.sh: allow to override the normal LANG setting.
 .
   [ Updated translations ]
   * Belarusian (be.po) by Pavel Piatruk
   * Basque (eu.po) by Iñaki Larrañaga Murgoitio
   * Hungarian (hu.po) by SZERVÁC Attila
   * Marathi (mr.po) by Sampada
   * Panjabi (pa.po) by Amanpreet Singh Alam
Checksums-Sha1: 
 5c6e796285354c96152eef0382014fff38d0259d 1172 debian-installer-utils_1.58.dsc
 dc47b3110a047f7b3c4aefe28ffda0743443c743 72870 debian-installer-utils_1.58.tar.gz
 2d756b32fe498ebe0a0b6264589d4777aad1874f 17902 di-utils-shell_1.58_all.udeb
 3a50d12f0e8c09669ac46c1663568554608fbaec 8102 di-utils-reboot_1.58_all.udeb
 afbf1c3d00a9635a1e828e830fccf28ad105f956 2838 di-utils-exit-installer_1.58_all.udeb
 f322e867279d49bf79202ea039ab38855857e38e 2418 di-utils-terminfo_1.58_all.udeb
 cfe95b06ff638295ab994b527c104bc697072fe3 11360 di-utils_1.58_amd64.udeb
 68c41db0f01e664516b438b9220797b1b622cc4a 2412 di-utils-mapdevfs_1.58_amd64.udeb
Checksums-Sha256: 
 0dd8356811102c1a050bdcd2c90f0bc68adb99b6f2ce19398797fc9000248255 1172 debian-installer-utils_1.58.dsc
 f1bf4d351aa4b3ccefeea2aa9736e36b0082d7a37179fa413ca2bacb72870dcf 72870 debian-installer-utils_1.58.tar.gz
 aa1dfa3ea85d5190fab517c071a9ae335107b1bd99c686d79ba278b0397f8f45 17902 di-utils-shell_1.58_all.udeb
 4f70f08bcdc3964a160ce8ad7c1ed3aa33f8b20867b36d0c29b742e42d02f172 8102 di-utils-reboot_1.58_all.udeb
 72489e8903906b71cafaa8a32ce0d4b44ca316e2b3e5e8bb9c53b6ab86c764ae 2838 di-utils-exit-installer_1.58_all.udeb
 5ca5e6578c21c0c4427df85689cfd117076b22e8c3eff21cf842213f5d8bdd83 2418 di-utils-terminfo_1.58_all.udeb
 35ccf31178d93b870cc0ec0d41c398338d1f2c92b061667761f32ea862bb8f0f 11360 di-utils_1.58_amd64.udeb
 2dcb06f667341b6524fe237b53ed3fcb900102e80c965927befa40abe4c817d4 2412 di-utils-mapdevfs_1.58_amd64.udeb
Files: 
 46421904013b4501d0ff0923c65e5d55 1172 debian-installer standard debian-installer-utils_1.58.dsc
 07c021b7a3ff6de76370fc5210de6671 72870 debian-installer standard debian-installer-utils_1.58.tar.gz
 ec7f5cb2c46f68bdc7f073bc895ed657 17902 debian-installer standard di-utils-shell_1.58_all.udeb
 becfc38a98ddff6a49ffa3c8fd20f61a 8102 debian-installer standard di-utils-reboot_1.58_all.udeb
 8776ebf26fcd99a61b6d6a70905321a0 2838 debian-installer extra di-utils-exit-installer_1.58_all.udeb
 12f256e01c1dac7665205f8d8387172d 2418 debian-installer standard di-utils-terminfo_1.58_all.udeb
 2cd3ad89e5a53591c53288ddab1a30d6 11360 debian-installer standard di-utils_1.58_amd64.udeb
 09ca2e3c1667e5c8729447567b868226 2412 debian-installer standard di-utils-mapdevfs_1.58_amd64.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkhXreoACgkQgm/Kwh6ICoS0qQCffqY4kxUZdQk6YMilizB+aFZf
bLsAoILTM0709jvNfoEf9/Ch8ljFG/0S
=u9QK
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: