[or-cvs] r17303: {updater} document rpm and exe formats in example package config (in updater/trunk: . lib/thandy samples)

nickm at seul.org nickm at seul.org
Mon Nov 17 00:34:16 UTC 2008


Author: nickm
Date: 2008-11-16 19:34:16 -0500 (Sun, 16 Nov 2008)
New Revision: 17303

Modified:
   updater/trunk/TODO
   updater/trunk/lib/thandy/formats.py
   updater/trunk/samples/example-package.cfg
Log:
document rpm and exe formats in example package config

Modified: updater/trunk/TODO
===================================================================
--- updater/trunk/TODO	2008-11-17 00:34:00 UTC (rev 17302)
+++ updater/trunk/TODO	2008-11-17 00:34:16 UTC (rev 17303)
@@ -1,6 +1,3 @@
-- Bugs.
-  - Check hashes of downloaded packages and bundles as they are received.
-
 - Download improvements.
   - Back off on download failure.
   - Handle full stalled file in download.
@@ -34,7 +31,7 @@
 
 . Documentation
   - More comments, more tests
-  - Document EXE and RPM formats in HOWTO.
+  o Document EXE and RPM formats in HOWTO.
   . full pydoc
   - revise spec
 

Modified: updater/trunk/lib/thandy/formats.py
===================================================================
--- updater/trunk/lib/thandy/formats.py	2008-11-17 00:34:00 UTC (rev 17302)
+++ updater/trunk/lib/thandy/formats.py	2008-11-17 00:34:16 UTC (rev 17303)
@@ -631,9 +631,13 @@
                'longdesc' : longDescs
              }
 
-    if format == 'rpm' and r.get('rpm_version'):
+    if format == 'rpm':
+        if not r.get('rpm_version'):
+            raise Thandy.FormatException("missing rpm_version value")
         extra['rpm_version'] = r['rpm_version']
-    elif format == 'exe' and r.get('exe_args') != None:
+    elif format == 'exe':
+        if not r.get('exe_args'):
+            raise Thandy.FormatException("missing exe_args value")
         extra['exe_args'] = r['exe_args']
 
     PACKAGE_SCHEMA.checkMatch(result)

Modified: updater/trunk/samples/example-package.cfg
===================================================================
--- updater/trunk/samples/example-package.cfg	2008-11-17 00:34:00 UTC (rev 17302)
+++ updater/trunk/samples/example-package.cfg	2008-11-17 00:34:16 UTC (rev 17303)
@@ -6,9 +6,6 @@
 # Encodes version 0.1.2.
 version = [0, 1, 2]
 
-# What kind of package is this?
-format = "rpm"
-
 # Where in the repository does it go?
 location = "/pkginfo/example/rpm/example-0.1.2.txt"
 
@@ -22,3 +19,26 @@
 
 Its description is not quite so long as it might be, but hey.""")
 
+# What kind of package is this?
+format = "none"
+
+# Thandy knows how to manage some file formats, but it needs to include
+# extra info to do so properly.
+#
+#### The RPM format
+#
+# format = "rpm"
+# # What is the actual version, according to RPM, of this package when it's
+# # installed?
+# rpm_version = "0.1.2"
+
+#### The EXE format.
+#  # (You can use this format for anything that you install by executing it
+#  # that does not have its own built-in installation mechanism.)
+#
+# format = "exe"
+# # What arguments do you pass to this package to install it?
+# # This needs to be a list of strings.
+# exe_args = [ "--silent", "--automatic", "--omit-bugs", ]
+
+



More information about the tor-commits mailing list