Since it had been a few weeks since I did anything completely and utterly
insane, I took a few days this week to work on a number of updates to my
infamous check-deps.pl script for checking package dependencies, including:
- Adding support for checking dependencies in an IPS image, either the
current system root or a specified mount point
- Adding checks for several additional types of dependencies:
- kernel module ELF dependencies (see recent post on
opensolaris-code)
- .so "shadow" man pages
- "Requires:" entries in pkg-config .pc files
- requires & uses lines in perl scripts
- imports lines in python scripts
- requires lines in ruby scripts
- shell script lines starting with ".", source, /*/bin, or /*/sbin
(Yes, those would be clear signs of insanity, as would overuse of
parenthetical asides talking to yourself in e-mails to lists...)
- Silencing the 7za output that filled the logs when checking a SVR4
WOS image with compressed packages.
- Lots of style cleanups, hopefully some efficiency improvements,
though probably not enough to offset the cost of the new checks.
Of course, it still suffers from being written in perl, since while I've
got a copy of Learning Python, I still haven't opened it, hoping that IPS
dependency detection would make this script obsolete before I have time to
learn Python so this could be written as an IPS API user instead of forking
/usr/bin/pkg and parsing the output.
The scripting dependency detection bits are most especially somewhere between
utterly hacky and totally experimental - they can't find many of the files they
think they should depend on, so since I assume those are missing due to either
my incomplete understanding of the languages or the inability to parse many ways
of adding to the module search paths, I don't report missing files for those
unless you specifically ask with -r ScriptModNotInPkg. They also rely on the
hack of assuming that running that command in the current environment produces
a reasonably accurate search path list for the target environment, which doesn't
work cross-architecture or across too wide of a build gap. I'll probably be
tuning them some more before declaring this version ready for others to run
regularly (I know previous versions are used by several QA & RE groups, and are
recommended to people adding new freeware packages to consolidations like
JDS & SFW). Even more than the previous output, the dependencies these find
need human review to determine which are truly required vs. optional, since
I haven't tried any following of script logic to determine if these calls are
only made in some cases or not.
With all that, they still do turn up some interesting dependencies that may
deserve manual additions to the SVR4 & IPS dependency files, or at least careful
thought - some examples:
*** /usr/bin/avahi-discover (SUNWavahi-bridge-dsd) requires
/usr/lib/python2.4/vendor-packages/dbus/glib.pyc which is found in
SUNWdbus-bindings, but that is not listed as a package dependency.
*** /usr/bin/awn-manager (SUNWavant) requires
/usr/lib/python2.4/vendor-packages/pygtk.pyc which is found in
SUNWgnome-python-libs, but that is not listed as a package dependency.
*** /usr/bin/awn-schema-to-gconf (SUNWavant) requires
/usr/lib/python2.4/vendor-packages/lxml/etree.pyc which is found in
SUNWpython-lxml, but that is not listed as a package dependency.
*** /sbin/beadm (SUNWbeadm) requires /usr/bin/i86/isapython2.4 which is
found in SUNWPython, but that is not listed as a package dependency.
*** /usr/bin/vgrind (SUNWdoc) requires /usr/bin/printf which is found in
SUNWloc, but that is not listed as a package dependency.
*** /usr/bin/xml2po (SUNWgnome-doc-utils) requires
/usr/lib/python2.4/vendor-packages/libxml2.py which is found in
SUNWlxml, but that is not listed as a package dependency.
*** /usr/share/setup-tool-backends/scripts/users-conf
(SUNWgnome-system-tools) requires
/usr/perl5/vendor_perl/5.8.4/i86pc-solaris-64int/Authen/PAM.pm which
is found in SUNWperl-authen-pam, but that is not listed as a package
dependency.
*** /usr/lib/icon-name-mapping (SUNWgnome-themes) requires
/usr/perl5/vendor_perl/5.8.4/XML/Simple.pm which is found in
SUNWperl-xml-parser, but that is not listed as a package dependency.
*** /usr/lib/brand/ipkg/attach (SUNWipkg-brand) requires /usr/sbin/zfs
which is found in SUNWzfs, but that is not listed as a package
dependency.
*** /usr/lib/brand/ipkg/clone (SUNWipkg-brand) requires
/usr/sbin/sys-unconfig which is found in SUNWadmap, but that is not
listed as a package dependency.
*** /usr/bin/packagemanager (SUNWipkg-gui) requires
/usr/lib/python2.4/vendor-packages/pygtk.pyc which is found in
SUNWgnome-python-libs, but that is not listed as a package dependency.
*** /usr/bin/packagemanager (SUNWipkg-gui) requires
/usr/lib/python2.4/vendor-packages/pkg/client/api.pyc which is found
in SUNWipkg, but that is not listed as a package dependency.
*** /usr/share/man/man3/libedata-book-1.2.3 (SUNWevolution-data-server)
requires /usr/share/man/man3/libebook-1.2.3 which is found in
SUNWevolution, but that is not listed as a package dependency.
*** /usr/lib/amd64/pkgconfig/xorg-server.pc (SUNWxorg-headers) requires
/usr/lib/amd64/pkgconfig/pixman-1.pc which is found in SUNWpixman, but
that is not listed as a package dependency.
A lot of the output really reinforces the fact that our package boundaries are
just broken, and may provide more useful input for refactoring than for fixing
dependencies in the current breakdown. The root/usr split in the SVR4 packages
with many SMF scripts in the root packages depending on usr bits especially
makes accurate dependency listing a challenge, as does commands in core packages
like SUNWcsu being written in scripting languages like perl & python that
SUNWcsu doesn't depend on.
I've posted a webrev showing the changes to the script and the changes to the
output of the script run across a nv_110 x86 SVR4 WOS install image:
http://cr.opensolaris.org/~alanc/check-deps-2009-03-20/
Also included is the output of running it against an unbooted OpenSolaris b109
image. You can download the script from the "raw" link in the webrev if you
want to try it yourself or send in fixes/improvements:
http://cr.opensolaris.org/~alanc/check-deps-2009-03-20/raw_files/new/check-deps.pl
To run it on an OpenSolaris system, checking the currently booted image:
pfexec check-deps.pl -I >& output
To run it on an OpenSolaris system, checking another image:
pfexec bootadm mount other-image /mnt
pfexec check-deps.pl -I -d /mnt >& output
(You can run without pfexec if you want, just won't be able to open all the
installed files to read their dependencies out. It really only needs
privileges to read all the files being checked.)
To run on a Nevada WOS install image:
cd /net/netinstall/export/nv/x/latest/Solaris_11/Product
check-deps.pl >& /tmp/output
Other options are described in the documentation shown by perldoc check-deps.pl,
but most are unchanged from previous versions.
--
-Alan Coopersmith- [email protected]
Sun Microsystems, Inc. - Sanity-Challenged Engineering
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss