From e515d89969ac7f8448a419b373530376ffe436bf Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Wed, 18 Feb 2009 15:35:00 +0100 Subject: 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 Signed-off-by: Dan McGee --- scripts/repo-add.sh.in | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3-70-g09d2