repo-add: only backup database signature if database was backed up
Ensures the backed update database and its signature are always consistent. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
3c46420367
commit
660bd1caa1
1 changed files with 7 additions and 6 deletions
|
@ -715,13 +715,14 @@ 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"
|
||||
fi
|
||||
fi
|
||||
|
||||
# rotate the newly-created database and signature into place
|
||||
mv "$tempname" "$REPO_DB_FILE"
|
||||
|
|
Loading…
Add table
Reference in a new issue