1 # vim:set et ts=4 sw=4 ft=bash ai:
6 PATH="/bin:/usr/bin:/org/wanna-build/bin:/org/buildd.debian.org/bin:/org/wanna-build/triggers"
7 ARCHIVE_MAIN="/org/wanna-build/tmp/archive/debian"
8 ARCHIVE_BASE="/org/wanna-build/tmp/archive/${ARCHIVE}"
9 PAS_BASE="/org/buildd.debian.org/web/quinn-diff"
10 PAS_FILE="$PAS_BASE/$SUITE/Packages-arch-specific"
11 LOCKFILE="${ARCHIVE_BASE}/lock"
12 ARCHS_lenny="alpha amd64 arm armel hppa i386 ia64 mips mipsel powerpc s390 sparc"
13 ARCHS_squeeze="amd64 armel i386 ia64 mips mipsel powerpc s390 sparc kfreebsd-amd64 kfreebsd-i386"
14 ARCHS_wheezy="amd64 armel i386 ia64 mips mipsel powerpc s390 sparc kfreebsd-amd64 kfreebsd-i386"
15 ARCHS_sid="$ARCHS_squeeze alpha hppa hurd-i386"
17 # Creates a working environment within the corresponding archive
18 # directory and jumps there.
20 mkdir -p "${ARCHIVE_BASE}/workdir"
21 cd "${ARCHIVE_BASE}/workdir"
24 # Puts the list of architectures for a given suite onto stdout.
28 if [ "$SUITE" = "lenny" -o "$SUITE" = "oldstable" ]; then echo $ARCHS_lenny
29 elif [ "$SUITE" = "squeeze" -o "$SUITE" = "stable" ]; then echo $ARCHS_squeeze
30 elif [ "$SUITE" = "wheezy" -o "$SUITE" = "testing" ]; then echo $ARCHS_wheezy
31 elif [ "$SUITE" = "unstable" -o "$SUITE" = "sid" ]; then echo $ARCHS_sid
32 elif [ "$SUITE" = "experimental" ]; then echo $ARCHS_sid
34 echo "Unknown suite encountered, aborting." >&2
44 if lockfile -! -r 10 -l 6000 "$LOCKFILE"
46 echo "Cannot lock $LOCKFILE, aborting."
63 echo "`date`: Processing ${ARCHIVE}/${SUITE} ..."
65 keep-latest source $(eval echo ${SOURCES}) > Sources.${SUITE}
66 for ARCH in ${ARCHS}; do
67 keep-latest ${ARCH} $(eval echo $(echo ${PACKAGES} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}
69 [ -f Packages.${SUITE}.i386.non-free ] && PNF="Packages.${SUITE}.%ARCH%.non-free" || PNF=""
70 [ -f Sources.${SUITE}.non-free ] && SNF="Sources.${SUITE}.non-free" || SNF=""
71 parallel -l 5 -i wanna-build -v --Pas ${PAS_FILE} --merge-v3 -A "{}" --dist=$WB_SUITE Packages.${SUITE}.%ARCH% $PNF . Sources.${SUITE} $SNF . Packages.${SUITE}.%ARCH% -- ${ARCHS} || true
73 echo "`date`: ${ARCHIVE}/${SUITE} done"
76 trigger_wb_update_for_overlay() {
91 echo "`date`: Processing ${ARCHIVE}/${SUITE} ..."
93 keep-latest source $(eval echo ${SOURCES}) > Sources.${SUITE}
94 keep-latest source $(eval echo Sources.${SUITE} ${SOURCES_BASE}) > Sources.${SUITE}-all
95 for ARCH in ${ARCHS}; do
96 keep-latest ${ARCH} $(eval echo $(echo ${PACKAGES} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}
97 keep-latest ${ARCH} Packages.${SUITE}.${ARCH} $(eval echo $(echo ${PACKAGES_BASE} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}-all
99 [ -f Packages.${SUITE}.i386.non-free ] && PNF="Packages.${SUITE}.%ARCH%.non-free" || PNF=""
100 [ -f Sources.${SUITE}.non-free ] && SNF="Sources.${SUITE}.non-free" || SNF=""
101 echo parallel -l 5 -i wanna-build -v --Pas ${PAS_FILE} --merge-v3 -A "{}" --dist=$WB_SUITE Packages.${SUITE}.%ARCH% $PNF . Sources.${SUITE} $SNF . \
102 Packages.${SUITE}.%ARCH%-all . Sources.${SUITE}-all $SNF -- ${ARCHS}
103 parallel -l 5 -i wanna-build -v --Pas ${PAS_FILE} --merge-v3 -A "{}" --dist=$WB_SUITE Packages.${SUITE}.%ARCH% $PNF . Sources.${SUITE} $SNF . \
104 Packages.${SUITE}.%ARCH%-all . Sources.${SUITE}-all $SNF -- ${ARCHS} || true
106 echo "`date`: ${ARCHIVE}/${SUITE} done"
109 # This is for the case where you get also get packages from
110 # a secondary unrelated suite, the buildd's chroot also has
111 # those packages files in it.
112 # Examples are *-{volatile,backports,edu} and experimental
113 # This is not for something like stable and proposed-updates
114 trigger_wb_update_with_secondary() {
123 if [ -z "$WB_SUITE" ]
128 echo "`date`: Processing ${ARCHIVE}/${SUITE} ..."
130 keep-latest source $(eval echo ${SOURCES}) > Sources.${SUITE}
132 for ARCH in ${ARCHS}; do
133 keep-latest ${ARCH} $(eval echo $(echo ${PACKAGES} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}
134 ucat Packages.${SUITE}.${ARCH} $(eval echo $(echo ${PACKAGES_BASE} | sed -e 's/%ARCH%/${ARCH}/g')) > Packages.${SUITE}.${ARCH}-all
136 [ -f Packages.${SUITE}.i386.non-free ] && PNF="Packages.${SUITE}.%ARCH%.non-free" || PNF=""
137 [ -f Sources.${SUITE}.non-free ] && SNF="Sources.${SUITE}.non-free" || SNF=""
138 parallel -l 5 -i wanna-build -v --Pas ${PAS_FILE} --merge-v3 -A "{}" --dist=$WB_SUITE Packages.${SUITE}.%ARCH% $PNF . Sources.${SUITE} $SNF . \
139 Packages.${SUITE}.%ARCH%-all -- ${ARCHS} || true
141 echo "`date`: ${ARCHIVE}/${SUITE} done"
146 if [ -f ${FILE} ]; then
162 filter_out_nonfree() {
166 gunzip -c "$INPUT" | grep-dctrl -v -r -F Section 'non-free/.*' | gzip -c > "$OUTPUT"