~mvo/update-manager/not-automatic

« back to all changes in this revision

Viewing changes to UpdateManager/Core/UpdateList.py

  • Committer: Michael Vogt
  • Date: 2009-01-29 18:32:43 UTC
  • Revision ID: michael.vogt@ubuntu.com-20090129183243-ifg1l5c3560ja8oe
proof-of-concept for not-automatic support in u-m

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
      matcher[(None,None)] = self.UpdateOrigin(_("Other updates"), -1)
69
69
      return matcher
70
70
 
 
71
  def _has_automatic_origin(self, pkg):
 
72
    for ver in pkg._pkg.VersionList:
 
73
      print "looking at: ", ver
 
74
      for (verFileIter, index) in ver.FileList:
 
75
        if verFileIter.NotAutomatic:
 
76
          return True
 
77
    return False
 
78
 
71
79
  def update(self, cache):
72
80
    self.held_back = []
73
81
 
90
98
          self.pkgs[origin_node] = []
91
99
        self.pkgs[origin_node].append(pkg)
92
100
        self.num_updates = self.num_updates + 1
 
101
      if (pkg.isInstalled and not pkg.isUpgradable and
 
102
            pkg.candidateOrigin and self._has_automatic_origin(pkg)):
 
103
        print "upgradable, but not automatic: ", pkg.name
 
104
        label = self.UpdateOrigin("Not automatic", 1)
 
105
        if not label in self.pkgs:
 
106
          self.pkgs[label] = []
 
107
        self.pkgs[label].append(pkg)
93
108
      if pkg.isUpgradable and not (pkg.markedUpgrade or pkg.markedInstall):
94
109
          self.held_back.append(pkg.name)
95
110
    for l in self.pkgs.keys():
96
111
      self.pkgs[l].sort(lambda x,y: cmp(x.name,y.name))
97
112
    self.keepcount = cache._depcache.KeepCount
98
 
 
 
113
    print self.held_back