This commit is contained in:
hl committed 2024-11-05 18:57:48 +08:00
1 parent 1f6837843e
commit db47881842
1 file changed
+4 -2
+4 -2
View File
@@ -35,7 +35,7 @@ main(){
if [ -z "$PROG_PATH" ]; then if [ -z "$PROG_PATH" ]; then
exit 0 exit 0
fi fi
echo "Downloading..." echo "Prepare tmp directory"
pkgname=$(echo "$dl_url" | awk -F'/' '{print $NF}') pkgname=$(echo "$dl_url" | awk -F'/' '{print $NF}')
if [ ! -z "$PKG_NAME" ]; then if [ ! -z "$PKG_NAME" ]; then
pkgname="$PKG_NAME" pkgname="$PKG_NAME"
@@ -46,6 +46,7 @@ main(){
ext=$(echo "$pkgname" | awk -F'.' '{print $NF}') ext=$(echo "$pkgname" | awk -F'.' '{print $NF}')
ext_tar=$(echo "$pkgname" | awk -F'.' '{print $(NF-1)}') ext_tar=$(echo "$pkgname" | awk -F'.' '{print $(NF-1)}')
dirname= dirname=
echo "Downloading..."
if (echo $ext | grep -i zip) >/dev/null 2>&1; then if (echo $ext | grep -i zip) >/dev/null 2>&1; then
curl $SET_AUTH $SET_PROXY -SfLo source_pkg.zip "$dl_url" curl $SET_AUTH $SET_PROXY -SfLo source_pkg.zip "$dl_url"
unzip -o source_pkg.zip unzip -o source_pkg.zip
@@ -62,6 +63,7 @@ main(){
echo "Unknown format: $pkgname" echo "Unknown format: $pkgname"
exit 1 exit 1
fi fi
echo "Inflation complete"
rm source_pkg.* rm source_pkg.*
if [ ! -z "$PKG_DIR" ]; then if [ ! -z "$PKG_DIR" ]; then
if [ "$PKG_DIR" = "-" ]; then if [ "$PKG_DIR" = "-" ]; then
@@ -78,12 +80,12 @@ main(){
cd "$PKG_DIR" cd "$PKG_DIR"
fi fi
fi fi
CWD=$(pwd) CWD=$(pwd)
if [ ${CWD:0:5} != "/tmp/" ]; then if [ ${CWD:0:5} != "/tmp/" ]; then
echo "Wrong dir inside package!" echo "Wrong dir inside package!"
exit 1 exit 1
fi fi
PROG_PATH=$(realpath "$PROG_PATH"); PROG_PATH=$(realpath "$PROG_PATH");
echo echo
echo "Installing..." echo "Installing..."