mirror of
https://github.com/YunoHost-Apps/dotclear2_ynh.git
synced 2024-09-03 18:26:29 +02:00
fix updater
This commit is contained in:
parent
a6a9043880
commit
8a3fe9e2a3
1 changed files with 7 additions and 9 deletions
16
.github/workflows/updater.sh
vendored
16
.github/workflows/updater.sh
vendored
|
@ -17,8 +17,8 @@
|
||||||
current_version=$(cat manifest.json | jq -j '.version|split("~")[0]')
|
current_version=$(cat manifest.json | jq -j '.version|split("~")[0]')
|
||||||
repo=$(cat manifest.json | jq -j '.upstream.code|split("https://github.com/")[1]')
|
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)
|
asset=$(curl --silent "https://download.dotclear.org/latest/" | grep "dotclear-.*?.tar.gz" -Po | head -1)
|
||||||
version=${assets%.tar.gz}
|
version=${asset%.tar.gz}
|
||||||
version=${version#dotclear-}
|
version=${version#dotclear-}
|
||||||
|
|
||||||
# Later down the script, we assume the version has only digits and dots
|
# Later down the script, we assume the version has only digits and dots
|
||||||
|
@ -55,28 +55,26 @@ src="app"
|
||||||
tempdir="$(mktemp -d)"
|
tempdir="$(mktemp -d)"
|
||||||
|
|
||||||
# Download sources and calculate checksum
|
# Download sources and calculate checksum
|
||||||
filename=${asset_url##*/}
|
curl --silent -4 -L http://download.dotclear.org/latest/dotclear-$version.tar.gz -o "$tempdir/$asset"
|
||||||
curl --silent -4 -L $asset_url -o "$tempdir/$filename"
|
checksum=$(sha256sum "$tempdir/$asset" | head -c 64)
|
||||||
checksum=$(sha256sum "$tempdir/$filename" | head -c 64)
|
|
||||||
|
|
||||||
# Delete temporary directory
|
# Delete temporary directory
|
||||||
rm -rf $tempdir
|
rm -rf $tempdir
|
||||||
|
|
||||||
# Get extension
|
# Get extension
|
||||||
if [[ $filename == *.tar.gz ]]; then
|
if [[ $asset == *.tar.gz ]]; then
|
||||||
extension=tar.gz
|
extension=tar.gz
|
||||||
else
|
|
||||||
extension=${filename##*.}
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Rewrite source file
|
# Rewrite source file
|
||||||
cat <<EOT > conf/$src.src
|
cat <<EOT > conf/$src.src
|
||||||
SOURCE_URL=$asset_url
|
SOURCE_URL=http://download.dotclear.org/latest/dotclear-$version.tar.gz
|
||||||
SOURCE_SUM=$checksum
|
SOURCE_SUM=$checksum
|
||||||
SOURCE_SUM_PRG=sha256sum
|
SOURCE_SUM_PRG=sha256sum
|
||||||
SOURCE_FORMAT=$extension
|
SOURCE_FORMAT=$extension
|
||||||
SOURCE_IN_SUBDIR=true
|
SOURCE_IN_SUBDIR=true
|
||||||
SOURCE_FILENAME=
|
SOURCE_FILENAME=
|
||||||
|
SOURCE_EXTRACT=true
|
||||||
EOT
|
EOT
|
||||||
echo "... conf/$src.src updated"
|
echo "... conf/$src.src updated"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue