From ca1f05897fb22ccdf94e5978f2fab7a96dca978c Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 6 Jun 2015 22:54:21 +0200 Subject: make grep more robust --- bin/d-i_build.sh | 2 +- bin/d-i_manual.sh | 2 +- bin/reproducible_build.sh | 2 +- bin/reproducible_common.sh | 2 +- bin/reproducible_coreboot.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/d-i_build.sh b/bin/d-i_build.sh index a6359c09..2e189d1f 100755 --- a/bin/d-i_build.sh +++ b/bin/d-i_build.sh @@ -67,7 +67,7 @@ pdebuild_package() { SOURCE=$(dpkg-parsechangelog |grep ^Source: | cut -d " " -f2) # workaround #767260 (console-setup doesn't support parallel build) if [ "$SOURCE" != "console-setup" ] ; then - NUM_CPU=$(cat /proc/cpuinfo |grep ^processor|wc -l) + NUM_CPU=$(cat /proc/cpuinfo |grep '^processor'|wc -l) else NUM_CPU=1 fi diff --git a/bin/d-i_manual.sh b/bin/d-i_manual.sh index 3e9d2beb..01a9f14b 100755 --- a/bin/d-i_manual.sh +++ b/bin/d-i_manual.sh @@ -46,7 +46,7 @@ pdebuild_package() { # build # cd manual - NUM_CPU=$(cat /proc/cpuinfo |grep ^processor|wc -l) + NUM_CPU=$(cat /proc/cpuinfo |grep '^processor'|wc -l) pdebuild --use-pdebuild-internal --debbuildopts "-j$NUM_CPU" -- --http-proxy $http_proxy # # publish and cleanup diff --git a/bin/reproducible_build.sh b/bin/reproducible_build.sh index 72b91c46..c3473032 100755 --- a/bin/reproducible_build.sh +++ b/bin/reproducible_build.sh @@ -401,7 +401,7 @@ check_suitability() { build_rebuild() { FTBFS=1 local TMPCFG=$(mktemp -t pbuilderrc_XXXX --tmpdir=$TMPDIR) - local NUM_CPU=$(cat /proc/cpuinfo |grep ^processor|wc -l) + local NUM_CPU=$(cat /proc/cpuinfo |grep '^processor'|wc -l) mkdir b1 b2 set -x printf "BUILDUSERID=1111\nBUILDUSERNAME=pbuilder1\n" > $TMPCFG diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index d9a9ea12..7e89a028 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -263,7 +263,7 @@ write_explaination_table() { write_page "env TZTZ=\"/usr/share/zoneinfo/Etc/GMT+12\"TZ=\"/usr/share/zoneinfo/Etc/GMT-14\"" write_page "env LANGLANG=\"en_GB.UTF-8\"LANG=\"fr_CH.UTF-8\"" write_page "env LC_ALLunsetLC_ALL=\"fr_CH.UTF-8\"" - local NUM_CPU=$(cat /proc/cpuinfo |grep ^processor|wc -l) + local NUM_CPU=$(cat /proc/cpuinfo |grep '^processor'|wc -l) if [ "$1" = "debian" ] ; then write_page "env PATHPATH=\"/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:\"PATH=\"/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path\"" write_page "env BUILDUSERIDBUILDUSERID=\"1111\"BUILDUSERID=\"2222\"" diff --git a/bin/reproducible_coreboot.sh b/bin/reproducible_coreboot.sh index 9848ffe6..43d7ecaa 100755 --- a/bin/reproducible_coreboot.sh +++ b/bin/reproducible_coreboot.sh @@ -111,7 +111,7 @@ export TZ="/usr/share/zoneinfo/Etc/GMT+12" # prevent failing using more than one CPU sed -i 's#MAKE=$i#MAKE=make#' util/abuild/abuild # use all cores for first build -NUM_CPU=$(cat /proc/cpuinfo |grep ^processor|wc -l) +NUM_CPU=$(cat /proc/cpuinfo |grep '^processor'|wc -l) sed -i "s#cpus=1#cpus=$NUM_CPU#" util/abuild/abuild sed -i 's#USE_XARGS=1#USE_XARGS=0#g' util/abuild/abuild # actually build everything -- cgit v1.2.3-70-g09d2