Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"swupd verify" and "swupd verify --fix" have different opinions #607

Closed
cmarcelo opened this issue Oct 8, 2018 · 6 comments · Fixed by #667
Closed

"swupd verify" and "swupd verify --fix" have different opinions #607

cmarcelo opened this issue Oct 8, 2018 · 6 comments · Fixed by #667
Assignees

Comments

@cmarcelo
Copy link
Contributor

cmarcelo commented Oct 8, 2018

While debugging clearlinux/distribution#206, I've found this:

$ sudo swupd verify 
Verifying version 25470
Verifying files
	...100%
Inspected 407142 files
Verify successful

$ sudo swupd verify --fix
Verifying version 25470
Verifying files
	...100%
Starting download of remaining update content. This may take a while...
	...100%
Finishing download of update content...
Adding any missing files

Fixing modified files
	...100%
Couldn't remove directory containing untracked files: /usr/local/bin
Inspected 407142 files
  0 files were missing
  1 files found which should be deleted
    0 of 1 files were deleted
    1 of 1 files were not deleted
Calling post-update helper scripts.
none
Error: Fix did not fully succeed

Maybe the output of the commands need a better description, but I'd guess that if swupd verify is happy, then swupd verify --fix would have nothing to fix.

@cmarcelo
Copy link
Contributor Author

cmarcelo commented Oct 8, 2018

To be clear: the issue here (bug or, maybe a feature) is the fact that a verify and a fix disagree whether the system is good.

@otaviobp otaviobp added the bug label Oct 8, 2018
@otaviobp
Copy link
Contributor

otaviobp commented Oct 8, 2018

This is a bug. Swupd fix should be a dry-run for swupd verify --fix

@phmccarty
Copy link
Contributor

Related feature request: #536

@castulo castulo self-assigned this Oct 29, 2018
@castulo
Copy link
Contributor

castulo commented Oct 29, 2018

one thing I find strange is that the results from "swupd verify --fix" shown above, are trying to remove files even when the "--picky" option was not used. As far as I know verify should only attempt to remove files if "--fix --picky" are used together.

@castulo
Copy link
Contributor

castulo commented Oct 31, 2018

This is a bug. Swupd fix should be a dry-run for swupd verify --fix

@otaviobp I guess what you meant was "swupd verify" should be a dry-run for "swupd verify --fix", right?

If so, does that mean that "swupd verify" should list the files with a hash mismatch + files that are missing only?

what about files that should be deleted as mentioned in #536?

If these need to be included in the output from "swupd verify" then it is not quite a dry-run for "swupd verify --fix", because that doesn't delete extra files, for that you would need to use --picky.

I guess in that case the correct statement would be that "swupd verify" should be a dry-run of "swupd verify --fix --picky".

@phmccarty
Copy link
Contributor

phmccarty commented Oct 31, 2018

@castulo verify --fix will delete files if they are marked deleted in manifests for all bundles that are installed. verify --fix --picky will additionally delete extra files (i.e. files not listed in any manifest), as you mention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants