Ensures the backed update database and its signature are always consistent.

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

diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 183fa41..0da34b8 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -715,12 +715,13 @@ if (( success )); then
        if [[ -f $REPO_DB_FILE ]]; then
                ln -f "$REPO_DB_FILE" "$REPO_DB_FILE.old" 2>/dev/null || \
                        mv -f "$REPO_DB_FILE" "$REPO_DB_FILE.old"
-       fi
-       if [[ -f $REPO_DB_FILE.sig ]]; then
-               ln -f "$REPO_DB_FILE.sig" "$REPO_DB_FILE.old.sig" 2>/dev/null 
|| \
-                       mv -f "$REPO_DB_FILE.sig" "$REPO_DB_FILE.old.sig"
-       else
-               rm -f "$REPO_DB_FILE.old.sig"
+
+               if [[ -f $REPO_DB_FILE.sig ]]; then
+                       ln -f "$REPO_DB_FILE.sig" "$REPO_DB_FILE.old.sig" 
2>/dev/null || \
+                               mv -f "$REPO_DB_FILE.sig" 
"$REPO_DB_FILE.old.sig"
+               else
+                       rm -f "$REPO_DB_FILE.old.sig"
+               fi
        fi
 
        # rotate the newly-created database and signature into place
-- 
2.2.2

Reply via email to