Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-04-06 18:17:06 +0200
committerDan McGee <dan@archlinux.org>2012-04-07 11:30:56 -0500
commit62e8812fb9002bf2d737375003652bc6becc9f54 (patch)
tree8438375886c3a7692ca76258c67e018f90984578
parent3be02aa27c892b2bcc76a8883a0087b51c0e768b (diff)
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>
-rw-r--r--scripts/repo-add.sh.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 043a0b86..5159ea2f 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -176,6 +176,11 @@ db_remove_delta() {
if grep -q "$filename" $deltas; then
sed -i.backup "/$filename/d" $deltas && rm -f $deltas.backup
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
fi