#!/bin/bash # # priority: 1200 # # Update node package repository metadata and sign packages # # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # # $Id: packages,v 1.4 2006/07/19 14:15:15 mlhuang Exp $ # # Source function library and configuration . /etc/plc.d/functions . /etc/planetlab/plc_config # Be verbose set -x case "$1" in start) MESSAGE=$"Signing node packages" dialog "$MESSAGE" shopt -s nullglob for repository in /var/www/html/install-rpms/* ; do # Sign all RPMS. setsid detaches rpm from the terminal, # allowing the (hopefully blank) GPG password to be # entered from stdin instead of /dev/tty. packages= for package in $repository/*.rpm ; do packages="$packages $package" done if [ -n "$packages" ] ; then echo | setsid rpm \ --define "_signature gpg" \ --define "_gpg_path /etc/planetlab" \ --define "_gpg_name $PLC_MAIL_SUPPORT_ADDRESS" \ --resign $packages check fi # Update yum metadata. yum-arch createrepo sometimes leaves behind # .oldheaders and .olddata directories accidentally. rm -rf $repository/{.oldheaders,.olddata} yum-arch $repository check createrepo -g yumgroups.xml $repository check done result "$MESSAGE" ;; esac exit $ERRORS