New command "pisi blame"
$ pisi blame kernel Ad: kernel, versiyon: 2.6.30_rc8, sürüm: 120 Package Maintainer: Ozan Çağlayan <ozan@pardus.org.tr> Update Date: 2009-06-03 - Version bump to 2.6.30_rc8-git1 which contains the latest DRM fixes, - Add DRM patchset from Fatih, - Add CRYPTO_LZMA support from OpenWRT. or a package release can be given: $ pisi blame -r 29 kdebase Ad: kdebase, versiyon: 4.2.3, sürüm: 29 Package Maintainer: Gökçen Eraslan <gokcen@pardus.org.tr> Update Date: 2009-05-08 Add patches from Kubuntu about dolphin and folderview.
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
#
|
||||
# Copyright (C) 2009, TUBITAK/UEKAE
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free
|
||||
# Software Foundation; either version 2 of the License, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# Please read the COPYING file.
|
||||
#
|
||||
|
||||
import optparse
|
||||
|
||||
import gettext
|
||||
__trans = gettext.translation('pisi', fallback=True)
|
||||
_ = __trans.ugettext
|
||||
|
||||
import pisi.cli.command as command
|
||||
import pisi.context as ctx
|
||||
import pisi.api
|
||||
import pisi.db
|
||||
|
||||
class Blame(command.Command):
|
||||
__doc__ = _("""Info about the package owner
|
||||
|
||||
Usage: blame <package> ... <package>
|
||||
|
||||
""")
|
||||
|
||||
__metaclass__ = command.autocommand
|
||||
|
||||
def __init__(self, args=None):
|
||||
super(Blame, self).__init__(args)
|
||||
self.packagedb = pisi.db.packagedb.PackageDB()
|
||||
|
||||
name = ("blame", "bl")
|
||||
|
||||
def options(self):
|
||||
group = optparse.OptionGroup(self.parser, _("blame options"))
|
||||
group.add_option("-r", "--release", action="store", type="int", help=_("Blame for the given release"))
|
||||
self.parser.add_option_group(group)
|
||||
|
||||
def run(self):
|
||||
self.init(database=False, write=False)
|
||||
for package in self.args:
|
||||
if self.packagedb.has_package(package):
|
||||
pkg = self.packagedb.get_package(package)
|
||||
release = ctx.get_option('release')
|
||||
if not release:
|
||||
self.print_package_info(pkg)
|
||||
else:
|
||||
for hno, update in enumerate(pkg.history):
|
||||
if int(update.release) == release:
|
||||
self.print_package_info(pkg, hno)
|
||||
|
||||
def print_package_info(self, package, hno=0):
|
||||
s = _('Name: %s, version: %s, release: %s\n') % (
|
||||
package.name, package.history[hno].version, package.history[hno].release)
|
||||
s += _('Package Maintainer: %s <%s>\n') % (unicode(package.source.packager.name), package.source.packager.email)
|
||||
s += _('Update Date: %s\n' % package.history[hno].date)
|
||||
s += _('\n%s\n' % package.history[hno].comment)
|
||||
print s
|
||||
@@ -21,6 +21,7 @@ import pisi
|
||||
import pisi.cli
|
||||
import pisi.cli.command as command
|
||||
import pisi.cli.addrepo
|
||||
import pisi.cli.blame
|
||||
import pisi.cli.build
|
||||
import pisi.cli.check
|
||||
import pisi.cli.clean
|
||||
|
||||
Reference in New Issue
Block a user