summaryrefslogtreecommitdiff
path: root/update/pseudo_update.sh
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-05-30 18:02:26 -0300
committerJesusaves <cpntb1@ymail.com>2018-05-30 18:02:26 -0300
commitf21d40102e25befcfd69246a49080f22617b85c8 (patch)
tree97dd47ef8fd9ea159d35bfc9811a6eabebcc4bd2 /update/pseudo_update.sh
parente4b41f3cfd567837e4a0973230182474982dea55 (diff)
downloadtools-f21d40102e25befcfd69246a49080f22617b85c8.tar.gz
tools-f21d40102e25befcfd69246a49080f22617b85c8.tar.bz2
tools-f21d40102e25befcfd69246a49080f22617b85c8.tar.xz
tools-f21d40102e25befcfd69246a49080f22617b85c8.zip
Pseudo Update script - useful to make fake updates.
Diffstat (limited to 'update/pseudo_update.sh')
-rwxr-xr-xupdate/pseudo_update.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/update/pseudo_update.sh b/update/pseudo_update.sh
new file mode 100755
index 0000000..b688937
--- /dev/null
+++ b/update/pseudo_update.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2010-2012 TMW2 Online
+# Author: Andrei Karas (4144)
+
+dir=`pwd`
+
+previous=`cat commit.txt`
+
+cd ../../client-data
+head=`git log --pretty=oneline -n 1 | awk '{print $1}'`
+u1=`echo ${previous} | cut -c 1-7`
+u2=`echo ${head} | cut -c 1-7`
+git log --name-status ${previous}..${head} | awk '/^(A|M)\t/ {print $2}' | \
+grep -e "[.]\(xml\|png\|tmx\|ogg\|txt\|po\|tsx\)" | sort | uniq | \
+xargs zip -X -9 -r ../tools/update/files/TMW2-${u1}..${u2}.zip
+
+cd $dir/upload
+
+sum=`adler32 Extra-${u1}..${u2}.zip | awk '{print $2}'`
+echo "Update ID: ${u1}..${u2}"
+echo "Checksum: ${sum}"
+
+echo "Extra-${u1}..${u2}.zip ${sum}" >>resources2.txt
+cp ../files/xml_header.txt resources.xml
+echo " <update type=\"data\" file=\"Extra-${u1}..${u2}.zip\" hash=\"${sum}\" />" >> resources.xml
+cat ../files/xml_footer.txt >>resources.xml