On 2022-10-14 at 08:19 +0400, Ivan Shapovalov wrote: > Signed-off-by: Ivan Shapovalov <inte...@intelfx.name> > --- > > When `repo-add` is used to add a package that already exists in the > database, it will recompress the database unconditionally, even if > `--new` is passed. Avoid doing that.
ping? > > scripts/repo-add.sh.in | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in > index 221abdc0..78195de1 100644 > --- a/scripts/repo-add.sh.in > +++ b/scripts/repo-add.sh.in > @@ -44,6 +44,8 @@ USE_COLOR='y' > PREVENT_DOWNGRADE=0 > INCLUDE_SIGS=0 > > +ENTRIES_CHANGED=0 > + > # Import libmakepkg > source "$LIBRARY"/util/compress.sh > source "$LIBRARY"/util/message.sh > @@ -343,6 +345,8 @@ db_write_entry() { > rm -f ${oldfile} ${oldfile}.sig > fi > > + (( ++ENTRIES_CHANGED )) > + > return 0 > } # end db_write_entry > > @@ -365,6 +369,9 @@ db_remove_entry() { > > pkgentry=$(find_pkgentry "$pkgname") > done > + if [[ $notfound == 0 ]]; then > + (( ++ENTRIES_CHANGED )) > + fi > return $notfound > } # end db_remove_entry > > @@ -684,13 +691,13 @@ for arg in "${args[@]:1}"; do > done > > # if the whole operation was a success, re-zip and rotate databases > -if (( !fail )); then > +if (( !fail )) && (( ENTRIES_CHANGED > 0 )); then > msg "$(gettext "Creating updated database file '%s'")" > "$REPO_DB_FILE" > create_db > rotate_db > else > msg "$(gettext "No packages modified, nothing to do.")" > - exit 1 > + exit $(( fail != 0 )) > fi > > exit 0
signature.asc
Description: This is a digitally signed message part