summaryrefslogtreecommitdiff
path: root/lib/thandy/ClientCLI.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-11-30 06:19:04 +0000
committerNick Mathewson <nickm@torproject.org>2008-11-30 06:19:04 +0000
commit3bef6462fa8117dde2f55a3ff06dbf1b1a8e02a8 (patch)
tree4dd9ef4282482e81422b28624fd1dbfb442e4f61 /lib/thandy/ClientCLI.py
parentbd2a8dad04994c28086c7c30636273a40be01243 (diff)
Big thandy installation refactoring. Things should be saner now: we recognize that checking an item is sometimes orthogonal to installing it; we do not carry around big bits of unimplemented machinery; we actually document what stuff does in thandy-spec.txt; we do more OO in the places that make sense and less in the places that do not; and almost as an afterthought, we support the command installer type internally. Now all we need is a frontend to make command installers.
git-svn-id: file:///home/or/svnrepo/updater/trunk@17414 55e972cd-5a19-0410-ae62-a4d7a52db4cd
Diffstat (limited to 'lib/thandy/ClientCLI.py')
-rw-r--r--lib/thandy/ClientCLI.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/thandy/ClientCLI.py b/lib/thandy/ClientCLI.py
index ad9f220..fa73ab2 100644
--- a/lib/thandy/ClientCLI.py
+++ b/lib/thandy/ClientCLI.py
@@ -110,10 +110,6 @@ def update(args):
thandy.socksurls.setSocksProxy("127.0.0.1", socksPort)
repo = thandy.repository.LocalRepository(repoRoot)
- packagesys = None
- if use_packagesys:
- packagesys = thandy.packagesys.PackageSystem.PackageMetasystem.create(repo)
-
downloader = thandy.download.DownloadManager()
downloader.start()
@@ -125,7 +121,7 @@ def update(args):
installable = {}
logging.info("Checking for files to update.")
files = repo.getFilesToUpdate(trackingBundles=args, hashDict=hashes,
- pkgSystems=packagesys,
+ usePackageSystem=use_packagesys,
installableDict=installable)
if forceCheck:
@@ -134,8 +130,12 @@ def update(args):
if installable and not files:
for p, d in installable.items():
- for n in d.keys():
- logCtrl("CAN_INSTALL", PKG=p, ITEM=n)
+ for n, i in d.items():
+ if i.canInstall():
+ logCtrl("CAN_INSTALL", PKG=p, ITEM=n)
+ else:
+ logCtrl("NO_INSTALL", PKG=p, ITEM=n)
+ i.setCacheRoot(repoRoot)
logging.info("Ready to install packages for files: %s",
", ".join(sorted(installable.keys())))
@@ -143,7 +143,9 @@ def update(args):
# XXXX handle ordering
for p in installable.values():
for h in p.values():
- h.install()
+ i = h.getInstaller()
+ if i != None:
+ i.install()
return
elif not files: