3 # Turn an 'ls' listing of RPM files into an 'rpm -qa' listing
4 # Reads a list of filenames, possibly preceeded by a directory and
5 # strips the directory path from the beginning and the two suffices
6 # from the end of each filename. For example, the name
7 # "/mnt/cdrom/RedHat/RPMS/kernel-2.4.20-13.7.i686.rpm" gets turned
8 # into a simple "kernel-2.4.20-13.7".
10 # This is most usefull for maintaining a repository of the most recent
11 # packages. Using this script, you can keep a list of packages in the
12 # Gnucomo database. To do this, create a virtual object, for example
13 # with the name "redhat-7.3" and feed the list of RPM names into gcm_input
16 # ls /mnt/cdrom/RedHat/RPMS | ls-rpm | sort | uniq | gcm_input -h redhat-7.3
18 # After that, enter the updated RPMs with the -i flag for gcm_input.
21 # ls /archive/linux/update9.0/*/*.rpm /archive/linux/latest/RH9/*.rpm | ls-rpm \
22 # | sort | uniq | gcm_input -i -h redhat-9.0
31 filename=`basename $filename .rpm`
34 rpm=`basename $filename .athlon`
37 rpm=`basename $filename .i386`
40 rpm=`basename $filename .i486`
43 rpm=`basename $filename .i586`
46 rpm=`basename $filename .i686`
49 rpm=`basename $filename .noarch`