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

Re: Valid-Until and snapshot or archives

Klaus Ethgen <Klaus@Ethgen.de> writes:

> Hi,
> I recently found myself with the problem that I have tu use one source
> from snapshot.debian.org (fuse as it is broken in sid) and the
> Valid-Until time setting in the release file and apt revoking to use
> that one.
> Generally I think the Valid-Until is a good think so I do not want to
> switch it of globally (Acquire::Check-Valid-Until) but for this
> particular source only. However, this might be a solution for me (well
> there is no way at the moment if I see correct), this shows a more
> general problem.
> So the question is how to handle that Valid-Until header in archive
> release files? Should Archives remove them (then that is a bug of
> snapshot.debian.org) or should there be a switch in apt config to
> disable it for one particular source URL?
> Regards
>    Klaus Ethgen

If an archive puts a Valid-Until header in then it better update that

Aside from that there now (since 0.8) is a general way to add support
for enabling/disabling this on a per source basis. The sources.list file
now has an option field. What was previously called Vendor field and has
been supported but unused for many years.

    deb     [key1=value key2=value1,value2 ...] url suite component
    deb     [key1=value key2=value1,value2 ...] url path/
    deb-src [key1=value key2=value1,value2 ...] url suite component
    deb-src [key1=value key2=value1,value2 ...] url path/

Currently there is only one key that is supported: arch. E.g.:

    deb      [arch=armel] http://ftp.de.debian.org/debian sid main

and Apt::Architectures={"amd64";"armel"; }; results in apt-get update

    Hit http://ftp.de.debian.org sid/main armel Packages

The support for the key/value option is kept general and will parse
anything you put in there and attach it as dictionary to the source. So
all you need to do is pick a "key" and "value"s for it and then look at
the code that does the Valid-Until check and add a little code there
that checks if the source has your "key" and then behave according to
the "value" assigned. That should not be too hard to patch in.

It might be nice to allow more than just disabling the feature for a
source. You could support that one can also set the time limit for a
source even if the source has no entry or to override it. E.g.:

valid-until=always      - Ignore the valid-until entry
valid-until=active      - Honor the valid-until entry
valid-until=24h         - Assume Release file is valid for 24h (from
                          Date entry or timestamp in signature)


Reply to: