aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-05-23 15:06:21 +0000
committerNicolas Vigier <boklm@mageia.org>2013-05-23 15:06:21 +0000
commit3c7f02d481edc662ee490525cff939074ff36b38 (patch)
treefb761385c60831790dd1201805acec54b74c2687 /modules/buildsystem
parent54480006e000fc8cf0d44df2c0f48eb5909db77b (diff)
downloadpuppet-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')
-rw-r--r--modules/buildsystem/manifests/var/distros.pp16
-rw-r--r--modules/buildsystem/templates/upload.conf83
2 files changed, 69 insertions, 30 deletions
diff --git a/modules/buildsystem/manifests/var/distros.pp b/modules/buildsystem/manifests/var/distros.pp
index ae00810a..7aed19ac 100644
--- a/modules/buildsystem/manifests/var/distros.pp
+++ b/modules/buildsystem/manifests/var/distros.pp
@@ -18,6 +18,13 @@
# 'media_types' => [ 'release' ],
# 'noauto' => '1',
# },
+# # the 'updates' repo
+# 'release' => {
+# 'media_types' => [ 'updates' ],
+# 'noauto' => '1',
+# # the 'updates' repo requires the 'release' repo
+# 'requires' => [ 'release' ],
+# },
# },
# # media_types for media.cfg
# 'media_types' => [ 'official', 'free' ],
@@ -25,6 +32,15 @@
# # the option will be added to media.cfg
# 'noauto' => '1',
# },
+# # the 'non-free' media
+# 'non-free' => {
+# 'repos' => {
+# ...
+# },
+# 'media_types' => [ 'official', 'non-free' ],
+# # the 'non-free' media requires the 'core' media
+# 'requires' => [ 'core' ],
+# }
# },
# # the list of media used by iurt to build the chroots
# 'base_medias' => [ 'core/release' ],
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',