summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorXavier Chantry <shiningxc@gmail.com>2009-02-18 15:35:00 +0100
committerDan McGee <dan@archlinux.org>2009-02-18 19:21:34 -0600
commite515d89969ac7f8448a419b373530376ffe436bf (patch)
treeb00a9757c35cccd3d37e5c40ea60bd307dbbdc2d /scripts
parentdce7aa85696680035a512dde7daf89f9506f8523 (diff)
downloadpacman-e515d89969ac7f8448a419b373530376ffe436bf.tar.xz
repo-add : remove useless test_repo_db_file function
This function was used only once, was basically just one line, and was also called with an unused argument. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-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