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

False positive in ImportPackageFiles when adding .deb files that have different metadata and name but same contents #1378

Open
ferrreo opened this issue Oct 21, 2024 · 1 comment
Assignees
Labels

Comments

@ferrreo
Copy link

ferrreo commented Oct 21, 2024

Detailed Description

If you have a bunch of packages that differ only in package name and depends then when you try add them to your repo via repo add and you have forceReplace set then one of them gets booted out even though they do not actually match or conflict.

This is due to ImportPackageFiles inside the force replace block it is doing a list.search but this is not a thorough as package.Equals, if you add check that matches package.Equals minus the filehash in the loop ranging over "conflictingFiles" then the problem goes away.

Ideally the fix would be in list.search or it's params.

Context

This caused some serious confusion when packages went "missing" from our Distro repo.
This is a pretty common usecase when it comes to metapackages, as generally they have no content and just differ by their depends.

Possible Implementation

I fixed it locally with adding a check to package.SoftEquals in the looping over conflictingFiles and only marking as conflicted if the check passes. SoftEquals is just package.Equals minus the fileshash check.

Your Environment

Not really environment specific but I can provided debs or an example control file if needed.

@neolynx neolynx self-assigned this Oct 21, 2024
@neolynx neolynx added the bug label Oct 21, 2024
@neolynx
Copy link
Member

neolynx commented Oct 21, 2024

Hi !

thanks for the analysis :-)

would you mind opening a PR, so we can have a look ?

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

No branches or pull requests

2 participants