Debian Bug report logs - #422088
[Patch] wish preseed_fetch could distinguish between non-existance of a requested file and other failures to fetch file.

version graph

Package: preseed-common; Maintainer for preseed-common is Debian Install System Team <debian-boot@lists.debian.org>; Source for preseed-common is src:preseed.

Reported by: "Alex Owen" <r.alex.owen@gmail.com>

Date: Thu, 3 May 2007 13:39:01 UTC

Severity: wishlist

Tags: patch

Found in version preseed/1.29

Fixed in version debian-installer-utils/1.58

Done: Frans Pop <fjp@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#422088; Package preseed-common. Full text and rfc822 format available.

Acknowledgement sent to "Alex Owen" <r.alex.owen@gmail.com>:
New Bug report received and forwarded. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "Alex Owen" <r.alex.owen@gmail.com>
To: submit@bugs.debian.org
Subject: [Patch] wish preseed_fetch could distinguish between non-existance of a requested file and other failures to fetch file.
Date: Thu, 3 May 2007 14:35:42 +0100
[Message part 1 (text/plain, inline)]
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
[preseed_fetch.diff (text/x-patch, attachment)]

Information stored:
Bug#422088; Package preseed-common. Full text and rfc822 format available.

Acknowledgement sent to Otavio Salvador <otavio@debian.org>:
Extra info received and filed, but not forwarded. Full text and rfc822 format available.

Message #10 received at 422088-quiet@bugs.debian.org (full text, mbox):

From: Otavio Salvador <otavio@debian.org>
To: Alex Owen <r.alex.owen@gmail.com>
Cc: 422088-quiet@bugs.debian.org
Subject: Re: Bug#422088: [Patch] wish preseed_fetch could distinguish between non-existance of a requested file and other failures to fetch file.
Date: Thu, 03 May 2007 13:45:09 -0300
"Alex Owen" <r.alex.owen@gmail.com> writes:

> 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.

IMHO, your patch looks great. It allow a very nice customizatility
when handling preseeding errors and would also allow the improvement of
error messages inside of installer itself.

-- 
        O T A V I O    S A L V A D O R
---------------------------------------------
 E-mail: otavio@debian.org      UIN: 5906116
 GNU/Linux User: 239058     GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
 you the whole house."



