Should reject uploads with equivalent versions

Bug #654878 reported by William Grant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

Some dpkg versions are equal, despite being different strings. In particular, an absent numeric part at the end of a version is counted as 0, so 1.0~foo and 1.0~foo0 are equal. Launchpad will currently accept both, and then be non-deterministic and confusing when dominating. We should probably reject the second upload.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Hmm, we use apt_pkg to do this comparison. Is the bug there or are you looking at something else?

Changed in soyuz:
status: New → Incomplete
Revision history for this message
William Grant (wgrant) wrote :

apt_pkg is correct, and we use it reasonably correctly. Except for this bit here:

    def _checkVersion(self, proposed_version, archive_version, filename):
        """Check if the proposed version is higher than the one in archive."""
        if apt_pkg.VersionCompare(proposed_version, archive_version) < 0:
            self.reject("%s: Version older than that in the archive. %s <= %s"
                        % (filename, proposed_version, archive_version))

If the versions are equal, it will return 0 and the check will pass. An upload with the same version string will be rejected in the file conflict check, but an upload with an equal (but not byte-identical) version string will be let through.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Yay :(

Changed in soyuz:
status: Incomplete → Triaged
importance: Undecided → Medium
tags: added: soyuz-upload
tags: added: trivial
tags: added: boobytrap
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 654878] Re: Should reject uploads with equivalent versions

So, <= 0 ?

Revision history for this message
William Grant (wgrant) wrote :

Yes. Except that we probably want to do something similar for copies, which currently have no version ratcheting at all.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Should this sort of check really be on NascentUpload? It seems like Archive would be more appropriate. Or perhaps some new base class that's shared between NascentUpload, the package copier and (eventually) gina?

Revision history for this message
William Grant (wgrant) wrote :

Right, I argued a while ago that most of NascentUpload and CopyChecker should be merged. But that will never happen now.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Never say never.

Curtis Hovey (sinzui)
Changed in launchpad:
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.