summaryrefslogtreecommitdiff
path: root/plugins/backend
diff options
context:
space:
mode:
authorlihongsx <lihongx.sun@intel.com>2014-08-26 14:54:17 +0800
committerlihongsx <lihongx.sun@intel.com>2014-08-28 11:33:15 +0800
commitf805814aaa356c5bb935c6f283924e980ef19fbd (patch)
treeafcea352c96f6319302b6a1d79790f03206aa265 /plugins/backend
parent292227931f2bd4079b4f913165dc101dd68e2d64 (diff)
downloadmic-f805814aaa356c5bb935c6f283924e980ef19fbd.tar.gz
mic-f805814aaa356c5bb935c6f283924e980ef19fbd.tar.bz2
mic-f805814aaa356c5bb935c6f283924e980ef19fbd.zip
Add 'get_VcsInfo' function part to yumpkgmgr.py
Fixes: #2081 Change-Id: Id780d02d38cbfccf6d4bb6e9eb37d709db0dd336
Diffstat (limited to 'plugins/backend')
-rw-r--r--plugins/backend/yumpkgmgr.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/backend/yumpkgmgr.py b/plugins/backend/yumpkgmgr.py
index 8603da3..1673639 100644
--- a/plugins/backend/yumpkgmgr.py
+++ b/plugins/backend/yumpkgmgr.py
@@ -454,6 +454,23 @@ class Yum(BackendPlugin, yum.YumBase):
msger.disable_logstderr()
def getVcsInfo(self):
+ if self.__pkgs_vcsinfo:
+ return self.__pkgs_vcsinfo
+ if not self.ts:
+ self.__initialize_transaction()
+ mi = self.ts.dbMatch()
+ for hdr in mi:
+ lname = misc.RPM_FMT % {
+ 'name': hdr['name'],
+ 'arch': hdr['arch'],
+ 'version': hdr['version'],
+ 'release': hdr['release']
+ }
+ try:
+ self.__pkgs_vcsinfo[lname] = hdr['VCS']
+ except KeyError:
+ self.__pkgs_vcsinfo[lname] = None
+
return self.__pkgs_vcsinfo
def getAllContent(self):