summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Maas <opensource@till.name>2012-07-03 22:22:47 +0200
committerTill Maas <opensource@till.name>2012-07-03 22:22:47 +0200
commit5e8649f36fefca201b014cd6323b897afb8da0ef (patch)
tree5c1de845c0d6dac79c4956f453081cf47a3cea72
parent190a4c34a9ceac17d72ce1c31c608c505a8c9fdc (diff)
cleanup report output
-rwxr-xr-xcnucnu.py6
-rw-r--r--cnucnu/bugzilla_reporter.py4
2 files changed, 7 insertions, 3 deletions
diff --git a/cnucnu.py b/cnucnu.py
index e0e1e9b..63e84ce 100755
--- a/cnucnu.py
+++ b/cnucnu.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python -ttu
# vim: fileencoding=utf8 foldmethod=marker
#{{{ License header: GPLv2+
# This file is part of cnucnu.
@@ -51,7 +51,9 @@ class Actions(object):
try:
if p.upstream_newer:
print "package '%s' outdated (%s < %s)" % (p.name, p.repo_version, p.latest_upstream)
- pprint(p.report_outdated(dry_run=args.dry_run))
+ bug_url = p.report_outdated(dry_run=args.dry_run)
+ if bug_url:
+ print bug_url
except cc_errors.UpstreamVersionRetrievalError:
log.error("Failed to fetch upstream information for package '%s'" % p.name)
except cc_errors.PackageNotFoundError, e:
diff --git a/cnucnu/bugzilla_reporter.py b/cnucnu/bugzilla_reporter.py
index 9311a66..f650363 100644
--- a/cnucnu/bugzilla_reporter.py
+++ b/cnucnu/bugzilla_reporter.py
@@ -78,6 +78,7 @@ class BugzillaReporter(object):
if not package.exact_outdated_bug:
if not package.open_outdated_bug:
new_bug, change_status = self.create_outdated_bug(package, dry_run)
+ return self.bug_url(new_bug)
else:
open_bug = package.open_outdated_bug
short_desc = open_bug.short_desc
@@ -95,10 +96,11 @@ class BugzillaReporter(object):
res = self.bz._update_bug(open_bug.bug_id, update)
log.debug("Result from bug update: %r" % res)
log.info("Updated bug: %s" % self.bug_url(open_bug))
- return res
+ return self.bug_url(open_bug)
else:
bug = package.exact_outdated_bug
log.info("already reported:%s %s" % (self.bug_url(bug), bug.bug_status))
+ return ""
def create_outdated_bug(self, package, dry_run=True):