From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sun, 1 Nov 2009 19:06:46 +0300 From: "Dmitry V. Levin" To: ALT Devel discussion list Message-ID: <20091101160646.GB7543@wo.int.altlinux.org> Mail-Followup-To: ALT Devel discussion list References: <679044850910090127m7acdfb5di78f7ca5abca06f@mail.gmail.com> <200910091826.51391.asy@altlinux.ru> <20091009132858.GD2700@altlinux.org> <200910091840.28165.asy@altlinux.ru> <20091009134451.GE2700@altlinux.org> <20091009135600.GB10137@wo.int.altlinux.org> <20091009144600.GA11110@altlinux.org> <20091101021442.GA15972@wo.int.altlinux.org> <20091101031550.GC11219@altlinux.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uQr8t48UFsdbeI+V" Content-Disposition: inline In-Reply-To: <20091101031550.GC11219@altlinux.org> X-fingerprint: FE4C 93AB E19A 2E4C CB5D 3E4E 7CAB E6AC 9E35 361E Subject: Re: [devel] sisyphus_check: /sbin/install-info, /sbin/ldconfig X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Nov 2009 16:06:46 -0000 Archived-At: List-Archive: List-Post: --uQr8t48UFsdbeI+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 01, 2009 at 06:15:50AM +0300, Alexey Tourbin wrote: > On Sun, Nov 01, 2009 at 05:14:42AM +0300, Dmitry V. Levin wrote: [...] > > I've just pushed sisyphus_check 0.8.14-alt1-4-gc78c3ee that implements > > this check. Please have a look. >=20 > -rpm_requires=3D[%{requirename:shescape}" %{requireflags:depflags} "%{req= uireversion:shescape}" > +rpm_requires=3D[%{requirename:shescape}" %{requireflags} %{requireflags:= depflags} "%{requireversion:shescape}" >=20 > %{requireflags:octal} may (or may not) be more convenient here, > possibly depending on whether awk can handle octals just as easy > as decimals. I doubt that octals here may appear more convenient. GNU awk definitely handles decimal numbers, and nothing else is going to handle this field yet. > +bad_prereqs=3D'/sbin/install-info > +/sbin/ldconfig' >=20 > + # 2^6: RPMSENSE_PREREQ > + # 2^14: RPMSENSE_FIND_REQUIRES > + bad=3D$(printf %s "$rpm_requires" | > + awk '$2>=3D64 && $2!=3D16384 {print $1}' | > + egrep -x "$bad_prereqs" | > + sort -u) >=20 > Since %{requireflags} is a bitmap, numeric comparison looks puzzling. It is result of optimization, so it may look puzzling and even a bit confusing. The idea behind this optimization is simple: any high value flag except RPMSENSE_FIND_REQUIRES means that the requirement has a PREREQ sense. > What are exactly the rules we'd like to follow? Basically, what we want > to do is to forbid the use of /sbin/install-info in %post-like scripts. > For such a script, the dependency on /sbin/install-info is generated > automatically. But usually it is also accompanied with manual PreReq > dependency on %__install_info. We should cover both cases -- for > example, one can forget to remove the accompanying PreReq dependency > while removing the scripts. >=20 > Now to the requireflags. Older rpmbuild implementation (the one we use) > always sets PREREQ bit along with e.g. SCRIPT_POST (please check if this > is actually true). Thus, to handle both cases (automatic scriptlet > dependencies and manual prereqs) it would suffice to perform the test > as simple as > =20 > bad =3D (requireflags & PREREQ); >=20 > Newer rpmbuild implementation does not set PREREQ bit along with > scriptlet bits, so the test should be extended to the scriptlet bits: >=20 > bad =3D (requireflags & (PREREQ | SCRIPT_POST | SCRIPT_...)); Prerequisites are not limited to RPMSENSE_PREREQ and RPMSENSE_SCRIPT_* bits. There are also RPMSENSE_INTERP and RPMSENSE_TRIGGER* which should be treated the same way as other PREREQs. As result, an appropriate awk expression grows like this: awk 'and($2,2^6+2^8+2^9+2^10+2^11+2^12+2^13+2^16+2^17+2^18)>0 {print $1}' Of course it could be pre-calculated to awk 'and($2,474944)>0 {print $1}' Does it look clearer than awk '$2>=3D64 && $2!=3D16384 {print $1}' ? > Another idea looming around is to prohibit manual dependencies > on /sbin/install-info altogether. I'm not quite sure if it is a good > idea, since it goes far beyond scriptlets and prereqs. After all, > you name it "bad_prereqs", so it must be a prereq. I was uncertain about this, so I made a check for /sbin/install-info and /sbin/ldconfig requirements in Sisyphus. I found only one manual non-PREREQ requirement for /sbin/ldconfig (in libreadline-java-0.8.0-alt2_12jpp5) and no manual non-PREREQ requirements for /sbin/install-info. So I decided to leave the check as is. Maybe I should reconsider this. > Also consider adding 'info-install' to bad_prereqs (since they might > use bare 'install-info' command, not /sbin/install-info). You mean the info-install package? Yes, that makes sense. --=20 ldv --uQr8t48UFsdbeI+V Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkrtshUACgkQfKvmrJ41Nh5jjACgr2odI9YWPnX1NG4M58xQXEWf NOwAniR2eU4pFC6y8R/rI6p7CVOC2azn =ujk6 -----END PGP SIGNATURE----- --uQr8t48UFsdbeI+V--