Bug#893754: autopkgtest 5.1 "autopkgtest-default-release" breaks tests that exercise apt
Control: tags -1 patch
^^^^^ untested and includes typo
We had a live discussion on #ubuntu-release just now. To keep it
attached to the bug, I send it here, including an untested patch with
typo in the attachment.
[11:06:51] <elbrus> Laney: slangasek: juliank: regarding debian bug 893754
[11:06:52] <ubot5> Debian bug 893754 in autopkgtest "autopkgtest 5.1
"autopkgtest-default-release" breaks tests that exercise apt"
[11:07:34] <juliank> elbrus: I just sent an email
[11:09:09] <elbrus> juliank: reading
[11:09:09] <elbrus> juliank: but it is python-apt specific?
[11:09:14] <elbrus> as apt just works int that environment
[11:09:23] <juliank> apt -o Dir should fail
[11:09:40] <juliank> In general, it's all very fragile
[11:10:13] <elbrus> what exactly is fragile?
[11:10:29] <juliank> What happens is that if you change the root
directory in apt by setting Dir, you still have the host's config files
read, because you're setting Dir after they are read.
[11:10:54] <juliank> Now apt tries to find the release you specified in
the host apt.conf(.d), but cannot find it inside Dir's sources.list and
[11:10:59] <elbrus> my problem, why I went for APT::Default-Release is
that it is agnostic for the delta between suite and codename
[11:12:33] <elbrus> I don't want to detect if /etc/apt/sources.list is
mentioning a suite or codename, and convert if required (as that means
knowing all codenames)
[11:13:12] <elbrus> therefor, the old method of using "release -a="
doesn't work anymore
[11:13:25] <juliank> elbrus: It's the same as using "release bionic"
[11:13:36] <juliank> without a= or n=
[11:13:51] <elbrus> juliank: so I don't need the a= or n=?
[11:13:57] <juliank> Right
[11:14:20] <juliank> If you just write "release foo", it checks
codename, suite, version. That's precisely what APT::Default-Release
[11:14:38] -*- juliank just learned that
[11:14:38] <elbrus> so wouldn't python-apt still error out?
[11:14:42] <juliank> No
[11:14:51] <elbrus> what's the diff?
[11:14:57] <juliank> The check for APT::Default-Release validity happens
before it creates the pin
[11:15:03] <juliank> #
[11:15:13] <juliank> pins are not checked
[11:15:17] <elbrus> great
[11:15:50] <Laney> hey elbrus and juliank
[11:15:51] <elbrus> juliank: can you update the documentation of
apt_preferences when you touch it again?
[11:15:55] <Laney> thanks for being responsive ?
[11:16:12] <elbrus> np (<cut>)
[11:17:48] <elbrus> hmm, I see an example without the a/n
[11:18:16] <juliank> yeah, the manpage does not really document it well,
but uses it
[11:19:20] -*- juliank writes a bug
[11:19:26] -*- elbrus wished he knew this a year ago
[11:19:40] <elbrus> much headaches whould have been avoided
[11:20:29] <juliank> elbrus: I only learned about that today as well :)
[11:20:45] <elbrus> well, if you didn't know... ;)
[11:20:47] <juliank> elbrus: though it's been that way since $forever
[11:20:51] <elbrus> ack
[11:21:00] <juliank> b2e465d6d3 (Arch Librarian 2004-09-20 16:56:32
+0000 59) CreatePin(pkgVersionMatch::Release,"",DefRel,990);
[11:21:11] <juliank> I mean, that was before bzr
[11:22:00] <juliank> Author: jgg, Date: 2001-02-20 07:03:16 GMT, "Join
[11:22:12] <Laney> apt's code always makes my head hurt a bit
[11:22:27] -*- elbrus never looked at it
[11:22:28] <juliank> Laney: just dont read it
[11:22:50] <Laney> juliank: write only coding
[11:22:54] <Laney> :P
[11:23:29] <elbrus> anyways, this probably means I'll have to remove an
option from autopkgtest (and ci.debian.net / debci needs adaptation as
well if so)
[11:23:32] <elbrus> pain.
[11:23:37] <Laney> it's just a different style to what I'm used to,
doesn't lend itself to being read in my brain
[11:23:43] <Laney> why does it?
[11:23:55] <Laney> don't you replace the default-release with the pin
[11:24:05] <elbrus> it's an option now
[11:24:11] <elbrus> to set the default-release
[11:24:23] <juliank> well, and instead of writing that, write a pin file
for the option?
[11:24:30] <Laney> right
[11:25:16] <elbrus> and ci.d.n uses it
[11:25:25] <elbrus> see e.g. the top of
[11:25:43] <elbrus> hmm, no it doesn't
[11:25:52] <elbrus> nevermind
[11:26:24] <elbrus> juliank: I guess I could do that
[11:26:58] <elbrus> but question, if pinning doesn't need validation,
why does APT::Default-Release?
[11:27:39] <juliank> Because more people used that then people used pins?
[11:27:42] <juliank> I don't know
[11:28:38] <juliank> there is not always a reason for why things are the
way they are
[11:28:54] <elbrus> typically: history
[11:29:20] <juliank> http://bugs.debian.org/407511
[11:29:21] <ubot5> Debian bug 407511 in apt "apt: Wrong value for
APT::Default-Release may cause unwanted " [Wishlist,Fixed]
[11:29:40] <juliank> that was the discussion
[11:32:46] <elbrus> I see
[11:33:17] <elbrus> by the way, I'll copy this discussion to the bug
(unless somebody objects)
[11:33:35] <juliank> fine with me
[11:38:15] <Laney> elbrus: something like
https://paste.debian.net/1015983/ - untested, because I can't run the
chroot tests for some reason
[11:38:21] <Laney> feel free to start with that if you want to change it
[11:38:29] <Laney> np on copying to the bug from me too
[11:38:55] <Laney> + with open(os.path.join(apt_dir,
'preferences.d', 'autopkgtest-fluffy-proposed')) as f: <- wrong filename
-------------- next part --------------