/[adm]/puppet/modules/buildsystem/templates/signbot/sign-check-package
ViewVC logotype

Contents of /puppet/modules/buildsystem/templates/signbot/sign-check-package

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2740 - (show annotations) (download)
Thu Apr 19 22:42:58 2012 UTC (9 years, 3 months ago) by boklm
File size: 832 byte(s)
use empty temporary directory to sign packages
1 #!/bin/sh
2
3 if [ $# != 3 ] ; then
4 echo "missing arguments"
5 echo "usage : $0 file key_number key_directory"
6 exit 1
7 fi
8
9 file="$1"
10 key="$2"
11 keydir="$3"
12
13 tmpdir=`mktemp -d signbot-XXXXX`
14 tmpfile="$tmpdir/$(basename $file)"
15 cp -pf "$file" "$tmpfile"
16 rpm --delsign "$tmpfile"
17 /usr/local/bin/mga-signpackage "$tmpfile" "$key" "$keydir"
18 nbtry=0
19 while rpmsign -Kv "$tmpfile" 2>&1 | grep BAD
20 do
21 nbtry=$(($nbtry + 1))
22 if [ $nbtry -ge 30 ]
23 then
24 exit 1
25 fi
26
27 # Archive failed file for further analysis
28 mkdir -p "/tmp/failed-sign/"
29 failedfile="/tmp/failed-sign/$(basename "$file").$(date +%Y%m%d%H%M%S)"
30 cp -pf "$file" "$failedfile"
31
32 cp -pf "$file" "$tmpfile"
33 rpm --delsign "$tmpfile"
34 /usr/local/bin/mga-signpackage "$tmpfile" "$key" "$keydir"
35 done
36 mv -f "$tmpfile" "$file"
37 rmdir "$tmpdir"

Properties

Name Value
svn:keywords "ID Date Rev"

  ViewVC Help
Powered by ViewVC 1.1.28