mirror of
https://gitee.com/amber-ce/amber-ce-bookworm.git
synced 2025-12-14 02:52:04 +08:00
修复:带括号的参数解析失效
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
Package: cn.flamescion.bookworm-compatibility-mode
|
Package: cn.flamescion.bookworm-compatibility-mode
|
||||||
Version: 12.1.8
|
Version: 12.1.9
|
||||||
Section: misc
|
Section: misc
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Depends: bubblewrap
|
Depends: bubblewrap
|
||||||
|
|||||||
@@ -48,14 +48,14 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
|||||||
--dev-bind /run /run \
|
--dev-bind /run /run \
|
||||||
--dev-bind-try /run/user/$uid/pulse /run/user/$uid/pulse \
|
--dev-bind-try /run/user/$uid/pulse /run/user/$uid/pulse \
|
||||||
--dev-bind / /host \
|
--dev-bind / /host \
|
||||||
--bind-try /usr/share/themes /usr/local/share/themes \
|
--ro-bind /usr/share/themes /usr/local/share/themes \
|
||||||
--bind-try /usr/share/icons /usr/local/share/icons \
|
--ro-bind /usr/share/icons /usr/local/share/icons \
|
||||||
--bind-try /usr/share/fonts /usr/local/share/fonts \
|
--ro-bind /usr/share/fonts /usr/local/share/fonts \
|
||||||
--hostname bookworm-compatibility-mode \
|
--hostname bookworm-compatibility-mode \
|
||||||
--unshare-uts \
|
--unshare-uts \
|
||||||
--dev-bind /etc/resolv.conf /etc/resolv.conf \
|
--dev-bind /etc/resolv.conf /etc/resolv.conf \
|
||||||
--dev-bind /home /home \
|
--dev-bind /home /home \
|
||||||
$@
|
bash -c "${container_command}"
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,27 +24,24 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "" ];then
|
|
||||||
cmd=bash
|
|
||||||
else
|
|
||||||
|
|
||||||
|
|
||||||
# container_command=$*
|
|
||||||
cmd="$1"
|
|
||||||
shift
|
|
||||||
for arg in "$@"; do
|
|
||||||
if [[ $arg =~ \ ]]; then
|
|
||||||
arg=\'${arg//\'/\'\\\'\'}\'
|
|
||||||
fi
|
|
||||||
OPTIONS="${OPTIONS} ${arg}"
|
|
||||||
done
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
non_root_user=$(who | awk '{print $1}' | head -n 1)
|
non_root_user=$(who | awk '{print $1}' | head -n 1)
|
||||||
uid=$(id -u $non_root_user)
|
uid=$(id -u $non_root_user)
|
||||||
|
|
||||||
|
|
||||||
|
#### This part is for args pharm
|
||||||
|
if [ "$1" = "" ];then
|
||||||
|
container_command="bash"
|
||||||
|
else
|
||||||
|
container_command="$1"
|
||||||
|
shift
|
||||||
|
for arg in "$@"; do
|
||||||
|
arg="$(echo "${arg}x" | sed 's|'\''|'\'\\\\\'\''|g')"
|
||||||
|
arg="${arg%x}"
|
||||||
|
container_command="${container_command} '${arg}'"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
bwrap --dev-bind $chrootEnvPath/ / \
|
bwrap --dev-bind $chrootEnvPath/ / \
|
||||||
--setenv LANG "$LANG" \
|
--setenv LANG "$LANG" \
|
||||||
--setenv LC_COLLATE "$LC_COLLATE" \
|
--setenv LC_COLLATE "$LC_COLLATE" \
|
||||||
@@ -73,4 +70,4 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
|||||||
--unshare-uts \
|
--unshare-uts \
|
||||||
--dev-bind /etc/resolv.conf /etc/resolv.conf \
|
--dev-bind /etc/resolv.conf /etc/resolv.conf \
|
||||||
--dev-bind /home /home \
|
--dev-bind /home /home \
|
||||||
bash -c "${cmd} ${OPTIONS}"
|
bash -c "${container_command}"
|
||||||
|
|||||||
@@ -12,6 +12,12 @@ PKGNAME=`basename $ppparent_dir`
|
|||||||
export PACKAGE_NAME=$PKGNAME
|
export PACKAGE_NAME=$PKGNAME
|
||||||
chrootEnvPath=/opt/apps/$PKGNAME/files/bookworm-env
|
chrootEnvPath=/opt/apps/$PKGNAME/files/bookworm-env
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$(id -u)" = "0" ]; then
|
||||||
|
`dirname $chrootEnvPath`/bin/bookworm-run-root "$@"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -e $chrootEnvPath/finish.flag ];then
|
if [ ! -e $chrootEnvPath/finish.flag ];then
|
||||||
|
|
||||||
if [ "$(id -u)" = "0" ]; then
|
if [ "$(id -u)" = "0" ]; then
|
||||||
@@ -22,27 +28,24 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
if [ "$1" = "" ];then
|
|
||||||
cmd=bash
|
|
||||||
else
|
|
||||||
|
|
||||||
|
|
||||||
# container_command=$*
|
|
||||||
cmd="$1"
|
|
||||||
shift
|
|
||||||
for arg in "$@"; do
|
|
||||||
if [[ $arg =~ \ ]]; then
|
|
||||||
arg=\'${arg//\'/\'\\\'\'}\'
|
|
||||||
fi
|
|
||||||
OPTIONS="${OPTIONS} ${arg}"
|
|
||||||
done
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
non_root_user=$(who | awk '{print $1}' | head -n 1)
|
non_root_user=$(who | awk '{print $1}' | head -n 1)
|
||||||
uid=$(id -u $non_root_user)
|
uid=$(id -u $non_root_user)
|
||||||
|
|
||||||
|
|
||||||
|
#### This part is for args pharm
|
||||||
|
if [ "$1" = "" ];then
|
||||||
|
container_command="bash"
|
||||||
|
else
|
||||||
|
container_command="$1"
|
||||||
|
shift
|
||||||
|
for arg in "$@"; do
|
||||||
|
arg="$(echo "${arg}x" | sed 's|'\''|'\'\\\\\'\''|g')"
|
||||||
|
arg="${arg%x}"
|
||||||
|
container_command="${container_command} '${arg}'"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
bwrap --dev-bind $chrootEnvPath/ / \
|
bwrap --dev-bind $chrootEnvPath/ / \
|
||||||
--setenv LANG "$LANG" \
|
--setenv LANG "$LANG" \
|
||||||
--setenv LC_COLLATE "$LC_COLLATE" \
|
--setenv LC_COLLATE "$LC_COLLATE" \
|
||||||
@@ -71,7 +74,7 @@ bwrap --dev-bind $chrootEnvPath/ / \
|
|||||||
--unshare-uts \
|
--unshare-uts \
|
||||||
--dev-bind /etc/resolv.conf /etc/resolv.conf \
|
--dev-bind /etc/resolv.conf /etc/resolv.conf \
|
||||||
--dev-bind /home /home \
|
--dev-bind /home /home \
|
||||||
bash -c "${cmd} ${OPTIONS}"
|
bash -c "${container_command}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user