mirror of
https://gitee.com/spark-store-project/uos-packaging-tools
synced 2025-10-09 11:22:22 +08:00
新增Installed-Size处理逻辑
Signed-off-by: 眼睛想旅行 <fb93@fb93.com>
This commit is contained in:
parent
eb4a0e119b
commit
6d5d0f0b4c
@ -37,6 +37,24 @@ 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
|
||||
# 判断文件行数是否大于等于3
|
||||
if [ $(wc -l < "$control_file") -ge 3 ]; then
|
||||
sed -i "3iInstalled-Size: $installed_size" "$control_file"
|
||||
else
|
||||
sed -i "1iInstalled-Size: $installed_size" "$control_file"
|
||||
fi
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user