~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/model/distroseriesdifference.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2012-01-03 05:05:39 UTC
  • mfrom: (14514.3.5 new-python-apt)
  • Revision ID: launchpad@pqm.canonical.com-20120103050539-y6ipuo5e9illcrsr
[r=benji][bug=551510] Port to new python-apt API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
772
772
        new_source_version = new_parent_source_version = None
773
773
        if self.source_pub:
774
774
            new_source_version = self.source_pub.source_package_version
775
 
            if self.source_version is None or apt_pkg.VersionCompare(
 
775
            if self.source_version is None or apt_pkg.version_compare(
776
776
                    self.source_version, new_source_version) != 0:
777
777
                self.source_version = new_source_version
778
778
                updated = True
784
784
        if self.parent_source_pub:
785
785
            new_parent_source_version = (
786
786
                self.parent_source_pub.source_package_version)
787
 
            if self.parent_source_version is None or apt_pkg.VersionCompare(
 
787
            if self.parent_source_version is None or apt_pkg.version_compare(
788
788
                    self.parent_source_version,
789
789
                    new_parent_source_version) != 0:
790
790
                self.parent_source_version = new_parent_source_version
798
798
        # If this difference was resolved but now the versions don't match
799
799
        # then we re-open the difference.
800
800
        if self.status == DistroSeriesDifferenceStatus.RESOLVED:
801
 
            if apt_pkg.VersionCompare(
 
801
            if apt_pkg.version_compare(
802
802
                self.source_version, self.parent_source_version) < 0:
803
803
                # Higher parent version.
804
804
                updated = True
805
805
                self.status = DistroSeriesDifferenceStatus.NEEDS_ATTENTION
806
806
            elif (
807
 
                apt_pkg.VersionCompare(
 
807
                apt_pkg.version_compare(
808
808
                    self.source_version, self.parent_source_version) > 0
809
809
                and not manual):
810
810
                # The child was updated with a higher version so it's
818
818
        elif self.status in (
819
819
            DistroSeriesDifferenceStatus.NEEDS_ATTENTION,
820
820
            DistroSeriesDifferenceStatus.BLACKLISTED_CURRENT):
821
 
            if apt_pkg.VersionCompare(
 
821
            if apt_pkg.version_compare(
822
822
                    self.source_version, self.parent_source_version) == 0:
823
823
                updated = True
824
824
                self.status = DistroSeriesDifferenceStatus.RESOLVED
825
825
            elif (
826
 
                apt_pkg.VersionCompare(
 
826
                apt_pkg.version_compare(
827
827
                    self.source_version, self.parent_source_version) > 0
828
828
                and not manual):
829
829
                # If the derived version is lower than the parent's, we