Brock Pytlik wrote:
> As part of my current work on dependency generation, I'm looking at the
> types of files a package delivers and seeing whether we can extract any
> dependencies from those files. Currently, we're looking at pulling in
> dependencies from things like #!/usr/bin/python, elf dependencies, and
> hard link dependencies. We have plans to add something to peer inside a
> jar file, and possibly some programming language specific analysis such
> as looking at the import statements in python.
>
> I was curious whether there was anything else we might need to address,
> so I ran the file command on all the files we deliver in
> resdistributable and collected the results, and an example file for
> each. After looking it through it, I don't see anything obvious we've
> missed, so I thought I'd see if anyone had suggestions or noticed
> something I'd missed.
There's more I know of, but in file types that the Solaris file command
doesn't know about, so has probably listed as plain text. (Some of the
other mappings it made in that list are amusing, such as TCL scripts as
"Palm Pilot Application" - perhaps using GNU file, with it's actually
maintained list of file formats, would give much better results on the
types of files.)
Hard dependencies:
- "shadow" man pages - if a nroff format man page file has ".so foo"
as it's first line, it's effectively a symlink to the foo man page,
though it's relative to the $MANPATH, not a specific location.
For example:
% cd /usr/share/man/man1
% cat bzcat.1
.so man1/bzip2.1
.\" ident "@(#)bzcat.1.sunman 1.2 02/11/21 SMI"
% pfexec mv bzip2.1 bzip2.bak
% man bzcat
Can't find referent of .so in /usr/man/man1/bzcat.1
(My script found at least a couple cross-package .so dependencies in
JDS - we may see more when man pages are moved from SUNW*man to man
page facets in the packages with the software they document.)
- pkg-config files - used by X11, GNOME, and many other open source
packages, in conjuction with GNU autoconf scripts. They are
delivered in /usr/lib/pkgconfig/*pc and /usr/lib/{amd64,sparcv9/pkgconfig
They're a simple "key: value" text format, and dependencies (on other *.pc
files) are listed in the Requires: line.
For instance:
% cd /usr/lib/pkgconfig
% grep Requires xrender.pc
Requires: xproto renderproto >= 0.9 x11
% pkg-config --libs xrender
-R/usr/X11/lib -L/usr/X11/lib -lXrender -lX11
% pfexec mv x11.pc x11.bak
% pkg-config --libs xrender
Package x11 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x11.pc'
to the PKG_CONFIG_PATH environment variable
Package 'x11', required by 'Xrender', not found
Softer dependencies:
- SMF manifests - these have a syntax for listing how hard of a dependency they
have on other SMF services, which IPS would probably translate into a
dependency on the manifest defining that service. Manifests that specify
a restarter (such as inetd services) should probably treat the restarter as
a dependency as well.
- #include statements in C language .h files - determining how "hard" the
dependency is would likely involve checking surrounding #if statements.
For instance, /usr/include/pcap.h clearly has a hard dependency on stdio.h,
but is perfectly usable on Solaris if you ignore the Win32-Extensions.h
#include that's wrapped in #if defined(WIN32).
- SGML/XML catalogs - see for instance /var/lib/sgml/CATALOG.openjade, in which
the third "column" is a file path it depends on.
- XML DTD's, listed in the DOCTYPE tag - not sure if these are worth listing or
not, since many usages don't need them
--
-Alan Coopersmith- [email protected]
Sun Microsystems, Inc. - X Window System Engineering
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss