From 08b94aff91171da8fcd76b329bf6ff9de67ac34b Mon Sep 17 00:00:00 2001 From: csilvers Date: Wed, 27 Jul 2011 00:56:05 +0000 Subject: [PATCH] Fix a longstanding bug when dpkg isn't present. The idea is we silently continue in that case, but we run sh -e, which causes the script to abort on error, even if the error is inside backticks (``). So we make sure the dpkg command never gives an error, even when it's not installed. Reported in http://code.google.com/p/google-ctemplate/issues/detail?id=79 --- trunk/packages/rpm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trunk/packages/rpm.sh b/trunk/packages/rpm.sh index 381bd88..0454225 100755 --- a/trunk/packages/rpm.sh +++ b/trunk/packages/rpm.sh @@ -52,7 +52,7 @@ cp "$archive" "$RPM_SOURCE_DIR" # does a better job of this, so if we can run 'dpkg --print-architecture' # to get the build CPU, we use that in preference of the rpmbuild # default. -target=`dpkg --print-architecture 2>/dev/null` # "" if dpkg isn't found +target=`dpkg --print-architecture 2>/dev/null || echo ""` if [ -n "$target" ] then target=" --target $target"