~brian-murray/apport/overlay-ppa

« back to all changes in this revision

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

  • Committer: Brian Murray
  • Date: 2018-01-05 18:43:19 UTC
  • mfrom: (2972.1.207 trunk)
  • Revision ID: brian@canonical.com-20180105184319-fq8hn2hewt05zibd
Tags: no-stacktracsource, speedier
merge with upstream r3179

Show diffs side-by-side

added added

removed removed

Lines of Context:
707
707
        If install_deps is True, then the dependencies of packages will also
708
708
        be installed.
709
709
 
710
 
        Return a string with outdated packages, or None if all packages were
711
 
        installed.
 
710
        Return a string with outdated packages, or an empty string if all
 
711
        packages were installed.
712
712
 
713
713
        If something is wrong with the environment (invalid configuration,
714
714
        package servers down, etc.), this should raise a SystemError with a
885
885
                if 'Replaces' in candidate.record:
886
886
                    conflicts += apt.apt_pkg.parse_depends(candidate.record['Replaces'])
887
887
                for conflict in conflicts:
 
888
                    # if the package conflicts with itself its wonky e.g.
 
889
                    # gdb in artful
 
890
                    if conflict[0][0] == candidate.package.name:
 
891
                        continue
888
892
                    # apt_pkg.parse_depends needs to handle the or operator,
889
893
                    # but as policy states it is invalid to use that in
890
894
                    # Replaces/Depends, we can safely choose the first value
899
903
                            # unpacked into the sandbox.
900
904
                            continue
901
905
                        for p in providers:
 
906
                            # if the candidate package being installed
 
907
                            # conflicts with but also provides a virtual
 
908
                            # package don't act on the candidate e.g.
 
909
                            # libpam-modules and libpam-mkhomedir in artful
 
910
                            if p == candidate.package.name:
 
911
                                continue
902
912
                            debs = os.path.join(archivedir, '%s_*.deb' % p)
903
913
                            for path in glob.glob(debs):
904
914
                                ver = self._deb_version(path)
915
925
                            ver = self._deb_version(path)
916
926
                            if apt.apt_pkg.check_dep(ver, conflict[2], conflict[1]):
917
927
                                os.unlink(path)
918
 
                        try:
919
 
                            del pkg_versions[conflict[0]]
920
 
                        except KeyError:
921
 
                            pass
 
928
                                try:
 
929
                                    del pkg_versions[conflict[0]]
 
930
                                except KeyError:
 
931
                                    pass
922
932
 
923
933
            if candidate.architecture != 'all' and install_dbg:
924
934
                try: