pkg
pkg copied to clipboard
pkg gives the same hash on packages with differing file contents
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.
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?
Actually, I may be wrong. I think commit c337c100ca941c4be4a3369af02b544c4fe1d882 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.)
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 $
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.