This commit is contained in:
hl committed 2026-07-23 18:56:11 +08:00
1 parent 45414656f6
commit 91addc3cee
1 file changed
+12 -6
+12 -6
View File
@@ -95,13 +95,13 @@ main(){
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
exit 0 exit 0
else else
echo "Not Debian System" echo "ERROR: Not Debian System"
popd >/dev/null popd >/dev/null
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
exit 1 exit 1
fi fi
else else
echo "Unknown format: $pkgname" echo "ERROR: Unknown Format $pkgname"
popd >/dev/null popd >/dev/null
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
exit 1 exit 1
@@ -126,7 +126,7 @@ main(){
fi fi
cd "$current_dir" cd "$current_dir"
else else
echo "Wrong dir inside package!" echo "ERROR: Wrong dir inside package!"
popd >/dev/null popd >/dev/null
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
exit 1 exit 1
@@ -147,7 +147,7 @@ main(){
fi fi
cd "$current_dir" cd "$current_dir"
else else
echo "Wrong dir inside package!" echo "ERROR: Wrong dir inside package!"
popd >/dev/null popd >/dev/null
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
exit 1 exit 1
@@ -157,7 +157,7 @@ main(){
fi fi
CWD=$(pwd) CWD=$(pwd)
if [ ${CWD:0:5} != "/tmp/" ]; then if [ ${CWD:0:5} != "/tmp/" ]; then
echo "Wrong dir inside package!" echo "ERROR: Wrong dir inside package!"
popd >/dev/null popd >/dev/null
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
exit 1 exit 1
@@ -170,7 +170,7 @@ main(){
echo "To: $PROG_PATH/" echo "To: $PROG_PATH/"
if [ ! -d "$PROG_PATH" ]; then if [ ! -d "$PROG_PATH" ]; then
if [ -e "$PROG_PATH" ]; then if [ -e "$PROG_PATH" ]; then
echo "Program path is not directory!" echo "ERROR: Program path is not directory!"
popd >/dev/null popd >/dev/null
rm -rf "$tmp_dir" rm -rf "$tmp_dir"
exit 1 exit 1
@@ -181,6 +181,12 @@ main(){
if [ -z "$PROG_NAME" ]; then if [ -z "$PROG_NAME" ]; then
cp -fr * "$PROG_PATH/" cp -fr * "$PROG_PATH/"
else else
if [ ! -f "$PROG_NAME" ]; then
echo "ERROR: $PROG_NAME not found!"
popd >/dev/null
rm -rf "$tmp_dir"
exit 1
fi
if command -v md5sum &>/dev/null; then if command -v md5sum &>/dev/null; then
echo "Version check" echo "Version check"
old_hash=$(md5sum -bz "$PROG_PATH/$PROG_NAME" | awk '{print $1}') old_hash=$(md5sum -bz "$PROG_PATH/$PROG_NAME" | awk '{print $1}')