Ejemplo n.º 1
0
def create_package(header, size, checksum_type, checksum, relpath, org_id, header_start=None,
                   header_end=None, channels=[]):
    if header.packaging == 'rpm':
        return headerSource.createPackage(header, size=size,
                                          checksum_type=checksum_type, checksum=checksum,
                                          relpath=relpath, org_id=org_id, header_start=header_start,
                                          header_end=header_end, channels=channels)
    if header.packaging == 'deb':
        return debPackage.debBinaryPackage(header, size=size, checksum_type=checksum_type, checksum=checksum, path=relpath,
                                           org_id=org_id, channels=channels)
    if header.is_source:
        raise NotImplementedError()
    p = mpmBinaryPackage()
    p.populate(header, size=size, checksum_type=checksum_type, checksum=checksum, path=relpath,
               org_id=org_id, channels=channels)
    return p
Ejemplo n.º 2
0
def create_package(header, size, checksum_type, checksum, relpath, org_id, header_start=None,
    header_end=None, channels=[]):
    if header.packaging == 'rpm':
        return headerSource.createPackage(header, size=size,
            checksum_type=checksum_type, checksum=checksum,
            relpath=relpath, org_id=org_id, header_start=header_start,
            header_end=header_end, channels=channels)
    if header.packaging == 'deb':
        return debPackage.debBinaryPackage(header, size=size, checksum_type=checksum_type, checksum=checksum, path=relpath,
            org_id=org_id, channels=channels)
    if header.is_source:
        raise NotImplementedError()
    p = mpmBinaryPackage()
    p.populate(header, size=size, checksum_type=checksum_type, checksum=checksum, path=relpath,
        org_id=org_id, channels=channels)
    return p