[pacman-dev] [PATCH 2/4] repo-add : remove useless test_repo_db_file function
Xavier Chantry
shiningxc at gmail.com
Wed Feb 18 11:19:00 EST 2009
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 at gmail.com>
---
scripts/repo-add.sh.in | 11 +----------
1 files changed, 1 insertions(+), 10 deletions(-)
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index c89e2a5..6b10527 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
--
1.6.1.3
More information about the pacman-dev
mailing list