From 4e6a492e056281ff4c03464375a93bdd6c9bafa9 Mon Sep 17 00:00:00 2001 From: xonix Date: Mon, 18 Mar 2024 00:06:14 +0200 Subject: [PATCH] rfct Makesurefile --- Makesurefile | 72 ++++++++++++++++++---------------------------------- 1 file changed, 25 insertions(+), 47 deletions(-) diff --git a/Makesurefile b/Makesurefile index 960c2ed..e37d154 100644 --- a/Makesurefile +++ b/Makesurefile @@ -216,12 +216,12 @@ @depends_on fhtagn @args 'bwk' @goal tested_mawk133 @private -@depends_on installed_mawk133 -@depends_on fhtagn @args 'mawk133' +@depends_on installed_mawk @args '1.3.3' 'mawk-1.3.3-20090920.tgz' +@depends_on fhtagn @args 'mawk1.3.3' @goal tested_mawk134 @private -@depends_on installed_mawk134 -@depends_on fhtagn @args 'mawk134' +@depends_on installed_mawk @args '1.3.4' 'mawk-1.3.4-20200120.tgz' +@depends_on fhtagn @args 'mawk1.3.4' @goal tested_all_gawks @doc 'tests with all Gawk-s' @@ -270,37 +270,34 @@ ./bwk --version rm -r awk-master -@lib mawk - install_mawk() { - local version="$1" - local tgz="$2" - - local exeName="mawk${version//./}" - - echo - echo "Fetching Mawk $version..." - echo +@goal installed_mawk @params VERSION TGZ @private +@reached_if [[ -f "soft/mawk$VERSION" ]] +@depends_on soft_folder_created +@use_lib dl + echo + echo "Fetching Mawk $VERSION..." + echo - cd "soft" + cd "soft" - wget "https://invisible-island.net/archives/mawk/$tgz" - tar xzvf "$tgz" - rm "$tgz" + download "https://invisible-island.net/archives/mawk/$TGZ" "$TGZ" + tar xzvf "$TGZ" + rm "$TGZ" - echo - echo "Compile Mawk $version..." - echo + echo + echo "Compile Mawk $VERSION..." + echo - cd mawk-"$version"-* + cd mawk-"$VERSION"-* - ./configure && make + ./configure && make - mv mawk ../$exeName + exeName="mawk$VERSION" + mv mawk ../$exeName - cd .. - ./$exeName -W version - rm -r mawk-"$version"-* - } + cd .. + ./$exeName -W version + rm -r mawk-"$VERSION"-* @goal installed_gawk @params VERSION EXE_NAME @private @reached_if [[ -f soft/"$EXE_NAME" ]] @@ -347,25 +344,6 @@ ./$EXE_NAME --version rm -r "$dlFolder" -@goal installed_mawk133 @private -@reached_if [[ -f soft/mawk133 ]] -@depends_on soft_folder_created -@use_lib mawk - if [[ "$OSTYPE" == "linux-gnu"* ]]; then - install_mawk 1.3.3 'mawk-1.3.3-20080909.tgz' # this one doesn't compile on macos - elif [[ "$OSTYPE" == "darwin"* ]]; then - install_mawk 1.3.3 'mawk-1.3.3-20090920.tgz' - else - >&2 echo "Unknown OS" - exit 1 - fi - -@goal installed_mawk134 @private -@reached_if [[ -f soft/mawk134 ]] -@depends_on soft_folder_created -@use_lib mawk - install_mawk 1.3.4 'mawk-1.3.4-20200120.tgz' - @goal installed_busybox @private @reached_if [[ -x ./soft/busybox ]] @use_lib dl