From 8a3fe9e2a38e653c474ede377ad3551971ab3fbf Mon Sep 17 00:00:00 2001 From: Kay0u Date: Tue, 22 Feb 2022 14:33:11 +0100 Subject: [PATCH] fix updater --- .github/workflows/updater.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/updater.sh b/.github/workflows/updater.sh index 7deaab7..2b0a013 100644 --- a/.github/workflows/updater.sh +++ b/.github/workflows/updater.sh @@ -17,8 +17,8 @@ current_version=$(cat manifest.json | jq -j '.version|split("~")[0]') repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]') -assets=$(curl --silent "https://download.dotclear.org/latest/" | grep "dotclear-.*?.tar.gz" -Po | head -1) -version=${assets%.tar.gz} +asset=$(curl --silent "https://download.dotclear.org/latest/" | grep "dotclear-.*?.tar.gz" -Po | head -1) +version=${asset%.tar.gz} version=${version#dotclear-} # Later down the script, we assume the version has only digits and dots @@ -55,28 +55,26 @@ src="app" tempdir="$(mktemp -d)" # Download sources and calculate checksum -filename=${asset_url##*/} -curl --silent -4 -L $asset_url -o "$tempdir/$filename" -checksum=$(sha256sum "$tempdir/$filename" | head -c 64) +curl --silent -4 -L http://download.dotclear.org/latest/dotclear-$version.tar.gz -o "$tempdir/$asset" +checksum=$(sha256sum "$tempdir/$asset" | head -c 64) # Delete temporary directory rm -rf $tempdir # Get extension -if [[ $filename == *.tar.gz ]]; then +if [[ $asset == *.tar.gz ]]; then extension=tar.gz -else - extension=${filename##*.} fi # Rewrite source file cat < conf/$src.src -SOURCE_URL=$asset_url +SOURCE_URL=http://download.dotclear.org/latest/dotclear-$version.tar.gz SOURCE_SUM=$checksum SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=$extension SOURCE_IN_SUBDIR=true SOURCE_FILENAME= +SOURCE_EXTRACT=true EOT echo "... conf/$src.src updated"