Closed hilmiller closed 9 years ago
I agree, this is not desired behavior. You shouldn't add an rpm with the exact same name//version/release and it should have error'ed off to avoid updating the config with the new md5sum.
Thanks for the report. Will get a fix scheduled for the next release.
Glad I could help!
The fix for this has been pushed to the devel branch. Going forward, the user will be notified if a cached copy of the new package being requested for addition is already present. In that case, the add rpm request will fail with a message like the following:
[ERROR]: Cached foo-1.0-1.x86_64.rpm exists already in rpm_topdir (/tmp/X2BhEKj5Qb/test/rpms). Consider increasing the
[ERROR]: RPM release number or remove the cached copy if you are confident this RPM has not been
[ERROR]: propagated previously.
To summarize, losf addrpm doesn't copy an RPM into the losf repository if there is already a package of the same filename in there, however addrpm does update the md5sum in the packages.config which I think is unexpected behavior. There should probably be a warning or something, to at least notify me that this package was not added to the losf repository because of an existing filename. Or, it shouldn't update the md5sum in the packages.config, instead ignoring my request. Although I imagine most people would prefer to have the existing package overwritten entirely.
Here is an existing package in losf, installed previously with losf addrpm.
Here is a new and different package, which happens to have the same file name name.
When I attempt to add my new package, everything looks fine.
However when I run update, I get an md5sum mismatch.
At this point, my packages.config has the correct md5sum.
However the new package's file didn't make it into the repository.