diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-05-23 15:06:21 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-05-23 15:06:21 +0000 |
commit | 3c7f02d481edc662ee490525cff939074ff36b38 (patch) | |
tree | fb761385c60831790dd1201805acec54b74c2687 /modules/buildsystem/templates | |
parent | 54480006e000fc8cf0d44df2c0f48eb5909db77b (diff) | |
download | puppet-3c7f02d481edc662ee490525cff939074ff36b38.tar puppet-3c7f02d481edc662ee490525cff939074ff36b38.tar.gz puppet-3c7f02d481edc662ee490525cff939074ff36b38.tar.bz2 puppet-3c7f02d481edc662ee490525cff939074ff36b38.tar.xz puppet-3c7f02d481edc662ee490525cff939074ff36b38.zip |
buildsystem: add support for medias dependencies
In upload.conf template for ulri config use the dependencies between
medias defined in buildsystem::var::distros.
Diffstat (limited to 'modules/buildsystem/templates')
-rw-r--r-- | modules/buildsystem/templates/upload.conf | 83 |
1 files changed, 53 insertions, 30 deletions
diff --git a/modules/buildsystem/templates/upload.conf b/modules/buildsystem/templates/upload.conf index 61b72d7f..a5c7ed8d 100644 --- a/modules/buildsystem/templates/upload.conf +++ b/modules/buildsystem/templates/upload.conf @@ -35,36 +35,59 @@ my $homedir = "<%= scope.lookupvar('buildsystem::var::iurt::homedir') %>"; } keys %nodes), }, media => { - default => { - "infra/release" => [ "infra/release", "base/core/updates", "base/core/release" ], - "core/release" => [ "core/updates", "core/release" ], - "core/updates" => [ "core/updates", "core/release" ], - "core/updates_testing" => [ "core/updates_testing", "core/updates", "core/release" ], - "core/backports" => [ "core/backports", "core/updates_testing", "core/updates", "core/release" ], - "core/backports_testing" => [ "core/backports_testing", "core/backports", "core/updates_testing", "core/updates", "core/release" ], - "nonfree/release" => [ "core/release", "nonfree/release" ], - "nonfree/updates" => [ "core/updates", "core/release", "nonfree/release", "nonfree/updates" ], - "nonfree/updates_testing" => [ "core/updates", "core/release", "core/updates_testing", "nonfree/release", "nonfree/updates", "nonfree/updates_testing" ], - "nonfree/backports" => [ "core/backports", "core/updates_testing", "core/updates", "core/release", - "nonfree/release", "nonfree/updates", "nonfree/updates_testing", "nonfree/backports" ], - "nonfree/backports_testing" => [ "core/backports_testing", "core/backports", "core/updates_testing", "core/updates", "core/release", - "nonfree/release", "nonfree/updates", "nonfree/updates_testing", "nonfree/backports", "nonfree/backports_testing" ], - "tainted/release" => [ "core/release", "nonfree/release", "tainted/release" ], - "tainted/updates" => [ "core/release", "nonfree/release", "tainted/release", - "core/updates", "nonfree/updates", "tainted/updates" ], - "tainted/updates_testing" => [ "core/release", "nonfree/release", "tainted/release", - "core/updates", "nonfree/updates", "tainted/updates", - "core/updates_testing", "nonfree/updates_testing", "tainted/updates_testing" ], - "tainted/backports" => [ "core/release", "nonfree/release", "tainted/release", - "core/updates", "nonfree/updates", "tainted/updates", - "core/updates_testing", "nonfree/updates_testing", "tainted/updates_testing", - "core/backports", "nonfree/backports", "tainted/backports" ], - "tainted/backports_testing" => [ "core/release", "nonfree/release", "tainted/release", - "core/updates", "nonfree/updates", "tainted/updates", - "core/updates_testing", "nonfree/updates_testing", "tainted/updates_testing", - "core/backports", "nonfree/backports", "tainted/backports", - "core/backports_testing", "nonfree/backports_testing", "tainted/backports_testing" ], - }, + <%- + def repo_deps(distros, dname, mname, rname) + deps = {} + distro = distros[dname] + if distro['based_on'] != nil + distro['based_on'].each{|bdistro, bmedias| + if bmedias[mname] != nil and \ + bmedias[mname].include?(rname) then + deps[ [ bdistro, mname, rname ].join('/') ] = 1 + end + } + end + if distro['medias'][mname] != nil \ + and distro['medias'][mname]['repos'][rname] != nil + then + deps[ [ mname, rname ].join('/') ] = 1 + else + return deps + end + mlist = distro['medias'][mname]['requires'] + mlist = mlist == nil ? [ mname ] : [ mname ] + mlist + mlist.each{|mreq| + rlist = distro['medias'][mname]['repos'][rname]['requires'] + rlist = [] if rlist == nil + rlist += [ rname ] if mreq != mname + rlist.each{|rreq| + deps.merge!(repo_deps(distros, dname, mreq, rreq)) + } + } + return deps + end + distros = scope.lookupvar('buildsystem::var::distros::distros') + distros.keys.sort.each{|distroname| + -%> + '<%= distroname -%>' => { + <%- + distro = distros[distroname] + distro['medias'].keys.sort.each{|medianame| + media = distro['medias'][medianame] + media['repos'].keys.sort.each{|reponame| + deps = repo_deps(distros, distroname, medianame, reponame) + -%> + "<%= [ medianame, reponame ].join('/') %>" => [ "<%= + deps.keys.sort.join('", "') + %>" ], + <%- + } + } + -%> + }, + <%- + } + -%> }, admin => 'mageia-sysadm@mageia.org', http_queue => 'http://<%= scope.lookupvar('buildsystem::var::webstatus::hostname') %>/uploads', |