Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora Build System (http://www.linux-archive.org/fedora-build-system/)
-   -   Add an option for only pulling the best provider (http://www.linux-archive.org/fedora-build-system/487751-add-option-only-pulling-best-provider.html)

Bill Nottingham 02-10-2011 07:32 PM

Add an option for only pulling the best provider
 
This is so it doesn't pull 200 fonts for "font(:lang=en)", or all the MTAs.

Can easily change option name, etc. if necessary.

Bill
commit b4e40a079e918d95d3e59553375b945661b911df
Author: Bill Nottingham <notting@redhat.com>
Date: Thu Feb 10 15:30:02 2011 -0500

Add an option to allow only grabbing the best provides for a particular depenedency, instead of all.

diff --git a/src/bin/pungi.py b/src/bin/pungi.py
index 3e88ef8..7fa119d 100755
--- a/src/bin/pungi.py
+++ b/src/bin/pungi.py
@@ -77,6 +77,8 @@ def main():
# Set debuginfo flag
if opts.nodebuginfo:
config.set('pungi', 'debuginfo', "False")
+ if opts.nogreedy:
+ config.set('pungi', 'alldeps', "False")

# Actually do work.
mypungi = pypungi.Pungi(config, ksparser)
@@ -178,6 +180,8 @@ if __name__ == '__main__':
help='disable gathering of source packages (optional)')
parser.add_option("--nodebuginfo", action="store_true", dest="nodebuginfo",
help='disable gathering of debuginfo packages (optional)')
+ parser.add_option("--nogreedy", action="store_true", dest="nogreedy",
+ help='disable pulling of all providers of package dependencies (optional)')
parser.add_option("--sourceisos", default=False, action="store_true", dest="sourceisos",
help='Create the source isos (other arch runs must be done)')
parser.add_option("--force", default=False, action="store_true",
diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py
index 2a778c2..506c848 100644
--- a/src/pypungi/__init__.py
+++ b/src/pypungi/__init__.py
@@ -285,6 +285,9 @@ class Pungi(pypungi.PungiBase):
self.logger.warn("Unresolvable dependency %s in %s.%s" % (r, po.name, po.arch))
continue

+ if not self.config.getboolean('pungi', 'alldeps'):
+ deps = self.ayum.bestPackagesFromList(deps)
+
depsack = yum.packageSack.ListPackageSack(deps)

for dep in depsack.returnNewestByNameArch():
diff --git a/src/pypungi/config.py b/src/pypungi/config.py
index 848a2d4..c8eb10d 100644
--- a/src/pypungi/config.py
+++ b/src/pypungi/config.py
@@ -42,4 +42,5 @@ class Config(SafeConfigParser):
self.set('pungi', 'bugurl', 'https://bugzilla.redhat.com')
self.set('pungi', 'cdsize', '695.0')
self.set('pungi', 'debuginfo', "True")
+ self.set('pungi', 'alldeps', "True")

--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys

Jon Stanley 02-10-2011 07:59 PM

Add an option for only pulling the best provider
 
On Thu, Feb 10, 2011 at 3:32 PM, Bill Nottingham <notting@redhat.com> wrote:
>
> This is so it doesn't pull 200 fonts for "font(:lang=en)", or all the MTAs.
>
> Can easily change option name, etc. if necessary.

I'm partial to this option name. Very fitting :)
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys

Jesse Keating 02-14-2011 05:23 PM

Add an option for only pulling the best provider
 
On 2/10/11 12:32 PM, Bill Nottingham wrote:
> This is so it doesn't pull 200 fonts for "font(:lang=en)", or all the MTAs.
>
> Can easily change option name, etc. if necessary.

Seems fine to me. I'll apply.

--
Jesse Keating RHCE (http://jkeating.livejournal.com)
Fedora Project (http://fedoraproject.org/wiki/JesseKeating)
GPG Public Key (geek.j2solutions.net/jkeating.j2solutions.pub)
identi.ca (http://identi.ca/jkeating)
--
buildsys mailing list
buildsys@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/buildsys


All times are GMT. The time now is 06:48 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.