From 1544a930f0e62709c88152051b4a793f61a71f64 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 17 Nov 2008 00:34:16 +0000 Subject: document rpm and exe formats in example package config git-svn-id: file:///home/or/svnrepo/updater/trunk@17303 55e972cd-5a19-0410-ae62-a4d7a52db4cd --- TODO | 5 +---- lib/thandy/formats.py | 8 ++++++-- samples/example-package.cfg | 26 +++++++++++++++++++++++--- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/TODO b/TODO index af09042..eaa8d1e 100644 --- a/TODO +++ b/TODO @@ -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 diff --git a/lib/thandy/formats.py b/lib/thandy/formats.py index ccf3517..ff65173 100644 --- a/lib/thandy/formats.py +++ b/lib/thandy/formats.py @@ -631,9 +631,13 @@ def makePackageObj(config_fname, package_fname): '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) diff --git a/samples/example-package.cfg b/samples/example-package.cfg index 7f776cf..8e0b578 100644 --- a/samples/example-package.cfg +++ b/samples/example-package.cfg @@ -6,9 +6,6 @@ name = "example" # 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 @@ LongDesc('en', 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", ] + + -- cgit v1.2.3