Name Last modified Size Description
Parent Directory -
centos-errata.cfg 28-May-2010 16:48 1.2K
centos-errata.py.txt 28-May-2010 16:48 41K
test-archive.txt 13-May-2010 12:09 110K
test-digest.txt 13-May-2010 12:09 18K
ObDisclaimer: This script is somewhat rough around the edges and may well eat your cat. Use at own risk!
This tool will take a collection of postings from the centos-announce mailing list. It can accept a digest or a decompressed pipermail archive downloaded from the list archive pages, convert them to basic errata, upload them to a spacewalk server and publish them to a named channel which contains the relevant update packages.
Options can be specified in a configuration file or on the command line. The basic config file looks like this:
[centos errata] #Required to identify applicable messages on the centos-announce mailing list version=5 #Useful for interpolation below, not used by tool itself release=4 #If true the script will attempt to use the Redhat Network to populate the errata description scrape_rhn=False [spacewalk] server=spacewalk.bioss.sari.ac.uk login=dnutter #The tool will prompt you if you don't specify a password #password=reallysecret #Per-architecture configurations. Errata will be published for all architectures listed in sections below. #See the script for list of valid arches. #[i386] #All files for packages mentioned in the centos-announce postings #should reside in this directory. reposyncing the "updates" repo of #your fave centos release should do the trick. #package_dir=/usr/ghost/RH_install/CentOS/%(version)s.%(release)s/updates/i386/RPMS/ #Errata will be published to this channel so you should push the #packages in the directory above to this channel BEFORE you run #centos-errata.py. #channel=centos-i386-updates-%(version)s.%(release)s [x86_64] package_dir=/usr/ghost/RH_install/CentOS/%(version)s.%(release)s/updates/x86_64/RPMS/ channel=centos-x86_64-updates-%(version)s.%(release)s
The tool has command line help showing the options you can set. For the config file above, asking for help would yield the following output:
usage: centos-errata.py [options] [filename]
options:
--version show program's version number and exit
-h, --help show this help message and exit
-s SERVER, --server=SERVER
RHN Satellite server hostname
-l LOGIN, --login=LOGIN
RHN Login
--password=PASSWD RHN password (cleartext)
--max-errata=MAX_ERRATA
Maximum number of errata to process at once. Only relevant to format 'mail-archive.com'
-c CONFIG_FILE, --config=CONFIG_FILE
Read the specified config file instead of the default centos-errata.cfg
-f FORMAT, --format=FORMAT
Select input format for tool. Default is digest. Valid options are digest, archive, mail-archive.com
--scrape-rhn Connect to the RedHat Network site and attempt to download errata information
--show-config Do not connect to the RHN server, just print configuration information
-t, --test Do not connect to the RHN server, just process the input file and print errata information. Will also print
configuration information
--centos-version=CENTOS_VERSION
The centos version (e.g. '5' for Centos 5.3)
--x86_64-channel=X86_64_CHANNEL
The updates channel for arch x86_64
--x86_64-packagedir=X86_64_PACKAGEDIR
The package directory for arch x86_64
Simple example usage (assuming customization of config file and use of a digest posting):
./centos-errata.py /tmp/centos-digest-message.txt
More complicated usage:
./centos-errata.py --i386-channel my-i386-updates \
--server spacewalk.example.com \
--i386-packagedir /centos-mirror/5.3/updates/x86_64/RPMS \
/tmp/centos-announce-digest.txt
Test mode usage, using archive format:
./centos-errata.py -f archive --test /tmp/2009-May.txt
This script is based on rhn-tool by Lars Jonsson. The script and support material is licenced under the terms of the LGPL.
Raal Goff produced an amended version of the script that introduced multiple architecture support, spacewalk server searches and website scraping. This script essentially incorporates his changes and tidies up argument parsing. Thanks Raal!