1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-10-31 15:45:03 -04:00

repo-remove: remove deltas file if it becomes empty

Signed-off-by: Florian Pritz <bluewind@xinu.at>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Florian Pritz 2012-04-06 18:17:06 +02:00 committed by Dan McGee
parent 3be02aa27c
commit 62e8812fb9

View File

@ -176,6 +176,11 @@ db_remove_delta() {
if grep -q "$filename" $deltas; then if grep -q "$filename" $deltas; then
sed -i.backup "/$filename/d" $deltas && rm -f $deltas.backup sed -i.backup "/$filename/d" $deltas && rm -f $deltas.backup
msg2 "$(gettext "Removing existing entry '%s'...")" "$filename" msg2 "$(gettext "Removing existing entry '%s'...")" "$filename"
# empty deltas file contains only "%DELTAS%"
if (( $(wc -l < "$deltas") == 1 )); then
msg2 "$(gettext "Removing empty deltas file ...")"
rm "$deltas"
fi
return 0 return 0
fi fi