1 AUTHOR: "Chuck Rhode" <crhode@excel.net>
7 SYNOPSIS: BLFS Package Dependencies.
10 Extract a database of software packages from the BLFS book and order
11 them in prerequisite installation sequence.
19 * patch for xml.sax.handler (included)
23 Beyond Linux from Scratch 5.0 contains a list of a couple hundred
24 software packages with installation instructions and code examples.
26 Packages are cited in prerequisite order. Prerequisites are those
27 packages that a given package depends on. When installing a given
28 package, the User must be sure all of its prerequisites have already
29 been installed. However, not all the preceding packages are necessarily
30 prerequisite to the given one. The given package may be optional and in
31 turn may depend on other optional packages. The User is expected to skip
32 optional packages that he does not need. Prerequisites in turn may have
33 their own prerequisites. Determining which packages are in the
34 dependency cascade leading to the given package is non-trivial.
36 There are many code examples in BLFS. I have written some scripts to
37 extract the code examples from the BLFS text and build a database of
38 packages and prerequisites. A User may submit a package name and receive
39 a script for installing not only the given package but also its
40 prerequisites in prerequisite order.
43 PrerequisitePackages.py
45 PrerequisitePackages.py sorts and lists the dependency tree for a given
46 package (or list of packages). For example:
48 echo linc > wishlist.txt
49 ./PrerequisitePackages.py -W wishlist.txt
51 ... would print the following report:
53 # Install packages in this order:
54 pkgconfig (pkgconfig-0.15.0)
56 openssl (OpenSSL-0.9.7c)
60 All of the parameters are optional:
62 ./PrerequisitePackages.py -P pkgs.dat -W wishlist.txt -O wishlist.txt
64 ... would expand the wishlist to include all prerequisites.
66 * If omitted, -P defaults to pkgs.dat, the packages database. A
67 version of pkgs.dat corresponding to BLFS 5.0 is included in the
68 tarball for this hint.
69 * If omitted, -W defaults to standard input.
70 * If omitted, -O defaults to standard output.
72 More than one package may be named in wishlist.txt, separated by spaces
73 or newlines. The package names are the ones in alllist.txt. To see if a
74 package is in alllist.txt:
76 grep -i linc alllist.txt
78 A version of alllist.txt corresponding to BLFS 5.0 is included in the
79 tarball for this hint.
84 DownloadPackages.py generates a wget script for downloading the
85 requisite packages. For example:
87 ./DownloadPackages.py -W wishlist.txt -O /usr/src/download.sh
89 ... would place the script in the source library where it could be
96 Here is what the script looks like:
98 wget ftp://ftp.netbuddy.org/linux/pkgconfig-0.15.0.tar.gz
99 wget ftp://ftp.gtk.org/pub/gtk/v2.2/glib-2.2.3.tar.bz2
100 wget ftp://ftp.openssl.org/source/openssl-0.9.7c.tar.gz
101 wget ftp://ftp.openssl.org/source/openssl-0.9.7c.tar.gz
102 wget ftp://ftp.gnome.org/pub/GNOME/sources/linc/1.0/linc-1.0.3.tar.bz2
104 All of the parameters are optional:
106 ./DownloadPackages.py -P pkgs.dat -W wishlist.txt -O download.sh
108 * If omitted, -P defaults to pkgs.dat, the packages database.
109 * If omitted, -W defaults to standard input. It should be the
110 expanded wishlist output by PrerequisitePackages.py.
111 * If omitted, -O defaults to standard output. It is a shell script.
116 InstallPackages.py generates a script for installing the requisite
117 packages. For example:
119 ./InstallPackages.py -W wishlist.txt -O /usr/src/install.sh
121 ... would place the script in the source library where it could be
128 The script must be edited first, though. It contains install and
129 configuration code fragments from BLFS. Where alternates are given, all
130 options have been exhaustively expressed, and you must elide those not
131 relevant to your installation. As nice as it is not to have to copy
132 these code fragments from the book, it is not a substitute for reading
133 and understanding the sections where they are described.
135 All of the parameters are optional:
137 ./InstallPackages.py -P pkgs.dat -W wishlist.txt -O install.sh \
140 * If omitted, -P defaults to pkgs.dat, the packages database.
141 * If omitted, -W defaults to standard input. It should be the
142 expanded wishlist output by PrerequisitePackages.py.
143 * If omitted, -O defaults to standard output. It is a shell script.
144 * If omitted, -S defaults to /usr/src, the source library.
146 Once the packages are successfully installed, add their names to the end
147 of donelist.txt, a permanent file.
149 sed "s/ .*\$//" wishlist.txt | sed "s/\$/ /" | sed s/^/\^/ \
151 grep -f patterns.txt alllist.txt >> donelist.txt
153 ... where wishlist.txt contains the list of packages just recently
156 alllist.txt contains the list of all the packages in BLFS.
157 alllist.txt is included in the tarball for this hint.
162 The next time after you run PrerequisitePackages.py, you need to remove
163 the names of the packages in donelist.txt from the output wishlist.txt
164 to avoid reinstalling them. This may be accomplished with
165 MaskDonePackages.py. For example:
167 ./MaskDonePackages.py -W wishlist.txt -D donelist.txt -O wishlist.txt
169 ... would restrict the wishlist to exclude already installed packages.
171 All of the parameters are optional:
173 * If omitted, -W defaults to standard input. It should be the
174 expanded wishlist output by PrerequisitePackages.py.
175 * If omitted, -D defaults to donelist.txt.
176 * If omitted, -O defaults to standard output.
178 MaskDonePackages.py does not update donelist.txt.
183 UninstallPackages.py generates a script for uninstalling the requisite
186 All of the parameters are optional:
188 ./UninstallPackages.py -P pkgs.dat -W wishlist.txt -O uninstall.sh \
191 * If omitted, -P defaults to pkgs.dat, the packages database.
192 * If omitted, -W defaults to standard input. It should be the list
193 of packages to uninstall.
194 * If omitted, -O defaults to standard output. It is a shell script.
195 * If omitted, -S defaults to /usr/src, the source library.
200 PackageDB.py defines objects used by the other scripts.
205 HarvestPackages.py extracts a new packages database from the BLFS xml
208 The tarball for this hint includes pkgs.dat and alllist.txt, which are
209 derived from BLFS 5.0 with this script and the next two. Unless you
210 plan to install from a newer version of BLFS, you should not need to
211 run these scripts. The swindle is that they are not guaranteed to work
212 with any level of BLFS other than 5.0.
214 ./HarvestPackages.py -I index.xml -P pkgs.dat
216 * If omitted, -I defaults to ~/BLFS/BOOK/index.xml.
217 * If omitted, -P defaults to standard output. It is the new output
223 AuditPackages.py identifies any inconsistencies in the database
224 generated automatically by HarvestPackages.py.
226 All parameters are optional:
228 ./AuditPackages.py -P pkgs.dat -O rept.txt -A -C -U -S -L \
231 * If omitted, -P defaults to pkgs.dat, the packages database.
232 * If omitted, -O defaults to standard output. It is a report.
233 * -A reports packages that have no tarball.
234 * -C reports packages that have no install code fragments.
235 * -U reports packages that depend on unknown packages.
236 * -S reports packages that are not in a dependency cascade leading
237 to any other package.
238 * -L lists the names of all packages.
239 * -I reports packages that immediately depend on PkgName.
240 * -F updates pkgs.dat (in place) with information that could not be
241 extracted automatically from BLFS 5.0.
246 ReportPackages.py writes a full report of the packages database.
248 ./ReportPackages.py -P pkgs.dat -O rept.txt
250 * If omitted, -P defaults to pkgs.dat, the packages database.
251 * If omitted, -O defaults to standard output. It is a report.
254 xml.sax.expatreader.patch
256 The xml.sax.expatreader.patch for PyXML 0.8.3 or Python 2.3.3 is
257 required by HarvestPackages.py and is included in the tarball for this
258 hint. Please do not apply this patch unless you plan to run
259 HarvestPackages.py. Most people shouldn't need to. To apply the patch,
260 see xml.sax.expatreader.patch.README.
263 * "Joern Abatz" <joern@abatz.de> for depsort hint for BLFS 1.0 2003-09-23