[devel] sisyphus_check: /sbin/install-info, /sbin/ldconfig

Alexey Tourbin at at altlinux.ru
Sun Nov 1 03:15:50 UTC 2009


On Sun, Nov 01, 2009 at 05:14:42AM +0300, Dmitry V. Levin wrote:
> > Как ты собираешься это сделать?  Желательно у зависимости проверять
> > флаги %{REQUIREFLAGS} на предмет %post-скриптов.  Потому что по крайней
> > мере зависимость на /sbin/install-info может быть не связана с
> > установкой info-страниц в %post-скрипте пакета.
>
> I've just pushed sisyphus_check 0.8.14-alt1-4-gc78c3ee that implements
> this check.  Please have a look.

-rpm_requires=[%{requirename:shescape}" %{requireflags:depflags} "%{requireversion:shescape}"
+rpm_requires=[%{requirename:shescape}" %{requireflags} %{requireflags:depflags} "%{requireversion:shescape}"

%{requireflags:octal} may (or may not) be more convenient here,
possibly depending on whether awk can handle octals just as easy
as decimals.

+bad_prereqs='/sbin/install-info
+/sbin/ldconfig'

+       # 2^6: RPMSENSE_PREREQ
+       # 2^14: RPMSENSE_FIND_REQUIRES
+       bad=$(printf %s "$rpm_requires" |
+               awk '$2>=64 && $2!=16384 {print $1}' |
+               egrep -x "$bad_prereqs" |
+               sort -u)

Since %{requireflags} is a bitmap, numeric comparison looks puzzling.
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.

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
    
	bad = (requireflags & PREREQ);

Newer rpmbuild implementation does not set PREREQ bit along with
scriptlet bits, so the test should be extended to the scriptlet bits:

	bad = (requireflags & (PREREQ | SCRIPT_POST | SCRIPT_...));

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.

Also consider adding 'info-install' to bad_prereqs (since they might
use bare 'install-info' command, not /sbin/install-info).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.altlinux.org/pipermail/devel/attachments/20091101/6e2d6ce3/attachment.bin>


More information about the Devel mailing list