From 0e6ed149f0b1121fa972e3e97bd1096728b9a50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9C=BC=E7=9D=9B=E6=83=B3=E6=97=85=E8=A1=8C?= Date: Sat, 14 Jun 2025 06:48:00 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EInstalled-Size=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 眼睛想旅行 --- src/usr/bin/packdeb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/usr/bin/packdeb b/src/usr/bin/packdeb index e47343c..89eb7da 100755 --- a/src/usr/bin/packdeb +++ b/src/usr/bin/packdeb @@ -37,6 +37,20 @@ if [ $non_755_files -gt 0 ]; then else echo "所有文件权限已经是755,无需修改" fi +# 新增Installed-Size处理逻辑 +installed_size=$(du -sk "$opt" | awk '{print $1}') +control_file="$opt/DEBIAN/control" +if [ -f "$control_file" ]; then + if grep -q "Installed-Size:" "$control_file"; then + sed -i "s/Installed-Size:.*/Installed-Size: $installed_size/" "$control_file" + else + # 插入到第6行 + sed -i "6iInstalled-Size: $installed_size" "$control_file" + fi + echo "已更新Installed-Size: ${installed_size}KB" +else + echo "警告: 未找到DEBIAN/control文件" +fi fakeroot dpkg-deb -Z xz -b $opt $opt/.. notify-send `basename $opt`打包完成 -i /usr/share/icons/uos-packaging-tools.png -- Gitee