diff options
author | Tomás Touceda <chiiph@torproject.org> | 2011-09-02 19:26:42 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@torproject.org> | 2011-09-02 19:26:42 -0300 |
commit | 40b3a86a82054c88f5865cef9b8d7fff8486f768 (patch) | |
tree | 1d8d3ed0f0304c9a65db52a5817895da1516cbb5 | |
parent | f3602b42ad6db5918323c3b3be1c0d4c335e9c61 (diff) |
Run transactions only if --install is given, and create pkg-status if it doesn't exist
-rwxr-xr-x | lib/thandy/ClientCLI.py | 5 | ||||
-rwxr-xr-x | lib/thandy/packagesys/ThpPackages.py | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/thandy/ClientCLI.py b/lib/thandy/ClientCLI.py index 75aa347..2987918 100755 --- a/lib/thandy/ClientCLI.py +++ b/lib/thandy/ClientCLI.py @@ -156,8 +156,9 @@ def update(args): i.install() for bundle in thpTransactions: - thandy.packagesys.ThpPackages.ThpTransaction(thpTransactions[bundle], - repoRoot).install() + if install: + thandy.packagesys.ThpPackages.ThpTransaction(thpTransactions[bundle], + repoRoot).install() return diff --git a/lib/thandy/packagesys/ThpPackages.py b/lib/thandy/packagesys/ThpPackages.py index 090fe55..f359957 100755 --- a/lib/thandy/packagesys/ThpPackages.py +++ b/lib/thandy/packagesys/ThpPackages.py @@ -24,6 +24,9 @@ class ThpDB(object): self._thp_db_root = os.environ.get("THP_DB_ROOT") if self._thp_db_root is None: raise Exception("There is no THP_DB_ROOT variable set") + dbpath = os.path.join(self._thp_db_root, "pkg-status") + if not os.path.exists(dbpath): + os.mkdir(dbpat) def getPath(self): return self._thp_db_root |