[Slapt-get-devel] Proposal - handling of missing sources
Jason Woodward
woodwardj at jaos.org
Wed Feb 15 10:26:27 EST 2006
Hi A.J.,
> So if such a package source remains present, but isn´t actually THERE - then
> the update now fails, because this happens BEFORE gslapt and slapt-get´s
> output is hard to catch (where DOES it go anyway ?) it is very hard to report
> back to the user the status of this, let alone doing it in a way my APP can
> understand, so the user has no real idea why some new package he wants isn´t
> showing up.
>
> My new proposal is thus:
> 1) File:/// sources should be treated differently. If ONLY a file:/// source
> is present, obviously it needs to fail if it´s not there, but if there are
> multiple sources, file:/// sources should be considdered non-compulsory they
> are in probably 99% of cases going to be on removable media, so slapt-get
> should add them if they are there, and just cleanly skip over them if not.
I have worked hard to make sure all sources are considered equally thus far. I think it needs
to be really compelling and well thought out to change that. Can this also be solved with
different config files?
> 2) With regard to other sources, currently slapt-get gives no scriptable
> output on failures. I think slapt-get should if an external source fails
> change it´s exit status. Default ¨all went well¨ status should be 0, it
> should always finish running, but if any source fails, set some variable to a
> number relating to the source position in slapt-getrc, e.g. the first SOURCE=
> line would if it fail set the variable to 1, the second to 2 etc.
> At exit tiime, pass your exit() call this variable, that way if sources fail,
> any outside scripts or programs will know WHICH source failed and can try to
> handle it intelligently. This could range from just an error message to
> temporarilly commenting out the source before retrying depending on the level
> of automation needed and what the user wants.
It does currently return an exit status that is quite easy to check.
slapt-get --update || echo "return status tells us the update failed"
Retrieving package data
[ftp://distro.ibiblio.org/pub/linux/distributions/slackware/slackware-current/]...Cached
Retrieving patch list
[ftp://distro.ibiblio.org/pub/linux/distributions/slackware/slackware-current/]...Done
Retrieving checksum list
[ftp://distro.ibiblio.org/pub/linux/distributions/slackware/slackware-current/]...Cached
Reading Package Lists...Done
Retrieving package data [file:///no/such/dir/]...Failed to download: Couldn't open file
/no/such/dir/PACKAGES.TXT
Retrieving package data [file://i_should_not_resolve.com/]...Failed to download: Couldn't open
file /PACKAGES.TXT
Sources failed to download, correct sources and rerun --update
return status tells us the update failed
Maybe your wrapper could generate a custom oladrc file and then invoke slapt-get like this
slapt-get --config /path/to/oladrc --update || slapt-get --update
so that if those fail it falls back to the normal slapt-getrc file.
take care,
jason
--
Jason Woodward
woodwardj at jaos.org
--
Jason Woodward
woodwardj at jaos.org
More information about the Slapt-get-devel
mailing list