gen_rpmlists

Usage

gen_rpmlists

Description

This script runs on a webserver machine, generating lists of available rpms for one or more Red Hat distributions, and places them in a web-accessible area. Only the "newest" RPM for a given name/architecture pair in the distribution is included in the list. Such lists are typically downloaded by clients so they can decide what RPMs they can install or need to upgrade.

The format for each list is plain text in the format:

url name version release architecture

For example:

  http://tautology.unh.edu/linux/shrike/RPMS/bison-1.35-6.i386.rpm bison 1.35 6 i386
  

The script makes a number of hardwired assumptions about the directory setup on the webserver. In our case:

/usr/local/misc
Base directory
http://tautology.unh.edu/linux
Corresponding URL for base directory
/usr/local/misc/cislinux
Directory where output lists are placed
/usr/local/misc/distribution*
Directories containing RPMs and possible update RPMs for the specified distribution. (E.g., /usr/local/misc/shrike and /usr/local/misc/shrike_updates.)
/usr/local/misc/cislinux/distribution_rpms
File containing list for distribution

The currently on-line distribution names (e.g., shrike, psyche, and valhalla) are also hardwired into the script; the script is dinked when distributions are added or dropped.

The script traverses the subdirectories (with the Perl File::Find package) looking for *.rpm files. Version and release strings are compared through the traversal, and only the "newest" RPM for a given package name and architecture is "remembered.". When the traversal is complete, the list is dumped out into the corresponding file.


Source

Back to Hacks


Last modified: June 29 2003 21:03 EDT

Paul A. Sand, pas@unh.edu