/[adm]/puppet/modules/buildsystem/templates/upload-bin
ViewVC logotype

Contents of /puppet/modules/buildsystem/templates/upload-bin

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1964 - (show annotations) (download)
Thu Aug 18 17:52:07 2011 UTC (12 years, 8 months ago) by boklm
File size: 782 byte(s)
send upload notifications to packages-commits ML
1 #!/bin/sh
2 binrepodir=<%= binrepodir %>
3 uploadinfosdir=<%= uploadinfosdir %>
4 tmpfile=$(mktemp)
5 mail_from="<%= uploadmail_from %>"
6 mail_dest="<%= uploadmail_to %>"
7
8 test $# = 2 || exit 3
9 username="$1"
10 comment="$2"
11
12 /bin/cat > "$tmpfile"
13 sha1sum=$(/usr/bin/sha1sum "$tmpfile" | sed 's/ .*$//')
14 if [ -f "$binrepodir/$sha1sum" ]
15 then
16 echo "File $sha1sum already exists." >&2
17 /bin/rm -f "$tmpfile"
18 exit 2
19 fi
20 /bin/mv "$tmpfile" "$binrepodir/$sha1sum"
21 /bin/chmod 644 "$binrepodir/$sha1sum"
22 echo "$username:$comment" > "$uploadinfosdir/$sha1sum"
23 echo "User $username uploaded file $sha1sum: $comment"
24
25 echo "User $username uploaded file $sha1sum: $comment" | \
26 /usr/bin/mailx -s "New file uploaded: $sha1sum - $comment" -S "from=$username <$mail_from>" "$mail_dest"
27
28 exit 0
29

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.30