summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Maas <opensource@till.name>2013-07-19 23:44:56 +0200
committerTill Maas <opensource@till.name>2013-10-03 17:49:57 +0200
commit0ed43e64b9af7c92ca00a283265944349aeeba3e (patch)
tree4d87bb177c5b7aa6d9f27c45e5478efcf21fe6dc
parent3af50951fb957de0371f6231a308457df7507f2c (diff)
downloadcnucnu-0ed43e64b9af7c92ca00a283265944349aeeba3e.tar.gz
cnucnu-0ed43e64b9af7c92ca00a283265944349aeeba3e.tar.xz
cnucnu-0ed43e64b9af7c92ca00a283265944349aeeba3e.zip
add progress stats
-rwxr-xr-xcnucnu.py22
-rwxr-xr-xcnucnu/package_list.py1
2 files changed, 14 insertions, 9 deletions
diff --git a/cnucnu.py b/cnucnu.py
index f679819..ebabc04 100755
--- a/cnucnu.py
+++ b/cnucnu.py
@@ -44,23 +44,27 @@ class Actions(object):
scm = SCM(**global_config.config["scm"])
pl = PackageList(repo=repo, scm=scm, br=br, **global_config.config["package list"])
- for p in pl:
- if p.name >= args.start_with:
- log.info("checking package '%s'", p.name)
+ package_count = len(pl)
+ log.info("Checking '%i' packages", package_count)
+ for number, package in enumerate(pl, start=1):
+ if package.name >= args.start_with:
+ log.info("checking package '%s' (%i/%i)", package.name, number, package_count)
try:
- if p.upstream_newer:
- print "package '%s' outdated (%s < %s)" % (p.name, p.repo_version, p.latest_upstream)
- bug_url = p.report_outdated(dry_run=args.dry_run)
+ if package.upstream_newer:
+ print "package '%s' outdated (%s < %s)" % (package.name,
+ package.repo_version,
+ package.latest_upstream)
+ bug_url = package.report_outdated(dry_run=args.dry_run)
if bug_url:
print bug_url
except cc_errors.UpstreamVersionRetrievalError, e:
- log.error("Failed to fetch upstream information for package '%s' (%s)" % (p.name, e.message))
+ log.error("Failed to fetch upstream information for package '%s' (%s)" % (package.name, e.message))
except cc_errors.PackageNotFoundError, e:
log.error(e)
except Exception, e:
- log.exception("Exception occured while processing package '%s':\n%s" % (p.name, pp.pformat(e)))
+ log.exception("Exception occured while processing package '%s':\n%s" % (package.name, pp.pformat(e)))
else:
- log.info("skipping package '%s'", p.name)
+ log.info("skipping package '%s'", package.name)
def action_dump_config(self, args):
""" dump config to stdout """
diff --git a/cnucnu/package_list.py b/cnucnu/package_list.py
index a530474..e0dc56b 100755
--- a/cnucnu/package_list.py
+++ b/cnucnu/package_list.py
@@ -420,6 +420,7 @@ class PackageList:
self.packages = packages
self.append = self.packages.append
+ self.__len__ = self.packages.__len__
def __getitem__(self, key):
if isinstance(key, int):