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

pkg gives the same hash on packages with differing file contents #2276

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cgull
Copy link
Contributor

@cgull cgull commented Apr 20, 2024

I found this in my worktree, sitting around since 2021. It extends the conflicts.sh regression test to show a case where packages with differing file contents, but otherwise identical, have the same digest hash. That would seem to be a bug.

I have no memory now of why I coded up this test, but I'm guessing I had a problem with packages like this not upgrading.

@cgull
Copy link
Contributor Author

cgull commented Apr 23, 2024

I now think pkg query %X <package> is working as intended (it's intended to ignore file contents), and this regression test is wrong.

However, there are many problems around pkg_checksum_generate(), such as the inc_files parameter never being used (it only works by accident because the package database being queried does or doesn't have file records loaded).

@evadot I think I understand your motivations for pkgbase but what about non-base packages that change?

@cgull
Copy link
Contributor Author

cgull commented Apr 23, 2024

Actually, I may be wrong. I think commit c337c10 is supposed to include files in the checksum. What's the intended behavior with pkg query %X <installed-package>? pkg query -f <uninstalled.pkg> %X? pkg rquery %X <remote-pkg>? (The last fails, and I'm pretty sure it's not supposed to work.)

@cgull
Copy link
Contributor Author

cgull commented Apr 23, 2024

jhood@jhood_lfs:/home/jhood/src/pkg [3] 0 $ pkg info -p bash
bash-5.2.26_1                  /usr/local
jhood@jhood_lfs:/home/jhood/src/pkg [3] 0 $ pkg query %X bash
2$2$4nxdk3bo6qo8prfqi7qsdchbkr7ec65epcd8hcgyw6roamzuzb68rgwfrrgu4u1kqw45tmogho5rfr1egr73zj64rft71adj4j3s4fd
jhood@jhood_lfs:/home/jhood/src/pkg [3] 0 $ pkg query -F /var/cache/pkg/bash-5.2.26_1.pkg %X
2$2$6h8bzgdhxix9o41qppj7wjoeh3y35timd4k5iomx7p1edgy77w9ip4bicasigex34m5edziry5hgkdcpoxsynypt3qowfh91eyhmu1d
jhood@jhood_lfs:/home/jhood/src/pkg [3] 0 $ 

@cgull
Copy link
Contributor Author

cgull commented Aug 25, 2024

Anyone have any opinions on this?

This is just a regression test showing a maybe bug, and without a lot of context, so I have no problem with closing it-- but I'd like to either close it or move it forward a bit.

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

Successfully merging this pull request may close these issues.

1 participant