postinst: 系统依赖加 python3-venv + pip 清华镜像回退
This commit is contained in:
+4
-3
@@ -3,14 +3,15 @@ set -e
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
configure)
|
configure)
|
||||||
echo "正在安装系统依赖 (aria2 + p7zip-full) ..."
|
echo "正在安装系统依赖 (aria2 + p7zip-full + python3-venv) ..."
|
||||||
apt-get install -y aria2 p7zip-full >/dev/null 2>&1 || true
|
apt-get install -y aria2 p7zip-full python3-venv >/dev/null 2>&1 || true
|
||||||
P=/usr/share/7z-encrypt-server/.venv
|
P=/usr/share/7z-encrypt-server/.venv
|
||||||
if [ ! -x "$P/bin/python" ]; then
|
if [ ! -x "$P/bin/python" ]; then
|
||||||
echo "正在创建运行环境 (venv + fastapi/uvicorn/cryptography/tqdm) ..."
|
echo "正在创建运行环境 (venv + fastapi/uvicorn/cryptography/tqdm) ..."
|
||||||
python3 -m venv "$P"
|
python3 -m venv "$P"
|
||||||
"$P/bin/pip" install --quiet --upgrade pip || true
|
"$P/bin/pip" install --quiet --upgrade pip || true
|
||||||
"$P/bin/pip" install --quiet fastapi "uvicorn[standard]" cryptography tqdm
|
"$P/bin/pip" install --quiet fastapi "uvicorn[standard]" cryptography tqdm \
|
||||||
|
|| "$P/bin/pip" install --quiet -i https://pypi.tuna.tsinghua.edu.cn/simple fastapi "uvicorn[standard]" cryptography tqdm
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Vendored
+4
-3
@@ -3,14 +3,15 @@ set -e
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
configure)
|
configure)
|
||||||
echo "正在安装系统依赖 (aria2 + p7zip-full) ..."
|
echo "正在安装系统依赖 (aria2 + p7zip-full + python3-venv) ..."
|
||||||
apt-get install -y aria2 p7zip-full >/dev/null 2>&1 || true
|
apt-get install -y aria2 p7zip-full python3-venv >/dev/null 2>&1 || true
|
||||||
P=/usr/share/7z-encrypt-server/.venv
|
P=/usr/share/7z-encrypt-server/.venv
|
||||||
if [ ! -x "$P/bin/python" ]; then
|
if [ ! -x "$P/bin/python" ]; then
|
||||||
echo "正在创建运行环境 (venv + fastapi/uvicorn/cryptography/tqdm) ..."
|
echo "正在创建运行环境 (venv + fastapi/uvicorn/cryptography/tqdm) ..."
|
||||||
python3 -m venv "$P"
|
python3 -m venv "$P"
|
||||||
"$P/bin/pip" install --quiet --upgrade pip || true
|
"$P/bin/pip" install --quiet --upgrade pip || true
|
||||||
"$P/bin/pip" install --quiet fastapi "uvicorn[standard]" cryptography tqdm
|
"$P/bin/pip" install --quiet fastapi "uvicorn[standard]" cryptography tqdm \
|
||||||
|
|| "$P/bin/pip" install --quiet -i https://pypi.tuna.tsinghua.edu.cn/simple fastapi "uvicorn[standard]" cryptography tqdm
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user