repo-add: unconditionally create the database if it is missing
In f91fa546
(repo-add: do not recreate the database if nothing was changed),
repo-add was made to skip database write-out if there were no changes to
the database. However, this breaks the usage of repo-add to create a new
empty database: `repo-add /path/to/mydb/mydb.db.tar.xz`.
Bring back support for this use-case by always writing the database if
it is missing.
Original-patch-by: Ivan Shapovalov <intelfx@intelfx.name>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
3f1943c84d
commit
8d14b22260
1 changed files with 1 additions and 1 deletions
|
@ -705,7 +705,7 @@ if (( fail )); then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( DB_MODIFIED )); then
|
if (( DB_MODIFIED )) || [[ ! -f $REPO_DB_FILE ]]; then
|
||||||
msg "$(gettext "Creating updated database file '%s'")" "$REPO_DB_FILE"
|
msg "$(gettext "Creating updated database file '%s'")" "$REPO_DB_FILE"
|
||||||
create_db
|
create_db
|
||||||
rotate_db
|
rotate_db
|
||||||
|
|
Loading…
Add table
Reference in a new issue