~mvo/update-manager/not-automatic

« back to all changes in this revision

Viewing changes to UpdateManager/UpdateManager.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:
561
561
      iter = self.store.get_iter(path)
562
562
      pkg = self.store.get_value(iter, LIST_PKG)
563
563
      origin = self.store.get_value(iter, LIST_ORIGIN)
 
564
 
 
565
      print pkg.name
 
566
      print origin
 
567
 
564
568
      if pkg is not None:
565
569
          return
566
570
      self.setBusy(True)
567
571
      actiongroup = apt_pkg.GetPkgActionGroup(self.cache._depcache)
568
572
      for pkg in self.list.pkgs[origin]:
569
573
          if pkg.markedInstall or pkg.markedUpgrade:
570
 
              #print "marking keep: ", pkg.name
 
574
              print "marking keep: ", pkg.name
571
575
              pkg.markKeep()
572
576
          elif not (pkg.name in self.list.held_back):
573
 
              #print "marking install: ", pkg.name
 
577
              print "marking install: ", pkg.name
574
578
              pkg.markInstall(autoFix=False,autoInst=False)
575
579
      # check if we left breakage
576
580
      if self.cache._depcache.BrokenCount:
584
588
 
585
589
  def toggled(self, renderer, path):
586
590
    """ a toggle button in the listview was toggled """
 
591
    print "toggled"
587
592
    iter = self.store.get_iter(path)
588
593
    pkg = self.store.get_value(iter, LIST_PKG)
589
594
    # make sure that we don't allow to toggle deactivated updates
598
603
            Fix = apt_pkg.GetPkgProblemResolver(self.cache._depcache)
599
604
            Fix.ResolveByKeep()
600
605
    else:
 
606
        for ver in pkg._pkg.VersionList:
 
607
            print "looking at: ", ver
 
608
            for (verFileIter, index) in ver.FileList:
 
609
                if verFileIter.NotAutomatic:
 
610
                    print "setting candidate ver: ", ver
 
611
                    pkg._depcache.SetCandidateVer(pkg._pkg, ver)
 
612
                    print "new cand: ", pkg._depcache.GetCandidateVer(pkg._pkg)
 
613
                    pkg._depcache.MarkInstall(pkg._pkg)
 
614
                    print "new cand: ", pkg._depcache.GetCandidateVer(pkg._pkg)
 
615
                    break
601
616
        pkg.markInstall()
 
617
        print pkg.markedInstall
 
618
        print pkg.markedUpgrade
 
619
    print "new cand: ", pkg._depcache.GetCandidateVer(pkg._pkg)
602
620
    self.treeview_update.queue_draw()
603
621
    self.refresh_updates_count()
604
622
    self.setBusy(False)