aboutsummaryrefslogtreecommitdiff
blob: 90a55d2b011ffd5bf99fcabecbfa367fe474abeb (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
#!/bin/bash

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

SCRIPT=`basename $0`
if [[ ! -f "${PWD}/${SCRIPT}" ]]; then
	echo "You need to be in '"`dirname $0`"' dir to run this script."
	exit -1
fi

HEADER="# Autogenerated by ${SCRIPT}, DO NOT EDIT."

# regenerate keywords
pushd ../package.keywords/ > /dev/null
for release in 4.8 4.9 4.10; do
	echo -e "${HEADER}" > "kde-${release}.keywords"
	if [[ -d ".kde-${release}" ]]; then
		cat ".kde-${release}/"* | sed '/^~.*[.-]9999$/s/$/ **/' >> "kde-${release}.keywords"
	fi
done

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

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

# keywords for miscleanous packages from package.unmask/
for misc in kde-extras-live; do
	if [[ -f "../package.unmask/${misc}" ]]; then
		echo -e "${HEADER}" > "${misc}.keywords"
		sed '/^~.*[.-]9999$/s/$/ **/' "../package.unmask/${misc}" >> "${misc}.keywords"
	fi
done
popd > /dev/null

# regenerate unmask entries (base for package mask)
pushd ../package.unmask/ > /dev/null
for release in 4.8 4.9 4.10 live; do
	echo -e "${HEADER}" > "kde-${release}"
	if [[ -d ".kde-${release}" ]]; then
		cat ".kde-${release}/"* >> "kde-${release}"
	fi
done
popd > /dev/null

# regenerate mask entries (base for package mask)
pushd ../package.mask/ > /dev/null
for release in 4.8 4.9 4.10 live; do
	echo -e "${HEADER}" > "kde-${release}"
	if [[ -d "../package.unmask/.kde-${release}" ]]; then
		cat "../package.unmask/.kde-${release}/"* >> "kde-${release}"
		sed -i "kde-${release}" -e "/^<kde-base\/.*-4\..\.50$/{s/-4\..\.50/-${release}/;s/^</>=/};/^~.*[.-]9999$/s/$/ **/"
	fi
done
popd > /dev/null

# regenerate package mask
pushd ../../profiles/ > /dev/null
echo -e "\
${HEADER}
# Edit profiles/package.mask.d/ files instead." > package.mask
if [[ -d package.mask.d ]]; then
	for masks in package.mask.d/*; do
		echo >> package.mask
		cat ${masks} >> package.mask
	done
fi
popd > /dev/null

# regenerate unversioned sets
RELEASE=${RELEASE:-4.8}
pushd ../../sets/ > /dev/null
for set in *-${RELEASE}; do
	newfile=${set/%-${RELEASE}}
	echo -e "${HEADER}" > "${newfile}"
	sed -r "/@/s/-${RELEASE}//g;/9999$/s/~//;s/<//;\@kde-base/@s/-(9999|4\..\.50)/:4/" "${set}" >> "${newfile}"
done
popd > /dev/null