支持file://协议

This commit is contained in:
2023-07-24 00:46:54 +08:00
parent 130906af43
commit eb6984a9d1
5 changed files with 20 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
Package: uos-packaging-tools
Version: 1.0.3
Version: 1.0.4
Architecture: all
Maintainer: shenmo<shenmo@spark-app.store>
Installed-Size: 10

View File

@@ -7,6 +7,11 @@ fi
for deb_file in "$@"
do
if [[ $deb_file == file://* ]]; then
# 如果是,移除 'file://' 部分并输出结果
deb_file="${deb_file#file://}"
fi
cd "$(dirname "$deb_file")"
# 获取deb包的包名和架构

View File

@@ -14,6 +14,10 @@ unpack_package() {
}
for arg in "$@"; do
if [[ $arg == file://* ]]; then
# 如果是,移除 'file://' 部分并输出结果
arg="${arg#file://}"
fi
unpack_package "$arg"
done

View File

@@ -15,6 +15,12 @@ if [ -e /usr/local/bin/ssaudit ];then
for DEBPATH in "$@"
do
if [[ $DEBPATH == file://* ]]; then
# 如果是,移除 'file://' 部分并输出结果
DEBPATH="${DEBPATH#file://}"
fi
DEBPATH=$(realpath "$DEBPATH")
notify-send "正在使用ssaudit安装 $(dpkg-deb -f "$DEBPATH" Package),请稍候...." -i /usr/share/icons/uos-packaging-tools.png
/usr/local/bin/ssaudit "$DEBPATH"

View File

@@ -5,6 +5,10 @@ OUTPATH=""
for DEBPATH in "$@"
do
if [[ $DEBPATH == file://* ]]; then
# 如果是,移除 'file://' 部分并输出结果
DEBPATH="${DEBPATH#file://}"
fi
rm -rf $TMPDIR/unpack-dir
mkdir -p "$TMPDIR/unpack-dir"
cd "$TMPDIR/unpack-dir"