Hi,
Here are two small patch for the releng repo.
The first one is just some cosmetic changes to the critpath.py script, the second is more interesting as it reduces the number of calls made by the update-critpath script since the pkgdb2 API is able to handles a query about multiple packages at once. This should speed up the update-critpath script quite a bit.
Thanks, Pierre
--- scripts/critpath.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/scripts/critpath.py b/scripts/critpath.py index 21ea8e5..5f36890 100755 --- a/scripts/critpath.py +++ b/scripts/critpath.py @@ -1,7 +1,7 @@ #!/usr/bin/python -tt # # Copyright (C) 2013 Red Hat Inc, -# SPDX-License-Identifier: GPL-2.0+ +# SPDX-License-Identifier: GPL-2.0+ # # Authors: Will Woods wwoods@redhat.com # Seth Vidal skvidal@fedoraproject.org @@ -16,7 +16,11 @@ from rpmUtils.arch import getBaseArch # Set some constants # Old definition #critpath_groups = ['@core','@critical-path-base','@critical-path-gnome'] -critpath_groups = ['@core', '@critical-path-apps', '@critical-path-base', '@critical-path-gnome', '@critical-path-kde', '@critical-path-lxde', '@critical-path-xfce' ] +critpath_groups = [ + '@core', '@critical-path-apps', '@critical-path-base', + '@critical-path-gnome', '@critical-path-kde', '@critical-path-lxde', + '@critical-path-xfce' +] base_arches = ('armhfp', 'i386', 'x86_64') known_arches = base_arches + ('armv7hl','i586','i686') fedora_baseurl = 'http://dl.fedoraproject.org/pub/fedora/linux/' @@ -63,7 +67,7 @@ def resolve_deps(pkg, base): for prov in po.provides: provides_cache[prov] = po.name
- return deps + return deps
def expand_critpath(my, start_list): name_list = [] @@ -165,7 +169,7 @@ if __name__ == '__main__': if opt.url != fedora_baseurl: releasepath[release] = releasepath[release].replace('development/','') print "Using URL %s" % (opt.url + releasepath[release]) - + # Do the critpath expansion for each arch critpath = set() for arch in check_arches: @@ -183,7 +187,7 @@ if __name__ == '__main__': if cachedir.startswith("/tmp/"): shutil.rmtree(cachedir) print - # Write full list + # Write full list f = open(opt.output,"w") for packagename in sorted(critpath): f.write(packagename + "\n")
The pkgdb2 API is able to handle queries submitting multiple packages at once, so there is no need to make a query for each package separately.
In addition this commit makes sure there are packages to change before trying to do the change and will print a message if there are no packages to change. --- scripts/update-critpath | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/scripts/update-critpath b/scripts/update-critpath index 41d576b..6801845 100644 --- a/scripts/update-critpath +++ b/scripts/update-critpath @@ -127,20 +127,24 @@ def update_critpath(current_critpath, new_critpath, branch): # Remove the critpath flag to the package that should not have it
new_no = current_critpath - new_critpath - for pkg in new_no: + if new_no: try: - pkgdbclient.update_critpath(pkg, branch, False) + pkgdbclient.update_critpath(new_no, branch, False) except PkgDBException, err: LOG.debug('PkgDBException') - print '{0}: {1}'.format(pkg, err) + print '{0}'.format(err) + else: + print 'No packages to which the critpath flag should be removed'
new_yes = new_critpath - current_critpath - for pkg in new_yes: + if new_yes: try: - pkgdbclient.update_critpath(pkg, branch, True) + pkgdbclient.update_critpath(new_yes, branch, True) except PkgDBException, err: LOG.debug('PkgDBException') - print '{0}: {1}'.format(pkg, err) + print '{0}'.format(err) + else: + print 'No packages to which the critpath flag should be added'
def main():
On Thu, Aug 21, 2014 at 10:12:44AM +0200, Pierre-Yves Chibon wrote:
Hi,
Here are two small patch for the releng repo.
The first one is just some cosmetic changes to the critpath.py script, the second is more interesting as it reduces the number of calls made by the update-critpath script since the pkgdb2 API is able to handles a query about multiple packages at once. This should speed up the update-critpath script quite a bit.
Ping ?
Looks like these two patches are still pending review/approval/denial :)
Thanks, Pierre
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 21 Aug 2014 10:12:44 +0200 Pierre-Yves Chibon pingou@pingoured.fr wrote:
Hi,
Here are two small patch for the releng repo.
The first one is just some cosmetic changes to the critpath.py script, the second is more interesting as it reduces the number of calls made by the update-critpath script since the pkgdb2 API is able to handles a query about multiple packages at once. This should speed up the update-critpath script quite a bit.
applied thanks
Dennis
rel-eng@lists.fedoraproject.org