From d28a16ae5b134927cffcfa2b781c4cf34b8bff81 Mon Sep 17 00:00:00 2001 From: Jack Greiner Date: Mon, 10 Mar 2025 22:49:51 -0400 Subject: [PATCH 1/4] Refactor wine download process to use git checkout instead of wget --- wsc | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/wsc b/wsc index 8f7095e..9d154b9 100755 --- a/wsc +++ b/wsc @@ -285,27 +285,22 @@ _RELEASE() if [ $Y = "q" ]; then _DONE else - echo -en "\n$dRED Downloading wine-$Y, please wait ... $RES\n" + echo -en "\n$dRED Checking out wine-$Y, please wait ... $RES\n" rm -rf ./wine-vanilla rm -rf ./wine-staging - - mkdir -p --mode=0777 ./cache mkdir -p --mode=0777 ./wine-vanilla mkdir -p --mode=0777 ./wine-staging - cd ./cache - - wget -q https://github.com/wine-staging/wine-staging/archive/v$Y.tar.gz - tar -xzf ./v$Y.tar.gz - cd wine-staging-$Y - cp -r ./* ../../wine-staging - cd .. - - wget -q https://github.com/wine-mirror/wine/archive/wine-$Y.tar.gz - tar -xzf ./wine-$Y.tar.gz - cd wine-wine-$Y - cp -r ./* ../../wine-vanilla - cd ../../ + + pushd ./wine-staging || exit + git clone https://github.com/wine-staging/wine-staging.git . + git checkout v$Y + popd || exit + + pushd ./wine-vanilla || exit + git clone https://github.com/wine-mirror/wine.git . + git checkout wine-$Y + popd || exit fi } From 32d598797a6787d099de921a0eeed9e664ac343a Mon Sep 17 00:00:00 2001 From: Jack Greiner Date: Mon, 10 Mar 2025 23:10:12 -0400 Subject: [PATCH 2/4] Refactor source tree reset process for wine-staging and wine-vanilla --- wsc | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/wsc b/wsc index 9d154b9..c5c4e73 100755 --- a/wsc +++ b/wsc @@ -775,19 +775,27 @@ case $X in [9]* ) clear - echo -en $fRED "Deleting the old staging source tree $RES\n" - rm -rf ./wine-staging - echo -en $fRED "Getting a new copy of the wine-staging source $RES\n" - git clone https://github.com/wine-staging/wine-staging.git ./wine-staging + echo -en $fRED "Resetting the staging source tree $RES\n" + pushd ./wine-staging || exit + git reset --hard + git clean -fdx + echo -en $fRED "Checking out the latest HEAD of the wine-staging source $RES\n" + git checkout master + git pull + popd || exit ;; [0]* ) clear - echo -en $fRED "Deleting the old wine source tree $RES\n" - rm -rf ./wine-vanilla - echo -en $fRED "Getting a new copy of the wine source $RES\n" - git clone git://source.winehq.org/git/wine.git ./wine-vanilla + echo -en $fRED "Resetting the wine source tree $RES\n" + pushd ./wine-vanilla || exit + git reset --hard + git clean -fdx + echo -en $fRED "Checking out the latest HEAD of the wine source $RES\n" + git checkout master + git pull + popd || exit ;; From e6a147e952ae51b6cb8feb170d88c5abd324626b Mon Sep 17 00:00:00 2001 From: Jack Greiner Date: Mon, 10 Mar 2025 23:28:45 -0400 Subject: [PATCH 3/4] Enhance source tree reset process for wine-staging and wine-vanilla with directory creation and cloning logic --- wsc | 50 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/wsc b/wsc index c5c4e73..6aca72a 100755 --- a/wsc +++ b/wsc @@ -776,27 +776,49 @@ case $X in [9]* ) clear echo -en $fRED "Resetting the staging source tree $RES\n" + if [ ! -d "./wine-staging" ]; then + mkdir -p --mode=0777 ./wine-staging + echo -en "$YLW 'wine-staging' directory created$RES\n" + fi pushd ./wine-staging || exit - git reset --hard - git clean -fdx - echo -en $fRED "Checking out the latest HEAD of the wine-staging source $RES\n" - git checkout master - git pull - popd || exit - + if [ -d ".git" ]; then + git reset --hard + git clean -fdx + echo -en $fRED "Checking out the latest HEAD of the wine-staging source $RES\n" + git checkout master + git pull + popd || exit + else + echo -en "$YLW No git repository found in wine-staging, cloning repository...$RES\n" + rm -rf ./* + git clone https://github.com/wine-staging/wine-staging . + git checkout master + popd || exit + fi ;; [0]* ) clear echo -en $fRED "Resetting the wine source tree $RES\n" + if [ ! -d "./wine-vanilla" ]; then + mkdir -p --mode=0777 ./wine-vanilla + echo -en "$YLW 'wine-vanilla' directory created$RES\n" + fi pushd ./wine-vanilla || exit - git reset --hard - git clean -fdx - echo -en $fRED "Checking out the latest HEAD of the wine source $RES\n" - git checkout master - git pull - popd || exit - + if [ -d ".git" ]; then + git reset --hard + git clean -fdx + echo -en $fRED "Checking out the latest HEAD of the wine source $RES\n" + git checkout master + git pull + popd || exit + else + echo -en "$YLW No git repository found in wine-vanilla, cloning repository...$RES\n" + rm -rf ./* + git clone https://github.com/wine-mirror/wine . + git checkout master + popd || exit + fi ;; [a]* ) From 4ddff8564b96cbbb1249aefc35045a32cd0967b0 Mon Sep 17 00:00:00 2001 From: Jack Greiner Date: Mon, 10 Mar 2025 23:37:40 -0400 Subject: [PATCH 4/4] Improve wine repository management by adding checks for existing directories and updating them instead of recreating This saves bandwidth that would otherwise be used to redownload the entire source tree if it could have been otherwise avoided. --- wsc | 54 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/wsc b/wsc index 6aca72a..c30baeb 100755 --- a/wsc +++ b/wsc @@ -282,27 +282,47 @@ _RELEASE() $YLW ==> $RES " read Y - if [ $Y = "q" ]; then _DONE + if [ "$Y" = "q" ]; then _DONE else - echo -en "\n$dRED Checking out wine-$Y, please wait ... $RES\n" - - rm -rf ./wine-vanilla - rm -rf ./wine-staging - mkdir -p --mode=0777 ./wine-vanilla - mkdir -p --mode=0777 ./wine-staging - - pushd ./wine-staging || exit - git clone https://github.com/wine-staging/wine-staging.git . - git checkout v$Y - popd || exit + echo -en "\n$dRED Checking out wine-$Y, please wait ... $RES\n" + + # Process wine-staging: + if [ -d "./wine-staging/.git" ]; then + pushd ./wine-staging || exit + echo -en "$YLW Found existing wine-staging repository, cleaning up ...$RES\n" + git reset --hard + git clean -fdx + git pull + git checkout v$Y + popd || exit + else + mkdir -p --mode=0777 ./wine-staging + pushd ./wine-staging || exit + rm -rf ./* + git clone https://github.com/wine-staging/wine-staging.git . + git checkout v$Y + popd || exit + fi - pushd ./wine-vanilla || exit - git clone https://github.com/wine-mirror/wine.git . - git checkout wine-$Y - popd || exit + # Process wine-vanilla: + if [ -d "./wine-vanilla/.git" ]; then + pushd ./wine-vanilla || exit + echo -en "$YLW Found existing wine-vanilla repository, cleaning up ...$RES\n" + git reset --hard + git clean -fdx + git pull + git checkout wine-$Y + popd || exit + else + mkdir -p --mode=0777 ./wine-vanilla + pushd ./wine-vanilla || exit + rm -rf ./* + git clone https://github.com/wine-mirror/wine.git . + git checkout wine-$Y + popd || exit + fi fi - } _RV_COMMIT()