From 89036ef76ab09af6ba324c896f0db00ae1ebaab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Fri, 29 Jan 2016 11:53:50 +0100 Subject: [PATCH] stdenv: accept wider range of $configureScript options Fixes #12632. I think it's better to quote this variable in general, because it is common and even documented to pass space-separated commands in there. The greps should just fail in that case and `if` won't proceed which seems fine for such cases, and it's certainly better than passing additional unintended parameters to grep (which was happening all the time before). --- pkgs/stdenv/generic/setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index dc6c765353f7..7d25472993c5 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -644,14 +644,14 @@ configurePhase() { # Add --disable-dependency-tracking to speed up some builds. if [ -z "$dontAddDisableDepTrack" ]; then - if grep -q dependency-tracking $configureScript; then + if grep -q dependency-tracking "$configureScript"; then configureFlags="--disable-dependency-tracking $configureFlags" fi fi # By default, disable static builds. if [ -z "$dontDisableStatic" ]; then - if grep -q enable-static $configureScript; then + if grep -q enable-static "$configureScript"; then configureFlags="--disable-static $configureFlags" fi fi