summaryrefslogtreecommitdiffstats
path: root/bin/d-i_build.sh
diff options
context:
space:
mode:
authorWouter Verhelst <w@uter.be>2014-02-25 08:28:04 +0100
committerWouter Verhelst <w@uter.be>2014-02-25 08:28:04 +0100
commit81051c4fc12865b61759801ab2aa5ad00fe9b432 (patch)
tree6dbe666274f63a55df8a74dd015b01013937bff4 /bin/d-i_build.sh
parent357ad514fe1f1171425e5730154dc578599915f5 (diff)
downloadjenkins.debian.net-81051c4fc12865b61759801ab2aa5ad00fe9b432.tar.xz
Fix architecture check
d-i_build.sh checks the architecture by parsing a hardcoded list of architecture wildcards. It misses the wildcards of the form <os>-any and any-<cpu>, however, which have been supported since a fair while now. This has caused jenkins to (incorrectly) skip the builds for partman-nbd up until partman-nbd 0.22 (which reverted back to Architecture: all). Rather than trying to expand the hardcoded list, instead use dpkg-architecture's -i option, which checks if the current architecture matches the wildcard architecture specified as an argument to -i. This option has been available since dpkg 1.13.13, i.e., pre-oldstable.
Diffstat (limited to 'bin/d-i_build.sh')
-rwxr-xr-xbin/d-i_build.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/bin/d-i_build.sh b/bin/d-i_build.sh
index 3a5f602d..f5dc063e 100755
--- a/bin/d-i_build.sh
+++ b/bin/d-i_build.sh
@@ -36,12 +36,14 @@ pdebuild_package() {
echo "Warning: A source package without debian/control, so no build will be tried."
return
fi
- ARCH=$(dpkg --print-architecture)
- EGREP_PATTERN="( all| any| $ARCH)"
- if [ ! $(grep "Architecture:" debian/control | egrep "$EGREP_PATTERN" | wc -l ) -gt 0 ] ; then
- echo "This package is not to be supposed to be build on $ARCH:"
- grep "Architecture:" debian/control
- return
+ ARCH=$(grep 'Architecture:' debian/control | cut -d' ' -f 2)
+ MYARCH=$(dpkg --print-architecture)
+ if [ $ARCH != "all" ] ; then
+ if ! dpkg-architecture -i$ARCH ; then
+ echo "This package is not to be supposed to be build on $MYARCH:"
+ grep "Architecture:" debian/control
+ return
+ fi
fi
#
# prepare build