On Sun, Nov 18, 2018 at 11:56:27AM -0500, Yaroslav Halchenko wrote: > > On Sat, 17 Nov 2018, Julian Andres Klode wrote: > > > On Fri, Nov 16, 2018 at 04:26:24PM -0500, Yaroslav Halchenko wrote: > > > and I guess I can demystify right away what is going on (although I > > > didn't try to reconfirm by rebuilding or debugging): > > > > https://salsa.debian.org/apt-team/apt/blob/master/apt-private/private-show.cc#L488 > > > > if (F.Flagged(pkgCache::Flag::NoPackages)) > > > continue;
This is a red hering. The "NoPackages" flag applies to files which can't have packages included like Translation-* files, not to "empty" Packages files – those do not even reach this place in code as they never become files apt talks about here. > > > so no apt entries are displayed if they provide no packages ATM. The Packages file doesn't exist, so it can't be a source for anything, hence it is not listed – that is at least the logic I would retrofit onto it. Note that even if the Packages file exists but is empty apt ("recent versions") will not download the file (= why waste time downloading empty files? – which compressed aren't empty, just very tiny) and hence result in the same behaviour – still logical as empty files can not be a source for anything either. > > > Although I could see how it is useful generally, for our purpose it is > > > somewhat of a blow, since we are trying to use apt-cache policy output > > > to decide what APT sources in general are configured. and since we are > > > rolling back in time to use snapshots, they might have had packages at > > > that point in time, thus we better adjust them as well. > > > I don't know if it helps, but you might want to look at apt-get > > indextargets? > > wow -- that is a great to know command to provide structured output, Thanks! > in > the future (seems to be not present even in stretch's version of apt 1.0.10.2) > we should use it instead of apt-cache policy for sure BUT unfortunately it > also falls short the same way: The detailed doc in acquire-additional-files.md mentions the flag --no-release-info which will cause this command to print stanzas about all files which could exist. I am not sure what you are trying to do here through – and I am very scared by the careless suggestion to look into Release files youself… that is going to be an endless stream of problems for you and your users if you aren't extremely careful. For me it would be more "logical" for a user to freeze a certain Debian release to a certain date rather than your current sources to a certain date in the past… e.g. even 'stable' changes its meaning over time, so what happens if you are on buster at the moment and freeze a date 1 year back – are you freezing to the state buster was in, then it was still testing or are you freezing to the then stable release which wasn't buster… And that doesn't even include changes in the repository setup between releases like the move from stable/updates to stable-updates and so on. > > > Also documentation has no hint on such a "feature": > > > > policy [pkg...] > > > policy is meant to help debug issues relating to the > > > preferences file. With no > > > arguments it will print out the priorities of each source. > > > Otherwise it prints > > > out detailed information about the priority selection of the > > > named package. > > > > so "each source", but not each source is printed out! > > > > I wish this "feature" of skipping APT sources without packages was somehow > > > optional/configurable. Otherwise, at least documentation should mention > > > such > > > feature. > > > I don't necessarily see it as skipping sources. I don't think the Packages > > files > > for these sources exist in the cache (as none are downloaded), hence they > > won't be > > shown. > > yes, they do not exist, but it doesn't mean that the "source" doesn't exist. The source doesn't exist at present in the cache, which is what all of apt-cache is talking about. It doesn't know about the future, nor the past – not even the present. Just what it has on file at present which together represent a reality from the last decade or from just now. Source means for me here something more abstract along the lines of "some place packages can come from" and not the more concret "a line in sources.list" – and in that later sense a place which doesn't exist (or is empty) is no place a package can come from at the moment. Best regards David Kalnischkies
signature.asc
Description: PGP signature