[tor-commits] [thandy/master] Creates basic structure to start the thp checker

nickm at torproject.org nickm at torproject.org
Thu Nov 3 19:14:20 UTC 2011


commit 54665d3d4871ec3c23bb69d699f7bf6a6079f419
Author: Tomas Touceda <chiiph at gentoo.org>
Date:   Wed Jun 22 09:13:59 2011 -0300

    Creates basic structure to start the thp checker
---
 lib/thandy/formats.py                  |    4 ++++
 lib/thandy/packagesys/PackageSystem.py |    7 +++++++
 lib/thandy/packagesys/ThpPackages.py   |   17 +++++++++++++++++
 3 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/lib/thandy/formats.py b/lib/thandy/formats.py
index b73e5ac..d1b9e5f 100644
--- a/lib/thandy/formats.py
+++ b/lib/thandy/formats.py
@@ -780,6 +780,10 @@ def makePackageObj(config_fname, package_fname):
         if not r.get('cmd_install'):
             extra['install_type'] = 'command'
             extra['cmd_install'] = [ "${FILE}" ] + r['exe_args']
+    elif format == 'thp':
+        extra['check_type'] = 'thp'
+        extra['thp_name'] = r['name']
+        extra['thp_version'] = r['version']
 
     if r.get('command_install'):
         extra['install_type'] = 'command'
diff --git a/lib/thandy/packagesys/PackageSystem.py b/lib/thandy/packagesys/PackageSystem.py
index 41d75e5..6a8ab60 100644
--- a/lib/thandy/packagesys/PackageSystem.py
+++ b/lib/thandy/packagesys/PackageSystem.py
@@ -51,6 +51,9 @@ def getChecker(relPath, extra, defaultFormat, package):
                 import thandy.packagesys.PackageDB
                 return thandy.packagesys.PackageDB.DBChecker(
                     package['name'], package['version'])
+        elif defaultFormat == 'thp':
+            # TODO: create checker here!
+            pass
         else:
             return None
     elif checkType == 'rpm':
@@ -66,6 +69,10 @@ def getChecker(relPath, extra, defaultFormat, package):
         import thandy.packagesys.ExePackages
         k,v=extra['registry_ent']
         return thandy.packagesys.ExePackages.RegistryChecker(k,v)
+    elif checkType == 'thp':
+        import thandy.packagesys.ThpPackages
+        return thandy.packagesys.ThpPackages.ThpChecker(
+            extra['thp_name'], extra['thp_version'])
     else:
         return None
 
diff --git a/lib/thandy/packagesys/ThpPackages.py b/lib/thandy/packagesys/ThpPackages.py
new file mode 100644
index 0000000..10392e4
--- /dev/null
+++ b/lib/thandy/packagesys/ThpPackages.py
@@ -0,0 +1,17 @@
+# Copyright 2011 The Tor Project, Inc.  See LICENSE for licensing information.
+
+import logging
+import os
+
+import thandy.util
+import thandy.packagesys.PackageSystem as PS
+import thandy.packagesys.PackageDB as PDB
+
+class ThpDB(object):
+  pass
+
+class ThpChecker(PS.Checker):
+  pass
+
+class ThpInstaller(PS.Installer):
+  pass





More information about the tor-commits mailing list