forked from php/systems
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-snapshots
executable file
·46 lines (38 loc) · 989 Bytes
/
update-snapshots
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
#! /bin/sh
PATH=/usr/local/bin:/usr/bin:/bin
d=`date -u +%Y%m%d%H%M`
t=/local/php/web/snaps/;
fetch_index ( ) {
cd /local/repository/systems
git pull > /dev/null;
}
do_update ( ) {
prefix=$1
source=/local/repository/$1
target=$1-$d
cd $source
git pull > /dev/null;
cd /dev/shm || exit 1
cp -rp $source $target
find $target -name '.git*' | xargs rm -rf
rm -f $target/.deps $target/ChangeLog*
(cd $target && ./buildconf --force --copy && ./genfiles) >/dev/null 2>&1
rm -f $target/buildmk.stamp
f=$target.tar
tar cf $f $target
rm -rf $target
gzip -c5 < $f > $f.gz
bzip2 -5 < $f > $f.bz2
xz -9 < $f > $f.xz;
rm -f $f
mv $f* $t
(cd $t; ln -sf $f.gz $prefix-latest.tar.gz; ln -sf $f.bz2 $prefix-latest.tar.bz2; ln -sf $f.xz $prefix-latest.tar.xz;)
}
fetch_index
do_update php-master
do_update php5.3
do_update php5.4
do_update php5.5
do_update php5.6
# purge files which are older than 12 hours
find $t -name \*tar\* -mmin +540|xargs rm -rf