From 0efda8ed80c76b5cdd1cca3a06b857fc1eb2809e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Sat, 3 Sep 2011 22:21:34 -0300 Subject: Improve handling of updates to thp bundles It only installs thp packages that aren't already installed as they should be. It also outputs READY for bundles that have at least one package in them that's installable under this restrictions. --- lib/thandy/ClientCLI.py | 11 ++++++----- lib/thandy/packagesys/ThpPackages.py | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/thandy/ClientCLI.py b/lib/thandy/ClientCLI.py index f568a2c..828d853 100755 --- a/lib/thandy/ClientCLI.py +++ b/lib/thandy/ClientCLI.py @@ -157,13 +157,14 @@ def update(args): # if i != None: # i.install() - logCtrl("READY", BUNDLE=",".join(thpTransactions.keys())) - for bundle in thpTransactions: + tr = thandy.packagesys.ThpPackages.ThpTransaction(thpTransactions[bundle], + alreadyInstalled, + repoRoot) + if tr.isReady(): + logCtrl("READY", BUNDLE=bundle) if install: - thandy.packagesys.ThpPackages.ThpTransaction(thpTransactions[bundle], - alreadyInstalled, - repoRoot).install() + tr.install() return diff --git a/lib/thandy/packagesys/ThpPackages.py b/lib/thandy/packagesys/ThpPackages.py index dd1d399..49ce19e 100755 --- a/lib/thandy/packagesys/ThpPackages.py +++ b/lib/thandy/packagesys/ThpPackages.py @@ -134,6 +134,9 @@ class ThpTransaction(object): self._db, self._repo_root)) + def isReady(self): + return (len(self._installers) > 0) + def _orderByDep(self): """ Orders packages with a topological order by its dependencies """ return self._installers -- cgit v1.2.3