So we get a symlink to ourself, and overwrite the originally generated
repo database. This patch prevents this behavior, and writes out a
non-compressed database to invalid.xxx and generates no links.
Thoughts? Pacman has a requirement that the db file end in '.db', and
the only other extension out there in the wild is '.files' as far as I
know. Should we have strict enforcement of one of these two types in
repo-add? Doing this could also make the --files flag a bit less
necessary as one could auto-detect the correct setting based on the DB
extension.
---
scripts/repo-add.sh.in | 24 ++++++++++++++----------
1 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 0ea8e5b..b29ff92 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -582,8 +582,10 @@ if (( success )); then
*.tar.bz2) TAR_OPT="j" ;;
*.tar.xz) TAR_OPT="J" ;;
*.tar) TAR_OPT="" ;;
- *) warning "$(gettext "'%s' does not have a valid archive extension.")"
- "$REPO_DB_FILE" ;;
+ *)
+ warning "$(gettext "'%s' does not have a valid archive extension.")"
+ "$REPO_DB_FILE"
+ TAR_OPT="" ;;
esac