diff --git a/loong64-it/loong64-it.bash b/loong64-it/loong64-it.bash index 5a8e948..60b9ea6 100755 --- a/loong64-it/loong64-it.bash +++ b/loong64-it/loong64-it.bash @@ -21,13 +21,14 @@ abinfo() { echo -e "[\e[96mINFO\e[0m]: \e[1m$*\e[0m"; } abdbg() { echo -e "[\e[32mDEBUG\e[0m]: \e[1m$*\e[0m"; } _convert_loong64() { - HERE=$(basename $1) - PKG_NAME=$(dpkg-deb -f "$1" Package) - VERSION=$(dpkg-deb -f "$1" Version) + PKG_PATH=$(realpath $1) + PKG_NAME=$(dpkg-deb -f "$PKG_PATH" Package) + VERSION=$(dpkg-deb -f "$PKG_PATH" Version) + HERE=$(basename $1) abinfo "Examining package information: $1 ..." - dpkg -I "$SRCDIR"/$1 || \ + dpkg -I "$PKG_PATH" || \ aberr "Invalid dpkg package: control (metadata) archive not found: $?" - CONTROL_EXT="$(ar t "$SRCDIR"/$1 | grep control.tar* | cut -f3 -d'.')" + CONTROL_EXT="$(ar t "$PKG_PATH" | grep control.tar* | cut -f3 -d'.')" case "${CONTROL_EXT}" in gz) TAR_COMP_FLAG="z" @@ -50,7 +51,7 @@ _convert_loong64() { cd $(mktemp -d) || \ aberr "Failed to create temporary directory to unpack $1: $?." DEBDIR="$(pwd)" - ar xv "$SRCDIR"/$1 || \ + ar xv "$PKG_PATH" || \ aberr "Failed to unpack $1: $?." abinfo "Unpacking metadata archive: $1 ..." @@ -80,7 +81,7 @@ _convert_loong64() { cd "$DEBDIR" abinfo "Rebuilding dpkg package $1: loong64 ..." - ar rv "$SRCDIR"/$1 control.tar.${CONTROL_EXT} || \ + ar rv "$PKG_PATH" control.tar.${CONTROL_EXT} || \ aberr "Failed to rebuild dpkg package $1: $?." #abinfo "Cleaning up: $1 ..."