From c604b67764bfb419cdf030d38c91d9d7b9b2d4f4 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Wed, 5 Aug 2020 10:54:11 -0500 Subject: [PATCH] fix 2? --- patches/Origami/api.txt | 0 patches/Rainforest/api.txt | 0 scripts/applyUpstream.sh | 2 +- scripts/getUpstream.sh | 60 ++++++++++++++++++++------------------ 4 files changed, 32 insertions(+), 30 deletions(-) delete mode 100644 patches/Origami/api.txt delete mode 100644 patches/Rainforest/api.txt diff --git a/patches/Origami/api.txt b/patches/Origami/api.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/patches/Rainforest/api.txt b/patches/Rainforest/api.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/scripts/applyUpstream.sh b/scripts/applyUpstream.sh index 51c92ecb..eb1a93e2 100755 --- a/scripts/applyUpstream.sh +++ b/scripts/applyUpstream.sh @@ -14,7 +14,7 @@ git config commit.gpgsign false cd $1/patches/$2 for D in ${searchtxts[@]}; do echo "IMPORTANT:!!! $D" - if [ true ]; then + if [ -d $1/patches/$2/$dnoslashlower ]; then echo $D dnoslash=$D echo "DnoS: $dnoslash" diff --git a/scripts/getUpstream.sh b/scripts/getUpstream.sh index 690e8d5d..f964b36c 100755 --- a/scripts/getUpstream.sh +++ b/scripts/getUpstream.sh @@ -12,38 +12,40 @@ for D in */; do if [[ $dnoslash != "api" ]]; then echo "Found $dnoslash directory!" for file in ${searchtxts[@]}; do - i=0 - rm -rf -f "$1/patches/$dnoslash/$file/" - echo "Looking for $file file!" - echo "$(cat $patchdir/$dnoslash/$file.txt)" - IFS='&' - read -ra ADDR <<< $(cat $patchdir/$dnoslash/$file.txt) - for patch in ${ADDR[@]}; do - echo "Found $patch in $file!" - echo $1/$dnoslash/patches/$file - for filename in $1/$dnoslash/patches/$file/*.patch; do - filenamend="${filename##*/}" - filenamens=${filenamend%/*} - #filenameedited=${filenamens%.*} # retain the part before the period - filenameedited=${filenamens::-6} - #echo $filenameedited - filenameedited=${filenameedited:5} # retain the part after the frist slash - if [[ $filenameedited == $patch ]]; then - echo "Found Matching file!" - if [[ $i == 0 ]]; then - echo "Making $file dir in $dnoslash patch dir" - mkdir $1/patches/$dnoslash/$file + if [ -f "$1/patches/$dnoslash/$file.txt" ]; then + i=0 + rm -rf -f "$1/patches/$dnoslash/$file/" + echo "Looking for $file file!" + echo "$(cat $patchdir/$dnoslash/$file.txt)" + IFS='&' + read -ra ADDR <<< $(cat $patchdir/$dnoslash/$file.txt) + for patch in ${ADDR[@]}; do + echo "Found $patch in $file!" + echo $1/$dnoslash/patches/$file + for filename in $1/$dnoslash/patches/$file/*.patch; do + filenamend="${filename##*/}" + filenamens=${filenamend%/*} + #filenameedited=${filenamens%.*} # retain the part before the period + filenameedited=${filenamens::-6} + #echo $filenameedited + filenameedited=${filenameedited:5} # retain the part after the frist slash + if [[ $filenameedited == $patch ]]; then + echo "Found Matching file!" + if [[ $i == 0 ]]; then + echo "Making $file dir in $dnoslash patch dir" + mkdir $1/patches/$dnoslash/$file + fi + ((i=i+1)) + printf -v num "%04d" $i + echo "Making ${num}-${patch}.patch file for Yatopia" + cp $1/$dnoslash/patches/$file/$filenamens $1/patches/$dnoslash/$file/"${num}-${patch}.patch" fi - ((i=i+1)) - printf -v num "%04d" $i - echo "Making ${num}-${patch}.patch file for Yatopia" - cp $1/$dnoslash/patches/$file/$filenamens $1/patches/$dnoslash/$file/"${num}-${patch}.patch" - fi + done done + IFS=' ' done - IFS=' ' - done - $1/scripts/applyUpstream.sh $1 $dnoslash || exit 1 + $1/scripts/applyUpstream.sh $1 $dnoslash || exit 1 + fi fi fi fi