From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 2 Nov 2009 07:39:20 +0300 From: Alexey Tourbin To: ALT Devel discussion list Message-ID: <20091102043920.GI11219@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> <20091101160646.GB7543@wo.int.altlinux.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Op27XXJsWz80g3oF" Content-Disposition: inline In-Reply-To: <20091101160646.GB7543@wo.int.altlinux.org> 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: Mon, 02 Nov 2009 04:39:21 -0000 Archived-At: List-Archive: List-Post: --Op27XXJsWz80g3oF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 01, 2009 at 07:06:46PM +0300, Dmitry V. Levin wrote: > 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} "%{r= equireversion:shescape}" > > +rpm_requires=3D[%{requirename:shescape}" %{requireflags} %{requireflag= s: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. >=20 > 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. Octals group bits (per three), and decimals do not. Whenever you're in a dire circumstances, octals might pay off a little bit. So watch. Smartass between dumbass is in the eye of the beholder. :) > > +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. >=20 > 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 f= lag > except RPMSENSE_FIND_REQUIRES means that the requirement has a PREREQ sen= se. Please do not optimise here. It's a bitmap. You need test a bit you test a bit. Got that dude? > > 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_...)); >=20 > 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}' >=20 > Of course it could be pre-calculated to > awk 'and($2,474944)>0 {print $1}' >=20 > Does it look clearer than > awk '$2>=3D64 && $2!=3D16384 {print $1}' > ? >=20 > > 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. >=20 > 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. >=20 > > Also consider adding 'info-install' to bad_prereqs (since they might > > use bare 'install-info' command, not /sbin/install-info). >=20 > You mean the info-install package? Yes, that makes sense. --Op27XXJsWz80g3oF Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkruYngACgkQfBKgtDjnu0bHZQCfZLerr7Z6mIkMoTwNjyJ2/mEw ql0AnAq1OaihmVsmmq+8kdO8g2IV8uQn =K+w4 -----END PGP SIGNATURE----- --Op27XXJsWz80g3oF--