From f24539ff5e9be46c00010f5800cb0f4a77bd3012 Mon Sep 17 00:00:00 2001 From: lou Date: Mon, 10 Aug 2026 22:29:54 +0800 Subject: [PATCH] =?UTF-8?q?postinst:=20=E7=B3=BB=E7=BB=9F=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=8A=A0=20python3-venv=20+=20pip=20=E6=B8=85?= =?UTF-8?q?=E5=8D=8E=E9=95=9C=E5=83=8F=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/7z-encrypt-server/DEBIAN/postinst | 7 ++++--- debian/postinst | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/debian/7z-encrypt-server/DEBIAN/postinst b/debian/7z-encrypt-server/DEBIAN/postinst index 9736b9b..98da328 100755 --- a/debian/7z-encrypt-server/DEBIAN/postinst +++ b/debian/7z-encrypt-server/DEBIAN/postinst @@ -3,14 +3,15 @@ set -e case "$1" in configure) - echo "正在安装系统依赖 (aria2 + p7zip-full) ..." - apt-get install -y aria2 p7zip-full >/dev/null 2>&1 || true + echo "正在安装系统依赖 (aria2 + p7zip-full + python3-venv) ..." + apt-get install -y aria2 p7zip-full python3-venv >/dev/null 2>&1 || true P=/usr/share/7z-encrypt-server/.venv if [ ! -x "$P/bin/python" ]; then echo "正在创建运行环境 (venv + fastapi/uvicorn/cryptography/tqdm) ..." python3 -m venv "$P" "$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 ;; esac diff --git a/debian/postinst b/debian/postinst index 9736b9b..98da328 100644 --- a/debian/postinst +++ b/debian/postinst @@ -3,14 +3,15 @@ set -e case "$1" in configure) - echo "正在安装系统依赖 (aria2 + p7zip-full) ..." - apt-get install -y aria2 p7zip-full >/dev/null 2>&1 || true + echo "正在安装系统依赖 (aria2 + p7zip-full + python3-venv) ..." + apt-get install -y aria2 p7zip-full python3-venv >/dev/null 2>&1 || true P=/usr/share/7z-encrypt-server/.venv if [ ! -x "$P/bin/python" ]; then echo "正在创建运行环境 (venv + fastapi/uvicorn/cryptography/tqdm) ..." python3 -m venv "$P" "$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 ;; esac