-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-version.sh
More file actions
executable file
·61 lines (49 loc) · 1.74 KB
/
update-version.sh
File metadata and controls
executable file
·61 lines (49 loc) · 1.74 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
# Update the version of SlackBuilds. Useful for incremental updates.
# Intended to be run from the root of the repo.
# It updates the version in the .SlackBuild and .info files, generates
# vendored-sources tarball and updates MD5 checksums in the .info file.
set -e
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 PRGNAM NEWVER"
exit 1
fi
PRGNAM="${1%/}"
NEWVER="$2"
CWD="$(pwd)"
cd "$PRGNAM"
. "./$PRGNAM.info"
sed -i "s|$(echo "$VERSION" | sed 's/\./\\./g')|$NEWVER|g" "$PRGNAM.SlackBuild" "$PRGNAM.info"
unset VERSION DOWNLOAD DOWNLOAD_x86_64
. "./$PRGNAM.info"
for URL in $(test "$DOWNLOAD" != "UNSUPPORTED" && echo "$DOWNLOAD" || echo "") \
$(test -n "$DOWNLOAD_x86_64" && echo "$DOWNLOAD_x86_64" || echo "")
do
if [ ! -f "$(basename "$URL")" ]; then
wget --tries=inf --retry-on-http-error=503 "$URL" || true
fi
done
if [ -f mkvendor.sh ]; then
sh mkvendor.sh
# send a notification before entering password
tput bel || true
until (echo put $PRGNAM-$VERSION-vendored-sources.tar* | sftp sawako:/media/slab1/sbo); do :; done
fi
if [ "$DOWNLOAD" != "UNSUPPORTED" ]; then
for TARBALL in $(basename -a $DOWNLOAD); do
CHECKSUMS="$CHECKSUMS$(md5sum "$TARBALL" | cut -d' ' -f1) "
done
perl -0777 -pi -e 's|MD5SUM="[0-9a-f\s\\]*"|MD5SUM="'"${CHECKSUMS% }"'"|' "$PRGNAM.info"
fi
if [ -n "$DOWNLOAD_x86_64" ] && [ "$DOWNLOAD_x86_64" != "UNSUPPORTED" ]; then
for TARBALL in $(basename -a $DOWNLOAD_x86_64); do
CHECKSUMS64="$CHECKSUMS64$(md5sum "$TARBALL" | cut -d' ' -f1) "
done
perl -0777 -pi -e 's|MD5SUM_x86_64="[0-9a-f\s\\]*"|MD5SUM_x86_64="'"${CHECKSUMS64% }"'"|' "$PRGNAM.info"
fi
sbofixinfo
rm -f "$PRGNAM.info.bak"
if [ -z "$NOBUILD" ]; then
time fakeroot bash "$PRGNAM.SlackBuild"
fi
cd "$CWD"