Tags added: patch Request was from stappers@stappers.nl (Geert Stappers) to control@bugs.debian.org. (Thu, 03 May 2007 19:33:01 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#422088; Package preseed-common. Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #17 received at 422088@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: Alex Owen <r.alex.owen@gmail.com>, 422088@bugs.debian.org
Subject: Re: Bug#422088: [Patch] wish preseed_fetch could distinguish between non-existance of a requested file and other failures to fetch file.
Date: Sun, 6 May 2007 17:44:23 -0400
[Message part 1 (text/plain, inline)]
Alex Owen wrote:
>  		# 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

It's generally not a good idea to rely on command error messages like
this.

> 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"

An alternative way to do this is to first always load the standard preseed
file, and then try to fetch the load preseed file, which if it exists, can
override settings in the standard file.

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#422088; Package preseed-common. Full text and rfc822 format available.

Acknowledgement sent to "Alex Owen" <r.alex.owen@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #22 received at 422088@bugs.debian.org (full text, mbox):

From: "Alex Owen" <r.alex.owen@gmail.com>
To: "Joey Hess" <joeyh@debian.org>
Cc: 422088@bugs.debian.org
Subject: Re: Bug#422088: [Patch] wish preseed_fetch could distinguish between non-existance of a requested file and other failures to fetch file.
Date: Tue, 8 May 2007 09:25:58 +0100
On 06/05/07, Joey Hess <joeyh@debian.org> wrote:
> Alex Owen wrote:
> >               # 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
>
> It's generally not a good idea to rely on command error messages like
> this.

I agree,
I was thinking that getting wget to give a sensible exit status rather
than parsing the error message. Perhaps that warrents a wishlist bug
on wget?

Perhaps reducing the grep line to:
> > +             elif    grep "404" $log >/dev/null ; then
would be more robust?


On 06/05/07, Joey Hess <joeyh@debian.org> wrote:
> An alternative way to do this is to first always load the standard preseed
> file, and then try to fetch the load preseed file, which if it exists, can
> override settings in the standard file.

I used to think that too... untill I discussed the idea with Philip Hands.


Alex Owen:
" I was thinking that a cleaner approach might be to have all public and
 all examples under classes then override that by placing stuff in
 local (or local_classes if you want to keep local for your way of
 doing things). I have test code which will test for the existance of
 [presee|subclasses|early_script|late_script] under local and use that
 and fall back to the equivilent file under classes if that fails."

Philip Hands:
" That sounds like the way I used to do that, but it has the problem that if
 you have a network outage, it's possible to have it skip an existing local
 file, and then carry on regardless, rather than having it complain that it
 failed to get a file it was expecting to exist -- this possibility, while
 slight makes the whole thing non-deterministic, so I'd rather avoid it
 (unless you have a scheme where a file that exists but is temporarily
 unavailable is distinguished from one that doesn't exist at all, in which
 case I'm all ears :-)

Alex Owen:
" If wget (busybox) gives different error code for "not found" response
 from web server as opposed to no response from server then you can
 distinguish."

I then wrote this patch as parsing the error message was easier than
hacking the wget code!

Thanks for your comments,
Alex Owen



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#422088; Package preseed-common. Full text and rfc822 format available.

Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #27 received at 422088@bugs.debian.org (full text, mbox):

From: Joey Hess <joeyh@debian.org>
To: Alex Owen <r.alex.owen@gmail.com>
Cc: 422088@bugs.debian.org
Subject: Re: Bug#422088: [Patch] wish preseed_fetch could distinguish between non-existance of a requested file and other failures to fetch file.
Date: Tue, 8 May 2007 15:19:54 -0400
[Message part 1 (text/plain, inline)]
Alex Owen wrote:
> I agree,
> I was thinking that getting wget to give a sensible exit status rather
> than parsing the error message. Perhaps that warrents a wishlist bug
> on wget?

On busybox, but there might be resistance to adding such nonstandard
stuff to busybox wget.

> Perhaps reducing the grep line to:
> >> +             elif    grep "404" $log >/dev/null ; then
> would be more robust?

Seems likely to be less robust, actually.

-- 
see shy jo
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#422088; Package preseed-common. Full text and rfc822 format available.

Acknowledgement sent to "Alex Owen" <r.alex.owen@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #32 received at 422088@bugs.debian.org (full text, mbox):

From: "Alex Owen" <r.alex.owen@gmail.com>
To: 422088@bugs.debian.org
Subject: Re: Bug#422088: [Patch] wish preseed_fetch could distinguish between non-existance of a requested file and other failures to fetch file.
Date: Thu, 13 Sep 2007 21:49:05 +0100
[Message part 1 (text/plain, inline)]
This mail is mostly a note to myself in a safe place!

On 08/05/2007, Alex Owen <r.alex.owen@gmail.com> wrote:
> On 06/05/07, Joey Hess <joeyh@debian.org> wrote:
> > Alex Owen wrote:
> > > +             elif    grep "server returned error 404" $log >/dev/null ; then
> >
> > It's generally not a good idea to rely on command error messages like
> > this.
>
> I agree,
> I was thinking that getting wget to give a sensible exit status rather
> than parsing the error message. Perhaps that warrents a wishlist bug
> on wget?

I have posted to GNU-wget mailing list:
 http://www.mail-archive.com/wget%40sunsite.dk/msg10259.html

proposing wget exits with exit status 4  for 404 errors

Attached is an untested patch to busybox wget to implement an exit
status of 4 for 404 errors.

That is all for this update!
Alex Owen
[bb_wget.patch (text/x-patch, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#422088; Package preseed-common. Full text and rfc822 format available.

Acknowledgement sent to "Alex Owen" <r.alex.owen@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. Full text and rfc822 format available.

Message #37 received at 422088@bugs.debian.org (full text, mbox):

From: "Alex Owen" <r.alex.owen@gmail.com>
To: 422088@bugs.debian.org
Subject: Re: Bug#422088: [Patch] wish preseed_fetch could distinguish between non-existance of a requested file and other failures to fetch file.
Date: Thu, 13 Sep 2007 22:05:42 +0100
On 13/09/2007, Alex Owen <r.alex.owen@gmail.com> wrote:
>
> I have posted to GNU-wget mailing list:
>  http://www.mail-archive.com/wget%40sunsite.dk/msg10259.html
> proposing wget exits with exit status 4  for 404 errors
>

Reply already... in summary: planning to implement exit codes in the
wget version 1.13 time frame. Not willing to do adhoc cases in mean
time.
upstream wishlist bug here:
  https://savannah.gnu.org/bugs/index.php?20333




Reply sent to Frans Pop <fjp@debian.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to "Alex Owen" <r.alex.owen@gmail.com>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #42 received at 422088-close@bugs.debian.org (full text, mbox):

From: Frans Pop <fjp@debian.org>
To: 422088-close@bugs.debian.org
Subject: Bug#422088: fixed in debian-installer-utils 1.58
Date: Tue, 17 Jun 2008 12:32:10 +0000
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-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 25 Dec 2009 07:33:47 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 20:51:31 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.