From e0509726626d8ed63ea33d367fd2596141dbd596 Mon Sep 17 00:00:00 2001
From: Vitaly Lipatov <lav@etersoft.ru>
Date: Mon, 17 Mar 2025 21:21:53 +0300
Subject: [PATCH] pack generic-tar.sh: cleanup

---
 pack.d/generic-tar.sh | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/pack.d/generic-tar.sh b/pack.d/generic-tar.sh
index 2dcb6373..4ed71090 100755
--- a/pack.d/generic-tar.sh
+++ b/pack.d/generic-tar.sh
@@ -2,14 +2,23 @@
 
 TAR="$1"
 RETURNTARNAME="$2"
-#VERSION+"$3"
+VERSION="$3"
+URL="$4"
 
 . $(dirname $0)/common.sh
 
 alpkg=$(basename $TAR)
 
 VERSION="$(echo "$alpkg" | grep -o -P '[-_.][0-9][0-9]*([.]*[0-9])*' | head -n1 | sed -e 's|^[-_.]||')" #"
-[ -n "$VERSION" ] && PRODUCT="$(echo "$alpkg" | sed -e "s|[-_.]$VERSION.*||")" || fatal "Can't get version from $TAR. We have almost no chance it will supported in alien."
+
+# Commented out: will not work due incorect name
+# Hack for https://www.bitwig.com/dl/Bitwig%20Studio/5.3.2/installer_linux/
+#[ -n "$VERSION" ] || VERSION="$(basename "$(dirname "$URL")" | grep -E "[0-9.]+")"
+
+[ -n "$VERSION" ] || fatal "Can't get version from $TAR. We have almost no chance it will supported in alien."
+
+PRODUCT="$(echo "$alpkg" | sed -e "s|[-_.]$VERSION.*||")"
+
     # set version as all between name and extension
     #local woext="$(echo "alpkg" | sed -e 's|\.tar.*||')"
     #if [ "$woext" != "$alpkg" ] ; then
-- 
2.24.1