repo-remove: print an error in case of an empty db
When removing the last packages from a database, repo-remove silently failed. Now an error is printed. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
7786bf6024
commit
37bb99abfa
1 changed files with 3 additions and 1 deletions
|
@ -25,7 +25,6 @@ export TEXTDOMAINDIR='@localedir@'
|
||||||
myver='@PACKAGE_VERSION@'
|
myver='@PACKAGE_VERSION@'
|
||||||
confdir='@sysconfdir@'
|
confdir='@sysconfdir@'
|
||||||
|
|
||||||
FORCE=0
|
|
||||||
REPO_DB_FILE=""
|
REPO_DB_FILE=""
|
||||||
|
|
||||||
msg() {
|
msg() {
|
||||||
|
@ -169,6 +168,9 @@ if [ $success -eq 1 ]; then
|
||||||
esac
|
esac
|
||||||
|
|
||||||
bsdtar -c${TAR_OPT}f "$REPO_DB_FILE" *
|
bsdtar -c${TAR_OPT}f "$REPO_DB_FILE" *
|
||||||
|
else
|
||||||
|
error "$(gettext "All packages have been removed from the database. Deleting '%s'.")" "$REPO_DB_FILE"
|
||||||
|
rm "$REPO_DB_FILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
popd 2>&1 >/dev/null
|
popd 2>&1 >/dev/null
|
||||||
|
|
Loading…
Add table
Reference in a new issue