1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

repo-add: always remove repo signature symlink

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

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2011-07-18 21:05:51 +10:00 committed by Dan McGee
parent 3934a842b8
commit bf120635a7

View File

@ -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"