[PATCH] modify blends_prospective_gatherer.py: check if dpkg-parsechangelog exists
---
udd/blends_prospective_gatherer.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/udd/blends_prospective_gatherer.py b/udd/blends_prospective_gatherer.py
index f8cb64a..3594e1a 100644
--- a/udd/blends_prospective_gatherer.py
+++ b/udd/blends_prospective_gatherer.py
@@ -140,11 +140,15 @@ class blends_prospective_gatherer(gatherer):
vcs.close()
# Read output of dpkg-parsechangelog
- p = Popen("LC_ALL=C dpkg-parsechangelog -l"+upath+'/'+source+'.changelog', shell=True, bufsize=4096,
- stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
- errstring = p.stderr.read()
- if errstring != '':
- self.log.warning("Error parsing changelog of '%s' of %s\n %s:" % (source, sprosp['blend'], errstring))
+ if exists('/usr/bin/dpkg-parsechangelog'):
+ p = Popen("LC_ALL=C dpkg-parsechangelog -l"+upath+'/'+source+'.changelog', shell=True, bufsize=4096,
+ stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
+ errstring = p.stderr.read()
+ if errstring != '':
+ self.log.warning("Error parsing changelog of '%s' of %s\n %s:" % (source, sprosp['blend'], errstring))
+ else:
+ self.log.warning("dpkg-parsechangelog file does not exist")
+
for stanza in deb822.Sources.iter_paragraphs(p.stdout):
if source != stanza['source']:
print >>stderr, "Something is wrong with changelog data of package '%s' of %s. Changelog says source = '%s'." % (source, sprosp['blend'], stanza['source'])
--
1.9.1
Reply to: