File gesammelte_werke-aggregate.sh of Package gesammelte_werke
39
1
2
set -e
3
declare -a pkgs
4
declare -A repositories
5
target_prj='Factory'
6
read prj < .osc/_project
7
read this_pkg < .osc/_package
8
#
9
for pkg in $(pbs ls "${prj}")
10
do
11
test "${this_pkg}" = "${pkg}" && continue
12
pkgs+=(${pkg})
13
done
14
#
15
while read
16
do
17
set -- ${REPLY}
18
test "$1" = "${target_prj}" && continue
19
repositories["$1"]="$1"
20
done < <(pbs repositories "${prj}")
21
#
22
(
23
cat <<_EOF_
24
<!-- automatically generated by $0 -->
25
<aggregatelist>
26
_EOF_
27
for src_repository in ${!repositories[@]}
28
do
29
echo " <aggregate project='${prj}'>"
30
for pkg in ${pkgs[@]}
31
do
32
echo " <package>${pkg}</package>"
33
done
34
echo " <repository source='${src_repository}' target='${target_prj}' />"
35
echo " </aggregate>"
36
done
37
echo '</aggregatelist>'
38
) > '_aggregate'
39