Commit 909cafb8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm repack: add hack for get AppImage version from URL

parent 9fe9090c
...@@ -30,7 +30,7 @@ __epm_pack_run_handler() ...@@ -30,7 +30,7 @@ __epm_pack_run_handler()
local packname="$1" local packname="$1"
local tarname="$2" local tarname="$2"
local packversion="$3" local packversion="$3"
local url="$3" local url="$4"
returntarname='' returntarname=''
local repackcode="$EPM_PACK_SCRIPTS_DIR/$packname.sh" local repackcode="$EPM_PACK_SCRIPTS_DIR/$packname.sh"
......
...@@ -109,7 +109,8 @@ __prepare_source_package() ...@@ -109,7 +109,8 @@ __prepare_source_package()
# they will fill $returntarname # they will fill $returntarname
if rhas "$alpkg" "\.AppImage$" ; then if rhas "$alpkg" "\.AppImage$" ; then
__epm_pack_run_handler generic-appimage "$pkg" # big hack with $pkg_urls_downloaded (it can be a list, not a single url)
__epm_pack_run_handler generic-appimage "$pkg" "" "$pkg_urls_downloaded"
SUBGENERIC='appimage' SUBGENERIC='appimage'
elif rhas "$alpkg" "\.snap$" ; then elif rhas "$alpkg" "\.snap$" ; then
__epm_pack_run_handler generic-snap "$pkg" __epm_pack_run_handler generic-snap "$pkg"
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
TAR="$1" TAR="$1"
RETURNTARNAME="$2" RETURNTARNAME="$2"
VERSION="$3" VERSION="$3"
URL="$4"
. $(dirname $0)/common.sh . $(dirname $0)/common.sh
...@@ -29,6 +30,12 @@ str="$(grep '^X-AppImage-Version=' $DESKTOPFILE)" ...@@ -29,6 +30,12 @@ str="$(grep '^X-AppImage-Version=' $DESKTOPFILE)"
if [ -n "$str" ] ; then if [ -n "$str" ] ; then
VERSION="$(echo $str | sed -e 's|.*X-AppImage-Version=||')" VERSION="$(echo $str | sed -e 's|.*X-AppImage-Version=||')"
fi fi
# https://github.com/neovide/neovide/releases/download/0.12.2/neovide.AppImage
if [ -z "$VERSION" ] && rhas "$URL" "github.com.*/releases/download" ; then
VERSION="$(echo "$URL" | sed -e 's|.*/releases/download/||' -e "s|/$alpkg||")"
fi
[ -n "$VERSION" ] || fatal "Can't get version from $TAR." [ -n "$VERSION" ] || fatal "Can't get version from $TAR."
PKGNAME=$PRODUCT-$VERSION.tar PKGNAME=$PRODUCT-$VERSION.tar
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment