From 9374209035e238578c192165aa168a188bdf4fa6 Mon Sep 17 00:00:00 2001 From: "Ward Nakchbandi (CosmicFusion)" Date: Wed, 7 Aug 2024 22:23:34 +0200 Subject: [PATCH] Update fetch.sh --- fetch.sh | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/fetch.sh b/fetch.sh index da86450da..870289c03 100755 --- a/fetch.sh +++ b/fetch.sh @@ -28,20 +28,22 @@ for bin_pkg in $BIN_PACKAGE_NAME_LIST do BIN_VERSION=$(apt show $bin_pkg:$PIKA_BIN_ARCH 2>&1 | grep Version: | head -n1 | cut -f2- -d":" | cut -f2- -d":" | tr -d ' ') TARGET_VERSION=$(echo $BIN_VERSION | sed 's/\+b.*//') - apt download -y $bin_pkg:$PIKA_BIN_ARCH || echo "Maybe Error: $bin_pkg doesn't exist in $PIKA_BIN_ARCH" && continue - ls - if [[ $BIN_VERSION == $TARGET_VERSION ]] + if apt download -y $bin_pkg:$PIKA_BIN_ARCH then - echo "dbg0" - cp -vf ./*.deb ./output/ + if [[ $BIN_VERSION == $TARGET_VERSION ]] + then + cp -vf ./*.deb ./output/ + else + for i in ./*.deb + do + mkdir $i-tmp + dpkg-deb -R $i $i-tmp + sed -i "s#$BIN_VERSION#$TARGET_VERSION#g" $i-tmp/DEBIAN/control + dpkg-deb -b $i-tmp $i-fixed.deb + cp -vf ./*-fixed.deb ./output/ + done + fi else - for i in ./*.deb - do - mkdir $i-tmp - dpkg-deb -R $i $i-tmp - sed -i "s#$BIN_VERSION#$TARGET_VERSION#g" $i-tmp/DEBIAN/control - dpkg-deb -b $i-tmp $i-fixed.deb - cp -vf ./*-fixed.deb ./output/ - done + echo "Maybe Error: $bin_pkg doesn't exist in $PIKA_BIN_ARCH" fi done