-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcreate-n-submit.sh
executable file
·42 lines (29 loc) · 988 Bytes
/
create-n-submit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
THISDIR=$HOME/swift-lang-packaging-fedora
pushd $THISDIR
# First we want to capture the hash of the swift-lang.spec
# file...
bh=`md5sum ./swift-lang.spec`
# Now run the python program to check for updates
# and modify the swift-lang.spec file accordingly
./nrc.py
# Now hash the file again
ah=`md5sum ./swift-lang.spec`
# And now only bother doing the rest of the script
# if the hash was changed, otherwise exit
if [ "$bh" = "$ah" ]; then
exit 0
fi
#
# Okay, we're gonna do this...
#
# First we're going to commit the changes...
git commit -am "Updated to `awk '/%global swift_version *./{print $3}' ./swift-lang.spec`"
git push
# ... and now we're going to submit the srpm to koji to do the build
echo Now submitting the srpm for koji to build
# First make sure we log on, using the info in the KOJI_USER environment
# variable
kinit -kt $HOME/fedora.keytab $KOJI_USER
# And call our submit script to do all the work
source $THISDIR/submit-scratch-builds.sh