Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_pkg_urls(self, pkg, arch=None):
'''
Gets the urls for the packages specified in pkg
@type pkg: KojiPkgSpec
@param pkg: a package specification
@type arch: string
@param arch: packages built for this architecture, but also including
architecture independent (noarch) packages
'''
info = self.get_pkg_info(pkg)
rpms = self.get_pkg_rpm_info(pkg, arch)
rpm_urls = []
for rpm in rpms:
rpm_name = koji.pathinfo.rpm(rpm)
url = ("%s/%s/%s/%s/%s" % (self.config_options['pkgurl'],
info['package_name'],
info['version'], info['release'],
rpm_name))
rpm_urls.append(url)
return rpm_urls
'''
Gets the urls for the packages specified in pkg
:type pkg: KojiPkgSpec
:param pkg: a package specification
:type arch: string
:param arch: packages built for this architecture, but also including
architecture independent (noarch) packages
'''
info = self.get_pkg_info(pkg)
rpms = self.get_pkg_rpm_info(pkg, arch)
rpm_urls = []
base_url = self.get_pkg_base_url()
for rpm in rpms:
rpm_name = koji.pathinfo.rpm(rpm)
url = ("%s/%s/%s/%s/%s" % (base_url,
info['package_name'],
info['version'], info['release'],
rpm_name))
rpm_urls.append(url)
return rpm_urls
def get_pkg_rpm_file_names(self, pkg, arch=None):
"""
Gets the file names for the RPM packages specified in pkg
:type pkg: KojiPkgSpec
:param pkg: a package specification
:type arch: string
:param arch: packages built for this architecture, but also including
architecture independent (noarch) packages
"""
if arch is None:
arch = os.uname()[4]
rpm_names = []
rpms = self.get_pkg_rpm_info(pkg, arch)
for rpm in rpms:
arch_rpm_name = koji.pathinfo.rpm(rpm)
rpm_name = os.path.basename(arch_rpm_name)
rpm_names.append(rpm_name)
return rpm_names
def get_pkg_rpm_file_names(self, pkg, arch=None):
'''
Gets the file names for the RPM packages specified in pkg
:type pkg: KojiPkgSpec
:param pkg: a package specification
:type arch: string
:param arch: packages built for this architecture, but also including
architecture independent (noarch) packages
'''
if arch is None:
arch = utils.get_arch()
rpm_names = []
rpms = self.get_pkg_rpm_info(pkg, arch)
for rpm in rpms:
arch_rpm_name = koji.pathinfo.rpm(rpm)
rpm_name = os.path.basename(arch_rpm_name)
rpm_names.append(rpm_name)
return rpm_names
"""
Gets the urls for the packages specified in pkg
:type pkg: KojiPkgSpec
:param pkg: a package specification
:type arch: string
:param arch: packages built for this architecture, but also including
architecture independent (noarch) packages
"""
info = self.get_pkg_info(pkg)
rpms = self.get_pkg_rpm_info(pkg, arch)
rpm_urls = []
base_url = self.get_pkg_base_url()
for rpm in rpms:
rpm_name = koji.pathinfo.rpm(rpm)
url = ("%s/%s/%s/%s/%s" % (base_url,
info['package_name'],
info['version'], info['release'],
rpm_name))
rpm_urls.append(url)
return rpm_urls
def get_pkg_rpm_file_names(self, pkg, arch=None):
'''
Gets the file names for the RPM packages specified in pkg
@type pkg: KojiPkgSpec
@param pkg: a package specification
@type arch: string
@param arch: packages built for this architecture, but also including
architecture independent (noarch) packages
'''
if arch is None:
arch = utils.get_arch()
rpm_names = []
rpms = self.get_pkg_rpm_info(pkg, arch)
for rpm in rpms:
arch_rpm_name = koji.pathinfo.rpm(rpm)
rpm_name = os.path.basename(arch_rpm_name)
rpm_names.append(rpm_name)
return rpm_names
def rpm_path(self, rpminfo):
build = rpminfo['build']
return os.path.join(koji.pathinfo.build(build), koji.pathinfo.rpm(rpminfo))