summaryrefslogtreecommitdiff
path: root/gbp/deb
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2013-04-13 03:02:02 +0200
committerGuido Günther <agx@sigxcpu.org>2013-04-13 14:26:24 +0200
commitd510f2a0c1cf6ca3a2c112e864774a46b2836efb (patch)
tree0e5653873dfc8a3b7e9501b3b12e216e0b0061ab /gbp/deb
parenta60f37dab018ee827aef631f0e1646e720194655 (diff)
Honor debian/source/format
when checking if a package is a native package Closes: #669267
Diffstat (limited to 'gbp/deb')
-rw-r--r--gbp/deb/source.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/gbp/deb/source.py b/gbp/deb/source.py
index 5d2a947..699038a 100644
--- a/gbp/deb/source.py
+++ b/gbp/deb/source.py
@@ -49,6 +49,8 @@ class DebianSource(object):
@param vfs: a class that implemented GbpVFS interfacce or
a directory (which will used the DirGbpVFS class.
"""
+ self._changelog = None
+
if isinstance(vfs, basestring):
self._vfs = FileVfs(vfs)
else:
@@ -66,10 +68,16 @@ class DebianSource(object):
pass # Fall back to changelog parsing
try:
- clf = self._vfs.open('debian/changelog')
- cl = ChangeLog(clf.read())
- return cl.is_native()
+ return self.changelog.is_native()
except IOError as e:
raise DebianSourceError("Failed to determine source format: %s" % e)
-
+ @property
+ def changelog(self):
+ """
+ Return the L{gbp.deb.ChangeLog}
+ """
+ if not self._changelog:
+ clf = self._vfs.open('debian/changelog')
+ self._changelog = ChangeLog(clf.read())
+ return self._changelog