summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlihongsx <lihongx.sun@intel.com>2014-08-26 14:54:17 +0800
committeradmin <yuhuan.yang@samsung.com>2016-02-04 18:27:08 +0800
commit934f78cdb04411e578c796f4782fdcb3292b29c9 (patch)
treef370f6f5fceac3a736e24bc10e0ac255d8f604b3
parentf47b62979f83da5d970d93b198527f48804e1048 (diff)
downloadmic-934f78cdb04411e578c796f4782fdcb3292b29c9.tar.gz
mic-934f78cdb04411e578c796f4782fdcb3292b29c9.tar.bz2
mic-934f78cdb04411e578c796f4782fdcb3292b29c9.zip
Add 'get_VcsInfo' function part to yumpkgmgr.py
Fixes: #2081 Change-Id: Id780d02d38cbfccf6d4bb6e9eb37d709db0dd336
-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):