From be9eb58b5d8d9cca28c563158bfd03b96fd6f3bf Mon Sep 17 00:00:00 2001 From: Nic0Nic0Nii Date: Mon, 23 May 2022 19:59:13 +0000 Subject: [PATCH] update SigScripts Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 --- Java/scripts/filelist | 10 +++++++++ Java/scripts/md5 | 1 - utils/filelist | 10 +++++++++ utils/md5 | 3 +-- utils/search.sh | 47 ++++++++++++++++++++++++++++++++++++++----- 5 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 Java/scripts/filelist create mode 100644 utils/filelist diff --git a/Java/scripts/filelist b/Java/scripts/filelist new file mode 100644 index 0000000..ffb5e62 --- /dev/null +++ b/Java/scripts/filelist @@ -0,0 +1,10 @@ +build.sh +clean.sh +commit.sh +jar.sh +version_info +build.sh +clean.sh +commit.sh +jar.sh +version_info diff --git a/Java/scripts/md5 b/Java/scripts/md5 index 509f040..d4665a7 100644 --- a/Java/scripts/md5 +++ b/Java/scripts/md5 @@ -2,4 +2,3 @@ build.sh:55f0208b07ba384f45009d6f92fe88fe - clean.sh:96ce35f2d2dcb555421e00a6afda23ca - commit.sh:5e4448db9ad48e72ec3a1ff4f5763b41 - jar.sh:56f9b7c6dc8e85f28ffefe9ce82b1f07 - -version_info:a7111b2261433c67c6cf8bfa771fe13b - diff --git a/utils/filelist b/utils/filelist new file mode 100644 index 0000000..ad57929 --- /dev/null +++ b/utils/filelist @@ -0,0 +1,10 @@ +.coauthors +define.sh +main.sh +search.sh +.updateDirectories +.coauthors +define.sh +main.sh +search.sh +.updateDirectories diff --git a/utils/md5 b/utils/md5 index 2b57778..4f78427 100644 --- a/utils/md5 +++ b/utils/md5 @@ -1,5 +1,4 @@ -.coauthors:67792520db231c029a208d553157044e - define.sh:74ea08fb12cab1053663f87007ddd29a - main.sh:909d8d53e71c87a4b5f0f5da9fa6baa2 - -search.sh:16d0a1eebbe03202019c7575d27ec3e1 - +search.sh:2a471ffc3daa12f96157e613873f589d - .updateDirectories:0ede00461e947494545e694040787b3f - diff --git a/utils/search.sh b/utils/search.sh index 0f3664b..73885b0 100644 --- a/utils/search.sh +++ b/utils/search.sh @@ -8,11 +8,14 @@ function search() { search $1$g/ else echo "$1$g is a file" - if [ $g != "md5" ]; then - SUM=$(md5sum < $1$g) - echo "$g:$SUM" >> $1md5 + if [ $g != "md5" ] && [ $g != "filelist" ]; then + if [ $g != ".coauthors" ] && [ $g != "version_info" ]; then + SUM=$(md5sum < $1$g) + echo "$g:$SUM" >> $1md5 + fi + echo "$g" >> $1filelist else - echo " md5 file, ignoring..." + echo " ignoring $g..." fi fi done @@ -35,7 +38,41 @@ function check() { IFS=':' read -ra split <<< $line g="${split[0]}" echo "LINE -- $g" - if [ "$g" != "md5" ]; then + if [ "$g" != "md5" ] && [ "$g" != "filelist" ]; then + if [ -f $1$g ]; + then + if [ "$g" != ".coauthors" ] && [ "$g" != "version_info" ]; then + echo "++Redownload $1$g..." + if [ -f "$1$g" ]; then + curl -H 'Cache-Control: no-cache, no-store' "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g" --output $1$g + else + echo "===Could not find directory, assuming regular scripts directory exists." + curl -H 'Cache-Control: no-cache, no-store' "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g" --output $LANGUAGE/scripts/$g + fi + fi + else + echo "++==Downloading $1$g..." + curl -H 'Cache-Control: no-cache, no-store' "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g" --output $1$g + fi + fi + done < /tmp/out + fi + fi + if [ -f "$1/filelist" ]; + then + echo " filelist: https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1filelist" + curl -H 'Cache-Control: no-cache, no-store' -s "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1filelist" --output /tmp/out + cmp -s $1/filelist /tmp/out + if [ "$?" -ne 0 ] + then + echo " Differences detected!" + cat /tmp/out + while IFS= read -r line + do + IFS=':' read -ra split <<< $line + g="${split[0]}" + echo "LINE -- $g" + if [ "$g" != "md5" ] && [ "$g" != "filelist" ]; then if [ -f $1$g ]; then if [ "$g" != ".coauthors" ] && [ "$g" != "version_info" ]; then