Sign database even if empty

Move the create_signature() call outside the case of non-empty
databases, so it will be called regardless.

Signed-off-by: Ray Kohler <ataraxia937@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Ray Kohler 2011-03-25 19:25:38 -04:00 committed by Dan McGee
parent 43dacceb6b
commit 630b7b94c3
1 changed files with 2 additions and 1 deletions

View File

@ -574,12 +574,13 @@ if (( success )); then
pushd "$tmpdir" >/dev/null
if [[ -n $(ls) ]]; then
bsdtar -c${TAR_OPT}f "$filename" *
create_signature "$filename"
else
# we have no packages remaining? zip up some emptyness
warning "$(gettext "No packages remain, creating empty database.")"
bsdtar -c${TAR_OPT}f "$filename" -T /dev/null
fi
create_signature "$filename"
popd >/dev/null
[[ -f $REPO_DB_FILE ]] && mv -f "$REPO_DB_FILE" "${REPO_DB_FILE}.old"