aboutsummaryrefslogtreecommitdiffstats
path: root/modules/buildsystem/templates/media.cfg
blob: bdd5d8138239c038d1eaab268695aecde335661d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<%-
def media_name(media, repo, type, archname)
    name = [ media.capitalize ]
    if archname != nil
	name += [ archname ]
    end
    for r in repo.split('_') do
	name += [ r.capitalize ]
    end
    if type != nil
	name += [ type.capitalize ]
    end
    return name.join(' ')
end

def media_out(name, media_hash)
    media_out = "[%s]\n" % name
    media_hash.keys.sort.each{|key|
	value = media_hash[key]
	if value != nil
	    media_out += "%s=%s\n" % [ key, value ]
	end
    }
    return media_out
end
distro = scope.lookupvar('buildsystem::var::distros::distros')[@distro_name]
-%>
[media_info]
version=<%= distro['version'] %>
mediacfg_version=2
branch=<%= distro['branch'] %>
arch=<%= @arch %>
xml-info=1

<%-
distro['medias'].keys.sort.each{|medianame|
    media = distro['medias'][medianame]
    media['repos'].keys.sort.each{|reponame|
	repo = media['repos'][reponame]
	media_types = []
	if media['media_types'] != nil
	    media_types += media['media_types']
	end
	if repo['media_types'] != nil
	    media_types += repo['media_types']
	end
	noauto=nil
	if (media['noauto'] == '1') or (repo['noauto'] == '1')
	    noauto='1'
	end
	updates_for = nil
	if repo['updates_for'] != nil
	    updates_for = [ medianame, repo['updates_for'] ].join('/')
	end
        -%><%=
	media_out [ medianame, reponame ].join('/'),
	    :hdlists => [ 'hdlist', medianame, reponame ].join('_') + '.cz',
	    :name => media_name(medianame, reponame, nil, nil),
	    :srpms => [ '../../SRPMS', medianame, reponame ].join('/'),
	    :media_types => media_types.join(':'),
	    :updates_for => updates_for,
	    :noauto => noauto

        %>
	<%-# debug -%>
	<%-
	debug_media_types = media_types + [ 'debug' ]
	-%><%=
	media_out [ 'debug', medianame, reponame ].join('/'),
	    :hdlists => [ 'hdlist_debug', medianame, reponame ].join('_') + '.cz',
	    :name => media_name(medianame, reponame, 'debug', nil),
	    :srpms => [ '../../SRPMS', medianame, reponame ].join('/'),
	    :media_types => debug_media_types.join(':'),
	    :noauto => '1'

	%>
	<%-# source -%>
	<%-
	source_media_types = media_types + [ 'source' ]
	-%><%=
	media_out [ '../../SRPMS', medianame, reponame ].join('/'),
	    :hdlists => [ 'hdlist', medianame, reponame ].join('_') + '.src.cz',
	    :name => media_name(medianame, reponame, 'sources', nil),
	    :rpms => [ medianame, reponame ].join('/'),
	    :media_types => source_media_types.join(':'),
	    :noauto => '1'

        %>
	<%-# we add 32bit media if arch is x86_64  -%>
	<%- 
	if @arch == 'x86_64' 
	    medianame32 = [ medianame, '32' ].join('')
	    -%><%=
	    media_out [ '../../i586/media', medianame, reponame ].join('/'),
		:hdlists => [ 'hdlist', medianame32, reponame ].join('_') + '.src.cz',
		:name => media_name(medianame, reponame, nil, '32bit'),
		:media_types => media_types.join(':'),
		:noauto => '1'

	  %>
	  <%-
	end
    }
}
if distro['based_on'] != nil
    distro['based_on'].keys.sort.each{|bdistroname|
	bdistro = distro['based_on'][bdistroname]
	bdistro.keys.sort.each{|medianame|
	    media = bdistro[medianame]
	    for reponame in media
		-%><%=
		media_out [ bdistroname, medianame, reponame ].join('/'),
		    :hdlists => [ 'hdlist', bdistroname, medianame,
			reponame ].join('_'),
		    :name =>  media_name([ medianame, bdistroname].join(''), reponame, nil, nil),
		    :media_types => 'base_distro',
		    :noauto => 1
		%>
		<%-
	    end
	}
    }
end
-%>