summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/repo-add.sh.in11
1 files changed, 1 insertions, 10 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index c89e2a58..6b10527d 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -82,15 +82,6 @@ This is free software; see the source for copying conditions.\n\
There is NO WARRANTY, to the extent permitted by law.\n")"
}
-# test if a file is a repository DB
-test_repo_db_file () {
- if bsdtar -tf "$REPO_DB_FILE" | grep -q "/desc"; then
- return 0 # YES
- else
- return 1 # NO
- fi
-}
-
# write a list entry
# arg1 - Entry name
# arg2 - List
@@ -328,7 +319,7 @@ for arg in "$@"; do
# store absolute path to repo DB
REPO_DB_FILE=$($realpath "$arg")
if [ -f "$REPO_DB_FILE" ]; then
- if ! test_repo_db_file $cmd; then
+ if ! (bsdtar -tf "$REPO_DB_FILE" | grep -q "/desc"); then
error "$(gettext "Repository file '%s' is not a proper pacman database.")" "$REPO_DB_FILE"
exit 1
fi