FS#62912 - [repo-add] Database not updated, if encountering ERROR (while indicating skipping)
Attached to Project:
Pacman
Opened by David Runge (dvzrv) - Sunday, 16 June 2019, 12:43 GMT
Last edited by David Runge (dvzrv) - Sunday, 16 June 2019, 12:44 GMT
Opened by David Runge (dvzrv) - Sunday, 16 June 2019, 12:43 GMT
Last edited by David Runge (dvzrv) - Sunday, 16 June 2019, 12:44 GMT
|
Details
Summary and Info:
When (accidentally) running repo-add with an expansion, that is too broad, or a file that is not a package, no package will be added. The ERROR message indicates, that it is skipping the file (e.g. package.pkg.tar.xz.sig), but it leads to the database (e.g. db-file.db.tar.gz) not being updated. When run with multiple files, that are no packages, repo-add still evaluates all files, but also doesn't update db-file.db.tar.gz. I think a better behavior could be to either fail early (on the first ERROR encountered), or to allow additions to fail (e.g. demoting to WARNING and really skip them) and eventually update the database with additions, that didn't fail. The current behavior is relatively unexpected as the ERROR message indicates skipping, but then the db-file.db.tar.gz is never updated. Steps to Reproduce: Create package.pkg.tar.xz and a detached signature for it (or just touch a file name package.pkg.tar.xz.log) `repo-add -s db-file.db.tar.gz package.pkg.tar.xz*` ``` ==> Extracting database to a temporary location... ==> Extracting database to a temporary location... ==> Adding package 'package.pkg.tar.xz' -> Adding package signature... -> Computing checksums... -> Creating 'desc' db entry... -> Creating 'files' db entry... ==> ERROR: 'package.pkg.tar.xz.sig' is not a package file, skipping ==> No packages modified, nothing to do. ``` |
This task depends upon
At that time, the log message for skipped packages should have been changed, because now it is no longer true. At the same time, simply switching "success" to "fail" was an incomplete way to implement the desired functionality, because we should have hoisted the "nothing to do" message to a check on the length of $#, and broken on the first failure instead of blindly going forth and doing things that are useless.
Allan -- this makes the second way this commit was broken, after
FS#58505:p