--- builds_bin/release_rpms 2005/10/10 05:06:06 1.2 +++ builds_bin/release_rpms 2006/12/02 17:19:10 1.7 @@ -1,6 +1,28 @@ #!/bin/sh -for file in *.rpm +UNSIGNED=$(rpm -K $@ | grep 'md5 OK' | sed -e 's/:.*//') + +if [ -n "$UNSIGNED" ] +then + if [ -x $HOME/bin/signrpm ] + then + for rpm in $UNSIGNED + do + $HOME/bin/signrpm $rpm > /dev/null + done + else + echo "The following RPMs are not signed:" + echo $UNSIGNED + echo "Please sign them now" + + rpm --addsign $UNSIGNED + fi + + UNSIGNED=$(rpm -K $@ | grep 'md5 OK' | sed -e 's/:.*//') + [ -n "$UNSIGNED" ] && exit 1 +fi + +for file in $@ do arch=$(basename $file .rpm | sed -e 's/.*\.//') @@ -10,15 +32,12 @@ do *) TARGET=/builds/rpms/RPMS/$arch ;; esac - if [ -f $TARGET/$file ] + if [ -f $TARGET/$(basename $file) ] then - echo "$TARGET/$file exists" + echo "$TARGET/$(basename $file) exists" continue else [ -d $TARGET ] && mkdir -p $TARGET - - # XXX - FIXME - Force signing of RPMs before release - rpm -K $file - cp $file $TARGET/$file + cp --preserve=timestamps $file $TARGET/$(basename $file) fi done