summaryrefslogtreecommitdiff
path: root/update/addmods.sh
diff options
context:
space:
mode:
authorjak1 <jak1@themanaworld.org>2022-06-18 21:37:28 +0200
committerjak1 <jak1@themanaworld.org>2022-06-18 21:37:28 +0200
commitb3cd9a5dd68c8a973795931149a254563bda2865 (patch)
tree2110f496a061997fbf120f6ac7e82ff28f7b556e /update/addmods.sh
parent6c2ad98dfd4a2d6e39423c5b4f1e7828fd79566a (diff)
downloadmessworld-tools-b3cd9a5dd68c8a973795931149a254563bda2865.tar.gz
messworld-tools-b3cd9a5dd68c8a973795931149a254563bda2865.tar.bz2
messworld-tools-b3cd9a5dd68c8a973795931149a254563bda2865.tar.xz
messworld-tools-b3cd9a5dd68c8a973795931149a254563bda2865.zip
ported adler32 to py3, updated bash update scripts
Diffstat (limited to 'update/addmods.sh')
-rwxr-xr-xupdate/addmods.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/update/addmods.sh b/update/addmods.sh
index a45f9ed..5255021 100755
--- a/update/addmods.sh
+++ b/update/addmods.sh
@@ -4,13 +4,17 @@
# 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
previous=`cat commit.txt`
@@ -22,7 +26,7 @@ for file in $FILES; do
cd $file
find . -type f | xargs zip -9 -r ../../../../evol-tools/update/files/mod-$file.zip
cd $dir/files
- sum=`../adler32 1 mod-$file.zip`
+ sum=`adler32 1 mod-$file.zip`
echo " <update type=\"data\" group=\"$file\" file=\"mod-$file.zip\" hash=\"${sum}\" />" >> xml_header.txt
cp xml_header.txt resources.xml
cat xml_footer.txt >>resources.xml
@@ -30,3 +34,5 @@ for file in $FILES; do
cp resources2.txt ../upload/
cp resources.xml ../upload/
done
+
+export PATH="$tmp_path" \ No newline at end of file