aboutsummaryrefslogtreecommitdiff
blob: c328b37519123a671e7c6a75b1ae212272b99d98 (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#!/bin/bash

# Make sure that all systems have the same sort order and date format
export LC_ALL=C

# change directory to script location
cd "$(dirname $0)"

SCRIPT=$(basename $0)
HEADER="# Autogenerated by ${SCRIPT}, DO NOT EDIT."

KF5_RELEASES="5.116"
KF5_RELEASE=${KF5_RELEASE:-5.116}

KF6_RELEASES="6.5 6.6"
KF6_RELEASE=${KF6_RELEASE:-6.5}

PLASMA_RELEASES="5.27 6.1"
PLASMA_RELEASE=${PLASMA_RELEASE:-6.1}

GEAR_RELEASES="24.05 24.08"
GEAR_RELEASE=${GEAR_RELEASE:-24.05}

# regenerate keywords
pushd ../package.accept_keywords/ > /dev/null
for release in $KF5_RELEASES; do
	if [[ -d ".kde-frameworks-5-${release}" ]]; then
		echo -e "${HEADER}" > "kde-frameworks-${release}.keywords"
		cat ".kde-frameworks-5-${release}/"* | grep -P -v '^>=kde-frameworks/(?!kf-env)' | \
			sed -e '/^~.*[.-]5\.9999$/s/$/ **/' -e '/^@/d' >> "kde-frameworks-${release}.keywords"
	fi
done

if [[ -n ${KF6_RELEASES} ]]; then
	for release in $KF6_RELEASES; do
		if [[ -d ".kde-frameworks-${release}" ]]; then
			echo -e "${HEADER}" > "kde-frameworks-${release}.keywords"
			cat ".kde-frameworks-${release}/"* | grep -P -v '^>=kde-frameworks/(?!kf-env)' | \
				sed -e '/^~.*[.-]9999\:[0-9]*$/s/$/ **/' -e '/^@/d' >> "kde-frameworks-${release}.keywords"
		fi
	done
fi

for release in $PLASMA_RELEASES; do
	echo -e "${HEADER}" > "kde-plasma-${release}.keywords"
	if [[ -d ".kde-plasma-${release}" ]]; then
		cat ".kde-plasma-${release}/"* | sed '/^~.*[.-]9999$/s/$/ **/' >> "kde-plasma-${release}.keywords"
	fi
done

for release in $GEAR_RELEASES; do
	echo -e "${HEADER}" > "kde-gear-${release}.keywords"
	if [[ -d ".kde-gear-${release}" ]]; then
		cat ".kde-gear-${release}/"* | \
			sed -e '/^~.*[.-]9999$/s/$/ **/' -e '/^@/d' >> "kde-gear-${release}.keywords"
	fi
done

# ... and for completely unkeyworded packages, add "**"
for release in $GEAR_RELEASES; do
	if [[ -d ".kde-gear-${release}" ]]; then
		rm -rf ".kde-gear-${release}.49.9999"
		mkdir -p ".kde-gear-${release}.49.9999"
		echo -e "${HEADER}" > "kde-gear-${release}.49.9999.keywords"
		for file in ".kde-gear-${release}"/*; do
			newfile=".kde-gear-${release}.49.9999"/$(basename "${file}")
			sed -e "/^<[a-z0-9-]*\/.*\.50$/{s/\.50/.49.9999/;s/^</~/};/^~.*[.-]9999$/s/$/ **/" \
				-e "/^@/d" "${file}" > "${newfile}"
			# echo "${newfile}"
		done
		cat ".kde-gear-${release}.49.9999"/* >> "kde-gear-${release}.49.9999.keywords"
	fi
done

if [[ -d .kde-frameworks-live.base ]]; then
	rm -rf .kde-frameworks-live
	mkdir -p .kde-frameworks-live
	echo -e "${HEADER}" > kde-frameworks-live.keywords
	for file in .kde-frameworks-live.base/*; do
		newfile=.kde-frameworks-live/$(basename "${file}")
		sed -e '/^~.*[.-]9999\:[0-9]*$/s/$/ **/'  -e '/^@/d' "${file}" > "${newfile}"
	done
	cat .kde-frameworks-live/* >> kde-frameworks-live.keywords
fi

if [[ -d .kde-plasma-live.base ]]; then
	rm -rf .kde-plasma-live
	mkdir -p .kde-plasma-live
	echo -e "${HEADER}" > kde-plasma-live.keywords
	for file in .kde-plasma-live.base/*; do
		newfile=.kde-plasma-live/$(basename "${file}")
		sed '/^~.*[.-]9999$/s/$/ **/' "${file}" > "${newfile}"
	done
	cat .kde-plasma-live/* >> kde-plasma-live.keywords
fi

if [[ -d .kde-gear-live.base ]]; then
	rm -rf .kde-gear-live
	mkdir -p .kde-gear-live
	echo -e "${HEADER}" > kde-gear-live.keywords
	for file in .kde-gear-live.base/*; do
		newfile=.kde-gear-live/$(basename "${file}")
		sed -e '/^~.*[.-]9999$/s/$/ **/' -e '/^@/d' "${file}" > "${newfile}"
	done
	cat .kde-gear-live/* >> kde-gear-live.keywords
fi
popd > /dev/null

# regenerate unmask entries (base for package mask)
pushd ../package.unmask/ > /dev/null
for release in $KF5_RELEASES; do
	if [[ -d ".kde-frameworks-5-${release}" ]]; then
		echo -e "${HEADER}" > "kde-frameworks-${release}"
		cat ".kde-frameworks-5-${release}/"* | \
			grep -P -v '^>=kde-frameworks/(?!kf-env)' >> "kde-frameworks-${release}"
		sed -i "kde-frameworks-${release}" -e "/^@/d"
	fi
done

for release in $KF6_RELEASES live; do
	if [[ -d ".kde-frameworks-${release}" ]]; then
		echo -e "${HEADER}" > "kde-frameworks-${release}"
		cat ".kde-frameworks-${release}/"* | \
			grep -P -v '^>=kde-frameworks/(?!kf-env)' >> "kde-frameworks-${release}"
		sed -i "kde-frameworks-${release}" -e "/^@/d"
	fi
done

for release in $PLASMA_RELEASES live; do
	echo -e "${HEADER}" > "kde-plasma-${release}"
	if [[ -d ".kde-plasma-${release}" ]]; then
		cat ".kde-plasma-${release}/"* >> "kde-plasma-${release}"
	fi
done

for release in $GEAR_RELEASES live; do
	echo -e "${HEADER}" > "kde-gear-${release}"
	if [[ -d ".kde-gear-${release}" ]]; then
		cat ".kde-gear-${release}/"* >> "kde-gear-${release}"
		sed -i "kde-gear-${release}" -e "/^@/d"
	fi
done
popd > /dev/null

# regenerate mask entries (base for package mask)
pushd ../package.mask/ > /dev/null
for release in $KF5_RELEASES; do
	if [[ -d "../package.unmask/.kde-frameworks-5-${release}" ]]; then
		echo -e "${HEADER}" > "kde-frameworks-${release}"
		cat "../package.unmask/.kde-frameworks-5-${release}/"* | \
			grep -P -v '^>=kde-frameworks/(?!kf-env)' >> "kde-frameworks-${release}"
		sed -i "kde-frameworks-${release}" \
			-e "/^<kde-frameworks\/.*-5\..\.50:5$/{s/-5\..\.50/-${release}/;s/^</>=/}" -e '/^@/d'
	fi
done

for release in $KF6_RELEASES live; do
	if [[ -d "../package.unmask/.kde-frameworks-${release}" ]]; then
		echo -e "${HEADER}" > "kde-frameworks-${release}"
		cat "../package.unmask/.kde-frameworks-${release}/"* | \
			grep -P -v '^>=kde-frameworks/(?!kf-env)' >> "kde-frameworks-${release}"
		sed -i "kde-frameworks-${release}" \
			-e "/^<kde-frameworks\/.*-6\..\.50:6$/{s/-6\..\.50/-${release}/;s/^</>=/}" -e '/^@/d'
	fi
done

for release in $PLASMA_RELEASES live; do
	echo -e "${HEADER}" > "kde-plasma-${release}"
	if [[ -d "../package.unmask/.kde-plasma-${release}" ]]; then
		cat "../package.unmask/.kde-plasma-${release}/"* >> "kde-plasma-${release}"
		sed -i "kde-plasma-${release}" \
			-e "/^<kde-plasma\/.*-5\..\.50:5$/{s/-5\..\.50/-${release}/;s/^</>=/}"
	fi
done

for release in $GEAR_RELEASES live; do
	echo -e "${HEADER}" > "kde-gear-${release}"
	if [[ -d "../package.unmask/.kde-gear-${release}" ]]; then
		cat "../package.unmask/.kde-gear-${release}/"* >> "kde-gear-${release}"
		sed -i "kde-gear-${release}" \
			-e "/^<kde-gear\/.*-14\..\.50:5$/{s/-14\..\.50/-${release}/;s/^</>=/}" -e '/^@/d'
	fi
done
popd > /dev/null

# regenerate unversioned sets
pushd ../../sets/ > /dev/null
for set in *frameworks-5*${KF5_RELEASE}; do
	newfile=${set/%-${KF5_RELEASE}}
	echo -e "${HEADER}" > "${newfile}"
	sed -r "/@/s/-${KF5_RELEASE}//g;/5\.9999$/s/~//;s/<//;\@kde-[a-z]+/@s/-(5\.9999|5\.[0-9]+\.50)/:5/" "${set}" >> "${newfile}"
done

if [[ -n ${KF6_RELEASE} ]]; then
	for set in *frameworks-*${KF6_RELEASE}; do
		newfile=${set/%-${KF6_RELEASE}}
		echo -e "${HEADER}" > "${newfile}"
		sed -r "/@/s/-${KF6_RELEASE}//g;/9999$/s/~//;s/<//;\@kde-frameworks/@s/-(9999|5\.[0-9]+\.50)//" "${set}" >> "${newfile}"
	done
fi

for set in *plasma-${PLASMA_RELEASE}; do
	newfile=${set/%-${PLASMA_RELEASE}}
	echo -e "${HEADER}" > "${newfile}"
	sed -r "/@/s/-${PLASMA_RELEASE}//g;/9999$/s/~//;s/<//;\@kde-plasma/@s/-(9999|${PLASMA_RELEASE}\.50)//" "${set}" >> "${newfile}"
done

for set in *-${GEAR_RELEASE}; do
	newfile=${set/%-${GEAR_RELEASE}}
	echo -e "${HEADER}" > "${newfile}"
	sed -r "/@/s/-${GEAR_RELEASE}//g;/9999$/s/~//;s/<//;\@[a-z-]+/@s/-(9999|${GEAR_RELEASE}\.50)//" "${set}" >> "${newfile}"
done

popd > /dev/null

# regenerate CONTRIBUTORS file
pushd ../ > /dev/null
newfile="CONTRIBUTORS"
echo -e "${HEADER}" > "${newfile}"
git log --all --format='%aN <%aE>' | sort -u >> "${newfile}"
popd > /dev/null