-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathupdate.sh
executable file
·32 lines (27 loc) · 1.06 KB
/
update.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
#!/bin/bash
set -e -o pipefail
if ! test `find "timestamp" -mmin +3000`
then
echo "not old enough"
exit
fi
touch timestamp
#bash hj.sh
export GCCGIT=~/git/gcc
export GCCVER=14.1.0
GCCTAG=releases/gcc-"${GCCVER}"
GCCBRANCH=origin/releases/gcc-"$(echo "$GCCVER" | sed 's/\..*//')"
git -C "$GCCGIT" remote update -p
git -C "$GCCGIT" rev-parse --verify --quiet refs/tags/"${GCCTAG}" > /dev/null
git -C "$GCCGIT" rev-parse --verify --quiet "$GCCBRANCH" > /dev/null
git -C "$GCCGIT" diff "${GCCTAG}".."${GCCBRANCH}" -- \* ':!*/DATESTAMP' > new.patch~
git show HEAD:gcc-stable-branch.patch | sed -n '/^diff --git/,$p' > current.patch~
diff current.patch~ new.patch~ > /dev/null && rm current.patch~ new.patch~ && exit
git -C "$GCCGIT" shortlog "${GCCTAG}".."${GCCBRANCH}" > gcc-stable-branch.patch
cat new.patch~ >> gcc-stable-branch.patch
rm -f *.patch~
git -C "$GCCGIT" show "${GCCBRANCH}":gcc/DATESTAMP > DATESTAMP
git -C "$GCCGIT" describe --abbrev=10 --match 'releases/*' "$GCCBRANCH" > REVISION
make bumpnogit
git commit -m "stable update to `cat REVISION`" -a
make koji-nowait