From 97ce11aa492c229699aa64b29ce78890bc23bbec Mon Sep 17 00:00:00 2001 From: Gaetan Delannay Date: Wed, 18 Jan 2012 18:37:38 +0100 Subject: [PATCH] Bugfixes. --- bin/publish.py | 2 +- shared/packaging.py | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/bin/publish.py b/bin/publish.py index bdb06b2..ffb74d1 100644 --- a/bin/publish.py +++ b/bin/publish.py @@ -275,7 +275,7 @@ class Publisher: '''Creates a Debian package for Appy.''' j = os.path.join Debianizer(j(self.genFolder, 'appy'), j(appyPath, 'versions'), - appVersion=self.versionShort).run() + appVersion=self.versionShort, depends=[]).run() def createDistRelease(self): '''Create the distutils package.''' diff --git a/shared/packaging.py b/shared/packaging.py index 6cec459..7c9a81f 100644 --- a/shared/packaging.py +++ b/shared/packaging.py @@ -20,7 +20,8 @@ class Debianizer: package.''' def __init__(self, app, out, appVersion='0.1.0', - pythonVersions=('2.6', '2.7')): + pythonVersions=('2.6', '2.7'), + depends=('zope2.12', 'openoffice.org')): # app is the path to the Python package to Debianize. self.app = app self.appName = os.path.basename(app) @@ -30,6 +31,8 @@ class Debianizer: self.appVersion = appVersion # On which Python versions will the Debian package depend? self.pythonVersions = pythonVersions + # Debian package dependencies + self.depends = depends def run(self): '''Generates the Debian package.''' @@ -56,10 +59,15 @@ class Debianizer: # Create the control file f = file('control', 'w') nameSuffix = '' - depends = '' + dependencies = [] if self.appName != 'appy': - nameSuffix = '-%s' % self.appName - depends = ', python-appy' + nameSuffix = '-%s' % self.appName.lower() + dependencies.append('python-appy') + if self.depends: + for d in self.depends: dependencies.append(d) + depends = '' + if dependencies: + depends = ', ' + ', '.join(dependencies) f.write(debianInfo % (nameSuffix, self.appVersion, size, self.pythonVersions[0], self.pythonVersions[1], depends))