A usefull tool (Was: Making Fedora Core CD #1 Standalone)

Chris Chabot chabotc at 4-ice.com
Tue May 25 14:06:40 UTC 2004


Dep Tree 0.1 by Chris Chabot.
This program may be freely redistributed under the terms of the GNU GPL.

With all these discussions about making Fedora Core a core cd, ideas 
about what should or should not be included, i thought it might be easy 
to be able to quantify and experiment with package dependencies and 
package sizes so you can find out what can and can not fit on one CD.

This script takes a package or list of packages as command line 
argument, and recursivly walks the full dependency tree for that/those 
package(s) and calculates the packages size (size of the RPM's) and 
installed size (size on disk) for the packages.

It queries the rpm database using the rpm command line tool, so please 
only use the base package name (mozilla) and not the file name 
(mozilla-1.6-6.i386.rpm). Also note that since this tool only queries 
the rpm database, and doesn't write or change anything, so safe to play 
around with.

For example
  # ./dep-tree.php mozilla
    <.. shows the complete tree of all  the dep. packages & package sizes..>
  Number of packages: 66
  Total size installed: 165 Mb
  Total packaged size:  59 Mb

With this tool it's a lot easier to experiment with 'what if', and try 
out what the real impact is of including package XYZ in the core CD.

It can also take multiple packages on the command line, and will do a 
full dependency tree run for all those packages, so you could see how 
many packages, and what packaged size something like the packages 
"firstboot system-config-packages mozilla" would take up..

This script requires PHP and RPM to be installed to run. Save the 
attached dep-tree.php to disk and run by
  # chmod +x dep-tree.php
  # ./dep-tree.php
or
  # php -Cq ./dep-tree.php


Usage explained in detail: dep-tree.php [-d] [-r=path] package [package 
package]

package [package..]     List of packages to include in the dependency 
tree run, for example: "mozilla openoffice.org sendmail"

-d             Include the *-devel packages for all packages in the list 
(and it's dependencies). This is includes because i am a big fan of 
having a system that could build it's self, it's updates and any other 
source rpm's/tarbals you would download.

-r=/path   (For users who know what they are doing only!) Use 
--root=/path in all rpm commands. The rpm --root command allows you to 
query against a rpm database other then the standard location. This is 
usefull for if you want to play with all installed packages or packages 
you don't have installed in your normal setup without having to modify 
your existing setup by doing something like this (Note: Please please by 
all that is holy, don't forget to include --root=/fc2-tests in your rpm 
--initdb command, else you will NUKE, DELETE and DESTROY your rpm database!)
  # mkdir /fc2-test
  # rpm --initdb --root=/fc2-test
  # rpm -Uvh --root=/fc2-test --nomd5 --nodigest --nosignature --justdb 
/location/to/all/fc2/rpms/*.rpm


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dep-tree.php
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20040525/65794dbe/attachment.ksh>


More information about the fedora-devel-list mailing list