summaryrefslogtreecommitdiff
path: root/scripts/repo-add.sh.in
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 /scripts/repo-add.sh.in
parent3be02aa27c892b2bcc76a8883a0087b51c0e768b (diff)
downloadpacman-62e8812fb9002bf2d737375003652bc6becc9f54.tar.xz
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>
Diffstat (limited to 'scripts/repo-add.sh.in')
-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