summaryrefslogtreecommitdiff
path: root/update/musicnew.sh
diff options
context:
space:
mode:
Diffstat (limited to 'update/musicnew.sh')
-rwxr-xr-xupdate/musicnew.sh23
1 files changed, 16 insertions, 7 deletions
diff --git a/update/musicnew.sh b/update/musicnew.sh
index 91a9f5e..a9a6dd5 100755
--- a/update/musicnew.sh
+++ b/update/musicnew.sh
@@ -4,22 +4,29 @@
# Author: Andrei Karas (4144)
dir=`pwd`
-CC=${CC:=gcc}
+tmp_path=$PATH
-rm adler32
-$CC -lz adler32.c -o adler32
+export PATH="$dir:$PATH"
-mkdir files
-mkdir upload
+if [[ ! -d "files" ]]; then
+ mkdir -p files
+fi
+
+if [[ ! -d "upload" ]]; then
+ mkdir -p upload
+fi
+
+if [[ ! -f "files/music.zip" ]]; then
+ rm files/music.zip
+fi
-rm files/music.zip
cd ../../music
find -iregex ".+[.]\(ogg\)" -exec touch --date=2015-01-01 {} \;
find -iregex ".+[.]\(ogg\)" -printf "%P\n" | zip -X -@ ../tools/update/files/music.zip
git log --pretty=oneline -n 1 | awk '{print $1}' >../tools/update/musiccommit.txt
cd $dir/files
-sum=`../adler32 1 music.zip`
+sum=`adler32 1 music.zip`
echo " <update type=\"music\" required=\"no\" file=\"music.zip\" hash=\"${sum}\" description=\"TMW music\" />" >> xml_header.txt
@@ -29,3 +36,5 @@ cat xml_footer.txt >>resources.xml
cp music.zip ../upload/
cp resources.xml ../upload/
cp ../news.txt ../upload/
+
+export PATH="$tmp_path" \ No newline at end of file