~ubuntu-core-dev/update-manager/main

« back to all changes in this revision

Viewing changes to DistUpgrade/DistUpgradeCache.py

  • Committer: Michael Vogt
  • Date: 2007-06-13 14:04:59 UTC
  • Revision ID: michael.vogt@ubuntu.com-20070613140459-ttjmu88325f21g5r
  - implement SystemCleanup spec unused dependencies removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
 
92
92
    def restore_snapshot(self):
93
93
        """ restore a snapshot """
 
94
        actiongroup = apt_pkg.GetPkgActionGroup(self._depcache)
94
95
        self.clear()
95
96
        for name in self.to_remove:
96
97
            pkg = self[name]
502
503
        # this is a delete candidate, only actually delete,
503
504
        # if it dosn't remove other packages depending on it
504
505
        # that are not obsolete as well
 
506
        actiongroup = apt_pkg.GetPkgActionGroup(self._depcache)
505
507
        self.create_snapshot()
506
508
        try:
507
509
            self[pkgname].markDelete()
526
528
                    obsolete_pkgs.add(pkg.name)
527
529
        return obsolete_pkgs
528
530
 
 
531
    def _getUnusedDependencies(self):
 
532
        " get all package names that are not downloadable "
 
533
        unused_dependencies =set()        
 
534
        for pkg in self:
 
535
            if pkg.isInstalled and self._depcache.IsGarbage(pkg._pkg):
 
536
                unused_dependencies.add(pkg.name)
 
537
        return unused_dependencies
 
538
 
529
539
    def _getForeignPkgs(self, allowed_origin, fromDist, toDist):
530
540
        """ get all packages that are installed from a foreign repo
531
541
            (and are actually downloadable)