Bug#740577: support for new build profiles syntax

Michael Stapelberg stapelberg at debian.org
Sun Jun 14 19:37:36 UTC 2015


Hi Johannes,

Johannes Schauer <josch at debian.org> writes:
> +    DEPENDS="$(get_build_deps | filter_arch_deps "$ARCH" |
> +        filter_restriction_deps \"$DEB_BUILD_PROFILES\" )"
> +    CONFLICTS="$(get_build_conflicts | filter_arch_deps "$ARCH" |
> +        filter_restriction_deps \"$DEB_BUILD_PROFILES\" )"
I think both invocations of filter_restriction_deps should actually use
"" instead of \"\", i.e. they should read:

DEPENDS="$(get_build_deps | filter_arch_deps "$ARCH" |
    filter_restriction_deps "$DEB_BUILD_PROFILES" )"
CONFLICTS="$(get_build_conflicts | filter_arch_deps "$ARCH" |
    filter_restriction_deps "$DEB_BUILD_PROFILES" )"

Without that change, negative profile dependencies are not filtered out
correctly, and I expect positive ones to not be filtered out correctly
either. The following sh -x trace shows that the code is trying to compare
'"stage1"' with 'stage1', I think:

+++ echo 'golang-google-api-dev <!stage1>'
+++ grep -q '<'
+++ checkbuilddep_restrictiondeps 'golang-google-api-dev <!stage1>'
'"stage1"'
+++ local 'INSTALLPKG=golang-google-api-dev <!stage1>'
+++ local 'PROFILES="stage1"'
++++ echo 'golang-google-api-dev <!stage1>'
++++ sed -e 's/[^<]*<\(.*\)>.*/\1/' -e 's/>\s\+</;/g'
+++ local 'DEP_RESTRICTIONS=!stage1'
++++ echo 'golang-google-api-dev <!stage1>'
++++ cut -d ' ' -f 1
+++ local PKG=golang-google-api-dev
+++ local SEEN_PROFILE
+++ local PROFILE
+++ local NEGATED
+++ local FOUND
+++ IFS=';'
+++ read -ra RESTRLISTS
+++ for restrlist in '"${RESTRLISTS[@]}"'
+++ SEEN_PROFILE=yes
+++ for restr in '$restrlist'
+++ [[ !stage1 == \!* ]]
+++ NEGATED=yes
+++ PROFILE=stage1
+++ FOUND=no
+++ for p in '$PROFILES'
+++ '[' '"stage1"' = stage1 ']'
+++ '[' no = yes ']'
+++ '[' yes = yes ']'
+++ return 1

The change does not break the unit tests, but perhaps it’d be advisable
to add a test which ensures that this part of the code works correctly :).

-- 
Best regards,
Michael



More information about the Pbuilder-maint mailing list