This prevents a dangling symlink being left behind if the repo goes
from being signed to unsigned.

Signed-off-by: Allan McRae <[email protected]>
---
 scripts/repo-add.sh.in |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index db8f6b0..c598ad9 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -652,12 +652,11 @@ if (( success )); then
        [[ -f $tmpdir/$filename.sig ]] && mv "$tmpdir/$filename.sig" 
"$REPO_DB_FILE.sig"
        dblink="${REPO_DB_FILE%.tar*}"
        target=${REPO_DB_FILE##*/}
-       rm -f "$dblink"
+       rm -f "$dblink" "$dblink.sig"
        ln -s "$target" "$dblink" 2>/dev/null || \
                ln "$target" "$dblink" 2>/dev/null || \
                cp "$REPO_DB_FILE" "$dblink"
        if [[ -f "$target.sig" ]]; then
-               rm -f "$dblink.sig"
                ln -s "$target.sig" "$dblink.sig" 2>/dev/null || \
                        ln "$target.sig" "$dblink.sig" 2>/dev/null || \
                        cp "$REPO_DB_FILE.sig" "$dblink.sig"
-- 
1.7.6


Reply via email to