~jibel/ubuntu/bionic/apport/lp1582950_2_ubiquity_hook

« back to all changes in this revision

Viewing changes to backends/packaging-apt-dpkg.py

  • Committer: Brian Murray
  • Date: 2017-08-29 23:44:45 UTC
  • mfrom: (1369.165.51 trunk)
  • Revision ID: brian@canonical.com-20170829234445-3zlazz2npa6e7v4k
* New upstream release:
  - backends/packaging-apt-dpkg.py: Don't install the version mentioned in a
    versioned dep, rather install the latest version of that dep.
  - backends/packaging-apt-dpkg.py: search -proposed last so we prefer
    packages from other pockets.

Show diffs side-by-side

added added

removed removed

Lines of Context:
826
826
                    apport.warning(m)
827
827
                    continue
828
828
                for dep in cache_pkg.candidate.dependencies:
 
829
                    # the version in dep is the one from pkg's dependencies,
 
830
                    # so use the version from the cache
 
831
                    dep_pkg_vers = cache[dep[0].name].candidate.version
829
832
                    # if the dependency is in the list of packages we don't
830
833
                    # need to look up its dependencies again
831
834
                    if dep[0].name in [pkg[0] for pkg in packages]:
832
835
                        continue
833
836
                    # if the package is already extracted in the sandbox
834
 
                    # because the report need that package we don't want to
 
837
                    # because the report needs that package we don't want to
835
838
                    # install a newer version which may cause a CRC mismatch
836
839
                    # with the installed dbg symbols
837
840
                    if dep[0].name in pkg_versions:
838
841
                        inst_version = pkg_versions[dep[0].name]
839
 
                        if self.compare_versions(inst_version, dep[0].version) > -1:
 
842
                        if self.compare_versions(inst_version, dep_pkg_vers) > -1:
840
843
                            deps.append((dep[0].name, inst_version))
841
844
                        else:
842
 
                            deps.append((dep[0].name, dep[0].version))
 
845
                            deps.append((dep[0].name, dep_pkg_vers))
843
846
                    else:
844
 
                        deps.append((dep[0].name, dep[0].version))
 
847
                        deps.append((dep[0].name, dep_pkg_vers))
845
848
                    if dep[0].name not in [pkg[0] for pkg in packages]:
846
849
                        packages.append((dep[0].name, None))
847
850
            packages.extend(deps)
1208
1211
            release = self.get_distro_codename()
1209
1212
        else:
1210
1213
            release = self._distro_release_to_codename(release)
1211
 
        for pocket in ['-updates', '-security', '-proposed', '']:
 
1214
        # search -proposed last since file may be provided by a new package
 
1215
        for pocket in ['-updates', '-security', '', '-proposed']:
1212
1216
            map = os.path.join(dir, '%s%s-Contents-%s.gz' % (release, pocket, arch))
1213
1217
 
1214
1218
            # check if map exists and is younger than a day; if not, we need to