-
Notifications
You must be signed in to change notification settings - Fork 1
/
update-latest.sh
executable file
·74 lines (61 loc) · 1.88 KB
/
update-latest.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
PROGRAM=`basename $0`
TARGET=`dirname $0`
SOURCE=$1/weinre.build/out/archives
VERSION=`cat $SOURCE/../version.txt`
#-------------------------------------------------------------------------------
makeDir() {
if [ -d $1 ]
then
echo x > /dev/null
else
mkdir $1
fi
}
#-------------------------------------------------------------------------------
copyFiles() {
makeDir builds/$VERSION
makeDir docs/latest
echo "removing old docs/latest/*"
rm -rf docs/latest/*
echo "copying archives to $VERSION"
cp $SOURCE/*-bin.tar.gz builds/$VERSION
cp $SOURCE/*-bin.zip builds/$VERSION
cp $SOURCE/*-doc.tar.gz builds/$VERSION
cp $SOURCE/*-doc.zip builds/$VERSION
cp $SOURCE/*-src.tar.gz builds/$VERSION
cp $SOURCE/*-src.zip builds/$VERSION
echo "copying doc to docs/latest"
cp -R $SOURCE/doc/ docs/latest/
echo "writing $VERSION/.htaccess"
(
cat <<EOF
HeaderName ../index-header.html
AddDescription "binary archive" *-bin.tar.gz
AddDescription "binary archive" *-bin.zip
AddDescription "source archive" *-src.tar.gz
AddDescription "source archive" *-src.zip
AddDescription "documentation archive" *-doc.tar.gz
AddDescription "documentation archive" *-doc.zip
AddDescription "file hash" *.MD5
AddDescription "file hash" *.SHA1
AddDescription "PGP signature" *.asc
AddDescription "PGP/GPG keys" KEYS
EOF
) > builds/$VERSION/.htaccess
}
#-------------------------------------------------------------------------------
cd $TARGET
#---------------------------------------
if [ -z "$1" ]
then
echo "usage: $PROGRAM base-weinre-project-directory"
exit
fi
#---------------------------------------
if [ -d $SOURCE ]
then
copyFiles
else
echo "$PROGRAM: error - directory $SOURCE not found relative to $TARGET"
fi