diff options
-rw-r--r-- | examples/olpc-os-10.1.0-xo1.5.ini | 2 | ||||
-rw-r--r-- | lib/ooblib.py | 28 | ||||
-rw-r--r-- | modules/olpc_frozen_repos/README | 14 | ||||
-rw-r--r-- | modules/olpc_frozen_repos/ksmain.50.repos.sh | 12 | ||||
-rw-r--r-- | modules/yumcfg/kspost.50.yumcfg.py | 14 |
5 files changed, 35 insertions, 35 deletions
diff --git a/examples/olpc-os-10.1.0-xo1.5.ini b/examples/olpc-os-10.1.0-xo1.5.ini index 2a3638e..9129635 100644 --- a/examples/olpc-os-10.1.0-xo1.5.ini +++ b/examples/olpc-os-10.1.0-xo1.5.ini @@ -29,6 +29,8 @@ mocktags= koji.dist-f11-updates, local.10.1, local.10.1-xo1.5 +build_excludes_from=local.10.1,local.10.1-xo1.5 +add_excludes_to=koji.dist-f11,koji.dist-f11-updates [yumcfg] addrepo_1=0,olpc-fedora-updates,http://mock.laptop.org/repos/koji.dist-f11-updates diff --git a/lib/ooblib.py b/lib/ooblib.py index c9925f3..076f371 100644 --- a/lib/ooblib.py +++ b/lib/ooblib.py @@ -2,6 +2,16 @@ # Licensed under the terms of the GNU GPL v2 or later; see COPYING for details. import os +from xml.etree.ElementTree import ElementTree + +libdir = os.environ['OOB__libdir'] +bindir = os.environ['OOB__bindir'] +builddir = os.environ['OOB__builddir'] +cachedir = os.environ['OOB__cachedir'] +intermediatesdir = os.environ['OOB__intermediatesdir'] +outputdir = os.environ['OOB__outputdir'] +statedir = os.environ['OOB__statedir'] +fsmount = os.environ['OOB__fsmount'] def read_config(module, option): vname = "CFG_%s__%s" % (module, option) @@ -15,12 +25,14 @@ def read_config_bool(module, option): return None return bool(int(os.environ[vname])) -libdir = os.environ['OOB__libdir'] -bindir = os.environ['OOB__bindir'] -builddir = os.environ['OOB__builddir'] -cachedir = os.environ['OOB__cachedir'] -intermediatesdir = os.environ['OOB__intermediatesdir'] -outputdir = os.environ['OOB__outputdir'] -statedir = os.environ['OOB__statedir'] -fsmount = os.environ['OOB__fsmount'] +def add_packages_from_xml(fd, pkglist): + et = ElementTree(file=fd) + root = et.getroot() + for i in root.getchildren(): + if not i.tag.endswith("}package"): + continue + for child in i.getchildren(): + if not child.tag.endswith("}name"): + continue + pkglist.add(child.text) diff --git a/modules/olpc_frozen_repos/README b/modules/olpc_frozen_repos/README index 03813f0..eb53ae7 100644 --- a/modules/olpc_frozen_repos/README +++ b/modules/olpc_frozen_repos/README @@ -5,8 +5,15 @@ Like the 'fedora' module, the resultant yum configuration on the system is unmodified. This only affects build time. Use the yumcfg module to modify the resultant system configuration if desired. -Configuration: a single 'mocktags' option, which is a comma-separated list of -git tags from the 'repos' repo which should each be used as repositories. +Configuration: + +The 'mocktags' option, a comma-separated list of git tags from the 'repos' +repo which should each be used as repositories. + +You can optionally mark a repository as contributing to a package excludes +list, and then apply that excludes list to certain repositories that you have +already listed in mocktags. + Example: @@ -16,3 +23,6 @@ mocktags= koji.dist-f11-updates, local.10.1, local.10.1-xo1.5 +build_excludes_from=local.10.1,local.10.1-xo1.5 +add_excludes_to=koji.dist-f11,koji.dist-f11-updates + diff --git a/modules/olpc_frozen_repos/ksmain.50.repos.sh b/modules/olpc_frozen_repos/ksmain.50.repos.sh deleted file mode 100644 index 3e18c0b..0000000 --- a/modules/olpc_frozen_repos/ksmain.50.repos.sh +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright (C) 2009 One Laptop Per Child -# Licensed under the terms of the GNU GPL v2 or later; see COPYING for details. - -. $OOB__shlib - -tags=$(read_config olpc_frozen_repos mocktags) -IFS=$'\n\t, ' -for tag in $tags; do - echo "repo --name=$tag --baseurl=http://mock.laptop.org/repos/$tag" -done -IFS=$oIFS - diff --git a/modules/yumcfg/kspost.50.yumcfg.py b/modules/yumcfg/kspost.50.yumcfg.py index b5a0cce..dc16716 100644 --- a/modules/yumcfg/kspost.50.yumcfg.py +++ b/modules/yumcfg/kspost.50.yumcfg.py @@ -6,24 +6,12 @@ import sys import urllib2 from gzip import GzipFile from StringIO import StringIO -from xml.etree.ElementTree import ElementTree import ooblib addrepos = [] excludes = set() -def add_excludes_from_xml(fd): - et = ElementTree(file=fd) - root = et.getroot() - for i in root.getchildren(): - if not i.tag.endswith("}package"): - continue - for child in i.getchildren(): - if not child.tag.endswith("}name"): - continue - excludes.add(child.text) - # read in repos for var in os.environ: if not var.startswith("CFG_yumcfg__addrepo"): @@ -41,7 +29,7 @@ for for_excludes, name, url in addrepos: data = fd.read() fd.close() fd = GzipFile(fileobj=StringIO(data)) - add_excludes_from_xml(fd) + ooblib.add_packages_from_xml(fd, excludes) # write shell code to generate yum repo files for for_excludes, name, url in addrepos: |