diff options
author | lihongsx <lihongx.sun@intel.com> | 2014-08-26 14:54:17 +0800 |
---|---|---|
committer | lihongsx <lihongx.sun@intel.com> | 2014-08-28 11:33:15 +0800 |
commit | f805814aaa356c5bb935c6f283924e980ef19fbd (patch) | |
tree | afcea352c96f6319302b6a1d79790f03206aa265 /plugins/backend | |
parent | 292227931f2bd4079b4f913165dc101dd68e2d64 (diff) | |
download | mic-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.py | 17 |
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): |