Manage correctly second revision of debian package (closes #6499)

authorJulien Jehannet <julien.jehannet@logilab.fr>
changeset6183aec7e629
branchdefault
phasepublic
hiddenno
parent revision#86ef2f03e774 drop some TODO items
child revision#30f603ce858d rewrite DISTRIBUTION in changelogs correctly (waiting for a cleaner solution)
files modified by this revision
lgp/setupinfo.py
# HG changeset patch
# User Julien Jehannet <julien.jehannet@logilab.fr>
# Date 1225451462 -3600
# Fri Oct 31 12:11:02 2008 +0100
# Node ID 6183aec7e629b825eb0e8bdf67ad177d18cd2b49
# Parent 86ef2f03e774d566f77cbd5bc8d85571a92e9a89
Manage correctly second revision of debian package (closes #6499)

diff --git a/lgp/setupinfo.py b/lgp/setupinfo.py
@@ -145,11 +145,13 @@
1          """
2          debian_version = DebianChangeLog('%s/%s/changelog' % 
3                  (self.config.pkg_dir, self.get_debian_dir())).get_latest_revision()
4          if debian_version.debian_version != '1' and self.config.orig_tarball is None:
5              raise LGPException('unable to build %s %s: --orig-tarball option is required when '\
6 -                               'not building the first version of the debian package'
7 +                               'not building the first version of the debian package.\n' \
8 +                               'If you haven\'t the original tarball version, ' \
9 +                               'please do an apt-get source of the source package.'
10                                 % (self.get_debian_name(), debian_version))
11          return debian_version
12 
13      def get_upstream_name(self):
14          if self._package_format == 'makefile':
@@ -213,11 +215,11 @@
15      def create_orig_tarball(self, tmpdir):
16          """ Create an origin tarball 
17          """
18          tarball = os.path.join(tmpdir, '%s_%s.orig.tar.gz' %
19                      (self.get_upstream_name(), self.get_upstream_version()))
20 -        if self.config.orig_tarball is None:
21 +        if self.config.orig_tarball is None and self.get_debian_version():
22              if self._package_format in COMMANDS["sdist"]:
23                  cmd = COMMANDS["sdist"][self._package_format] % self.config.dist_dir
24              else:
25                  self.logger.critical("No way to create the source distribution")
26                  sys.exit(1)