Ejemplo n.º 1
0
def readDir(dir, list, rtags=None):
    """Append RpmPackage's for *.rpm in the subtree rooted at dir to list.

    Read only rtags if rtags is not None."""

    if not os.path.isdir(dir):
        return
    for f in os.listdir(dir):
        if os.path.isdir("%s/%s" % (dir, f)):
            readDir("%s/%s" % (dir, f), list)
        elif f.endswith(".rpm"):
            pkg = readRpmPackage(rpmconfig, dir+"/"+f, tags=rtags)
            if pkg == None:
                continue
            log.info3("Reading package %s.", pkg.getNEVRA())
            list.append(pkg)
Ejemplo n.º 2
0
def readDir(dir, list, rtags=None):
    """Append RpmPackage's for *.rpm in the subtree rooted at dir to list.

    Read only rtags if rtags is not None."""

    if not os.path.isdir(dir):
        return
    for f in os.listdir(dir):
        if os.path.isdir("%s/%s" % (dir, f)):
            readDir("%s/%s" % (dir, f), list)
        elif f.endswith(".rpm"):
            pkg = readRpmPackage(rpmconfig, dir + "/" + f, tags=rtags)
            if pkg == None:
                continue
            log.info3("Reading package %s.", pkg.getNEVRA())
            list.append(pkg)
Ejemplo n.º 3
0
    """Read RPM package from source and close it.

    tags, if defined, specifies tags to load.  Raise ValueError on invalid
    data, IOError."""

    pkg = package.RpmPackage(config, source, verify, hdronly, db)
    try:
        pkg.read(tags=tags)
        pkg.close()
    except (IOError, ValueError), e:
        log.error("%s: %s\n", pkg, e)
        return None
    if not config.ignorearch and \
       not archCompat(pkg["arch"], config.machine) and \
       not pkg.isSourceRPM():
        log.info3("%s: Package excluded because of arch "
                   "incompatibility", pkg.getNEVRA())
        return None
    return pkg

def readDir(dir, list, rtags=None):
    """Append RpmPackage's for *.rpm in the subtree rooted at dir to list.

    Read only rtags if rtags is not None."""

    if not os.path.isdir(dir):
        return
    for f in os.listdir(dir):
        if os.path.isdir("%s/%s" % (dir, f)):
            readDir("%s/%s" % (dir, f), list)
        elif f.endswith(".rpm"):
            pkg = readRpmPackage(rpmconfig, dir+"/"+f, tags=rtags)
Ejemplo n.º 4
0
    """Read RPM package from source and close it.

    tags, if defined, specifies tags to load.  Raise ValueError on invalid
    data, IOError."""

    pkg = package.RpmPackage(config, source, verify, hdronly, db)
    try:
        pkg.read(tags=tags)
        pkg.close()
    except (IOError, ValueError), e:
        log.error("%s: %s\n", pkg, e)
        return None
    if not config.ignorearch and \
       not archCompat(pkg["arch"], config.machine) and \
       not pkg.isSourceRPM():
        log.info3("%s: Package excluded because of arch "
                  "incompatibility", pkg.getNEVRA())
        return None
    return pkg


def readDir(dir, list, rtags=None):
    """Append RpmPackage's for *.rpm in the subtree rooted at dir to list.

    Read only rtags if rtags is not None."""

    if not os.path.isdir(dir):
        return
    for f in os.listdir(dir):
        if os.path.isdir("%s/%s" % (dir, f)):
            readDir("%s/%s" % (dir, f), list)
        elif f.endswith(".rpm"):