FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 01-04-2012, 08:42 PM
"Brian C. Lane"
 
Default lorax: Add option to exclude packages

From: "Brian C. Lane" <bcl@redhat.com>

Sometimes the repos you are using have broken deps. Now you
can exclude packages with -e or --excludepkgs
---
src/sbin/lorax | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/sbin/lorax b/src/sbin/lorax
index 328827e..be7160c 100755
--- a/src/sbin/lorax
+++ b/src/sbin/lorax
@@ -67,6 +67,9 @@ def main(args):
help="config file", metavar="STRING")
optional.add_option("--proxy", default=None,
help="repo proxy urlort", metavar="STRING")
+ optional.add_option("-e", "--excludepkgs", default=[],
+ action="append", metavar="STRING",
+ help="package glob to exclude (may be listed multiple times)")

# add the option groups to the parser
parser.add_option_group(required)
@@ -106,7 +109,7 @@ def main(args):
os.mkdir(yumtempdir)

yb = get_yum_base_object(installtree, opts.source, opts.mirrorlist,
- yumtempdir, opts.proxy)
+ yumtempdir, opts.proxy, opts.excludepkgs)

if yb is None:
print("error: unable to create the yumbase object", file=sys.stderr)
@@ -122,7 +125,7 @@ def main(args):


def get_yum_base_object(installroot, repositories, mirrorlists=[],
- tempdir="/tmp", proxy=None):
+ tempdir="/tmp", proxy=None, excludepkgs=[]):

def sanitize_repo(repo):
if repo.startswith("/"):
@@ -160,6 +163,9 @@ def get_yum_base_object(installroot, repositories, mirrorlists=[],
if proxy:
data["proxy"] = proxy

+ if excludepkgs:
+ data["exclude"] = " ".join(excludepkgs)
+
c.add_section(section)
map(lambda (key, value): c.set(section, key, value), data.items())

--
1.7.6.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-05-2012, 06:47 AM
Martin Gracik
 
Default lorax: Add option to exclude packages

ack

----- Original Message -----
> From: "Brian C. Lane" <bcl@redhat.com>
>
> Sometimes the repos you are using have broken deps. Now you
> can exclude packages with -e or --excludepkgs
> ---
> src/sbin/lorax | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/src/sbin/lorax b/src/sbin/lorax
> index 328827e..be7160c 100755
> --- a/src/sbin/lorax
> +++ b/src/sbin/lorax
> @@ -67,6 +67,9 @@ def main(args):
> help="config file", metavar="STRING")
> optional.add_option("--proxy", default=None,
> help="repo proxy urlort", metavar="STRING")
> + optional.add_option("-e", "--excludepkgs", default=[],
> + action="append", metavar="STRING",
> + help="package glob to exclude (may be listed multiple
> times)")
>
> # add the option groups to the parser
> parser.add_option_group(required)
> @@ -106,7 +109,7 @@ def main(args):
> os.mkdir(yumtempdir)
>
> yb = get_yum_base_object(installtree, opts.source,
> opts.mirrorlist,
> - yumtempdir, opts.proxy)
> + yumtempdir, opts.proxy,
> opts.excludepkgs)
>
> if yb is None:
> print("error: unable to create the yumbase object",
> file=sys.stderr)
> @@ -122,7 +125,7 @@ def main(args):
>
>
> def get_yum_base_object(installroot, repositories, mirrorlists=[],
> - tempdir="/tmp", proxy=None):
> + tempdir="/tmp", proxy=None, excludepkgs=[]):
>
> def sanitize_repo(repo):
> if repo.startswith("/"):
> @@ -160,6 +163,9 @@ def get_yum_base_object(installroot,
> repositories, mirrorlists=[],
> if proxy:
> data["proxy"] = proxy
>
> + if excludepkgs:
> + data["exclude"] = " ".join(excludepkgs)
> +
> c.add_section(section)
> map(lambda (key, value): c.set(section, key, value),
> data.items())
>
> --
> 1.7.6.4
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list
>

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 12:05 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org