summaryrefslogtreecommitdiffstats
path: root/cnucnu.py
diff options
context:
space:
mode:
Diffstat (limited to 'cnucnu.py')
-rwxr-xr-xcnucnu.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/cnucnu.py b/cnucnu.py
index ffc43ca..89d45e5 100755
--- a/cnucnu.py
+++ b/cnucnu.py
@@ -25,6 +25,10 @@ from cnucnu.package_list import Repository, PackageList, Package
from cnucnu.checkshell import CheckShell
from cnucnu.bugzilla_reporter import BugzillaReporter
+import pprint as pprint_module
+pp = pprint_module.PrettyPrinter(indent=4)
+pprint = pp.pprint
+
import pickle
def analyse_packages(packages):
@@ -74,7 +78,7 @@ if __name__ == '__main__':
from optparse import OptionParser
parser = OptionParser()
- parser.add_option("", "--check", dest="action", help="check URL and regex interactively", action="store_const", const="check")
+ parser.add_option("", "--shell", dest="action", help="Interactive shell", action="store_const", const="shell")
parser.add_option("", "--config", dest="config_filename", help="config_filename, e.g. for bugzilla credentials", default="./cnucnu.ini")
parser.add_option("", "--create-bugs", dest="action", help="file bugs for outdated packages", action="store_const", const="create-bugs")
parser.add_option("", "--fm-outdated-all", dest="action", help="compare all packages in rawhide with freshmeat", action="store_const", const="fm-outdated-all")
@@ -82,9 +86,8 @@ if __name__ == '__main__':
(options, args) = parser.parse_args()
conf = config.Config(options.config_filename)
-
- if options.action == "check":
- shell = CheckShell()
+ if options.action == "shell":
+ shell = CheckShell(config=conf)
while True:
try:
if not shell.cmdloop():
@@ -94,7 +97,7 @@ if __name__ == '__main__':
print repr(ex)
break
elif options.action == "create-bugs":
- bugzilla_config = conf.get_bugzilla_config()
+ bugzilla_config = conf.bugzilla_config
br = BugzillaReporter(**bugzilla_config)
pl = PackageList()
@@ -103,12 +106,12 @@ if __name__ == '__main__':
try:
if p.upstream_newer:
if p.name not in ['abook', 'crm114', 'crossvc', 'ctorrent', 'ekg2', 'emacs-auctex', 'fdupes', 'hping3', 'libtlen', 'mysqltuner']:
- br.report_outdated(p)
+ br.report_outdated(p, dry_run=False)
except Exception, e:
pprint(e)
elif options.action == "fm-outdated-all":
print "checking all against FM"
- repo = Repository(repoid="rawhide-source")
+ repo = Repository()
package_names = [name for name in repo.repoquery()]
pl=[Package(name, "FM-DEFAULT", "FM-DEFAULT", repo) for name in package_names]
packages = PackageList(packages=pl)
@@ -117,7 +120,7 @@ if __name__ == '__main__':
else:
print "default..."
- repo = Repository(repoid="rawhide-source")
+ repo = Repository()
plist = PackageList(repo=repo)
packages = plist.packages
analyse_packages(packages)