예제 #1
0
 def __load_pkg(self, name, tmpdir=tempfile.gettempdir()):
     try:
         if os.path.isfile(name):
             return Pkg.Pkg(name, tmpdir)
     except TypeError:
         pass
     inst = Pkg.getInstalledPkgs(name)
     if not inst:
         raise KeyError("No installed packages by name %s" % name)
     if len(inst) > 1:
         raise KeyError("More than one installed packages by name %s" %
                        name)
     return inst[0]
예제 #2
0
파일: Testing.py 프로젝트: pvalena/rpmlint
def getTestedPackage(name):
    pkg_path = glob.glob(os.environ['TESTPATH'] + '/' + name + '-*.rpm')[0]
    return Pkg.Pkg(pkg_path, tempfile.gettempdir())
예제 #3
0
파일: Testing.py 프로젝트: pemensik/rpmlint
def getTestedPackage(name):
    pkg_path = glob.glob(os.path.join(_testpath(), name) + "-*.rpm")[0]
    return Pkg.Pkg(pkg_path, tempfile.gettempdir())