Gentoo Archives: gentoo-catalyst

From: "Rick \\\"Zero_Chaos\\\" Farina" <zerochaos@g.o>
To: gentoo-catalyst@l.g.o
Subject: Re: [gentoo-catalyst] [PATCH 1/2] Fix update_seed use by not using nor building binary packages during the seed update.
Date: Tue, 28 May 2013 16:51:58
Message-Id: 51A4E0C3.3040104@gentoo.org
In Reply to: Re: [gentoo-catalyst] [PATCH 1/2] Fix update_seed use by not using nor building binary packages during the seed update. by Brian Dolbec
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 On 05/28/2013 12:42 PM, Brian Dolbec wrote:
5 > On Tue, 2013-05-28 at 00:34 -0400, Rick "Zero_Chaos" Farina wrote:
6 >> It has come to light that this patch breaks binpkg use in stage1.
7 > ...
8 >> Thanks,
9 >> Zero
10 >>
11 >> On 03/26/2013 11:09 PM, Jorge Manuel B. S. Vicetto (jmbsvicetto) wrote:
12 >>> From: "Jorge Manuel B. S. Vicetto (jmbsvicetto)" <jmbsvicetto@g.o>
13 >>>
14 >>> + elif [ -n "${clst_PKGCACHE}" -a -z "${clst_update_seed}" ]
15 >
16 > As it turns out, this one change was incorrect to evaluate all possible
17 > scenarios. My bash skills are poor, I originally had used nested if's ,
18 > but that got optimized by others to the above line.
19 >
20 > That line should be changed to:
21 >
22 > elif [ -n "${clst_PKGCACHE}" ] && ( [ -z "${clst_update_seed}" ] || [ "${clst_update_seed}" == "no" ]
23 >
24 > Which breaks down to (for those that can't follow it's logic):
25 >
26 > # NOTE: clst_update_seed is currently only used for a stage1, so does not exist in the environment for other targets.
27 > # spacing was added to the line so it lines up with the plain English text.
28 >
29 > # if clst_PKGCACHE is not null and either clst_update_seed doesn't exist or clst_update_seed is exactly equal to "no"
30 > #if [ -n "${clst_PKGCACHE}" ] && ( [ -z "${clst_update_seed}" ] || [ "${clst_update_seed}" == "no" ] )
31 >
32 >
33 > I have 3 reasons for wanting this change done this way
34 >
35 > 1. If a spec or config enables the PKGCACHE option. It will add
36 > all the binpkg options to the emerge command. Due to the
37 > possible problem with using/creating binpkgs during the
38 > update_seed process. These options should not be set. Currently
39 Can you please describe how using binpkgs during update_seed is an
40 issue? I don't think all of us fully understand that, I know I don't.
41 > they are being set, but only --binpkg was being reset to =n in
42 > the stage1-chroot.sh update_seed command. The other binpkg
43 > options were not being removed or reset. This is poor coding.
44 > It is far better to just not add the unwanted options in the
45 > first place.
46 > 2. While it is possible to work around not having the logic in
47 > setup_myemergeoptions(), it is hacky and complicates the
48 > stage1-chroot code more than neccessary. It is also poor
49 > programming style. In total it would mean the
50 > setup_myemergeoptions() would be called three times in total for
51 > the stage1 run. Or temporarily saving the emerge options,
52 > unsetting clst_PKGCACHE, re-running setup_myemergeoptions() to
53 > get the correct options for update_seed, then later restoring
54 > the the two variables correctly. Both these coding options are
55 > poor programming style and more prone to bugs. With the
56 > proposed change above it would be run twice. Once keeping the
57 > PKGCACHE options off for the update_seed run, then reset
58 > according to the spec for the target emerge run.
59 > 3. Placing the clst_update_seed logic to toggle the PKGCACHE
60 > options in the setup_myemergeoptions() simplifies the stage1
61 > code. Plus it leaves the option to run an update_seed
62 > option/command for any future or current target without
63 > complicating/duplicating code.
64 >
65 > I have attached a small test program I used to come up with the
66 > correctly working patch change above. It can be used to evaluate how
67 > the line's logic is processed. I have also attached the terminal output
68 > it produced for all the possible conditions that could occur.
69 >
70 > Also I have slightly different PKGCACHE options in my rewrite branch. I
71 > have added --binpkg-respect-use to them. It was brought to my attention
72 > early in testing to put them in a config to eliminate the problem of
73 > using binpkgs that were not compiled with them set correctly.
74 We should probably make this default, if everyone agrees I can drum up a
75 quick patch and add it. This is already default in my profile to
76 infinite success.
77
78 thanks,
79 Zero
80 >
81 > I will be pushing an updated rewrite branch with this and the other
82 > changes made to master soon. So "git pull --force" to update your
83 > checkout with the rewritten commits when I do.
84 >
85
86 -----BEGIN PGP SIGNATURE-----
87 Version: GnuPG v2.0.19 (GNU/Linux)
88 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
89
90 iQIcBAEBAgAGBQJRpODDAAoJEKXdFCfdEflK51IP/0xZohUutpNMW+lpPKbkb7Kc
91 /peVQGs1wgnHZcvHbEnJb9F04oK4IIdal7eOpOi/cNagD/37RojNvvfHexe7zFXP
92 rhIoE/o++5Ma/iHjgHVY3EUk4mqdDKQMP9vht0g7TiAeNhjKa5bTAYeaq8vTBzCZ
93 /X9PFlLyPirs6MEszz/dWP0xkFVXSD9QCr4jF4g2brQIXjav0+P7jVFgITME/atS
94 H26F9tglDQeSZyM2mtTsbuzsPkHjau7Qkso7ITlyHNozore6M19hOLVLEXm9kfgq
95 8VDFq7rt8S3IsdkD85Xy8eIAw++wpFqMUiXubX1zCfa8qYPwf19yWWq4thQOt288
96 IRRtE/QGMaMi/V/rtoxnmQZEOHu8U5t5Uuw31DTNNmdVe1uRhs8WXdtbp/0ufFaG
97 BOGjv2yRkvgKx4d6TZcpn1T/LPJS/bFBEZYpPEyHV1G8leYOJi8CyasYZBSF7v7A
98 7U4GgfQul85+uogYTgNZ4I6d5aRfc5/FMH7/zycyIeKbNlso5iBow0s+XIKhhc4l
99 UYEyFirBNG55ZNIE18OxjQOCD2R9FjujwpJc1cuB20Hx93IRVifNIbcDZ6LaR5yq
100 fSLR/nzJJj2L3kv7Uq88akQClpVQMRruXQhNI7mTfhCjWmQtyHVbyeS8kOyJultV
101 yE4dIpKzkJ7OEuL4Dg0u
102 =ogZD
103 -----END PGP SIGNATURE-----

Replies