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>
This commit is contained in:
parent
dce7aa8569
commit
e515d89969
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue