Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2015-01-12 20:27:33 +0000
committerMarc Khouzam2015-01-15 14:33:53 +0000
commit7bbaa4d7b324aba04594fc64a09b353000b4d9fe (patch)
tree66cd374463f5a7f3d7703000cd752f43d9536092
parent971176c83f93f39daf74620e38937cb09a2d24e1 (diff)
downloadorg.eclipse.cdt-7bbaa4d7b324aba04594fc64a09b353000b4d9fe.tar.gz
org.eclipse.cdt-7bbaa4d7b324aba04594fc64a09b353000b4d9fe.tar.xz
org.eclipse.cdt-7bbaa4d7b324aba04594fc64a09b353000b4d9fe.zip
Avoid duplicate code in script
Change-Id: Ia40f8fd676a7e2c302f06efa4ccf9fb77dc6dfc9 Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com> Reviewed-on: https://git.eclipse.org/r/39421 Tested-by: Hudson CI Reviewed-by: Simon Marchi <simon.marchi@polymtl.ca>
-rwxr-xr-xdsf-gdb/org.eclipse.cdt.tests.dsf.gdb/scripts/download-build-gdb.sh19
1 files changed, 9 insertions, 10 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/scripts/download-build-gdb.sh b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/scripts/download-build-gdb.sh
index efa269fc535..28eb3fccc13 100755
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/scripts/download-build-gdb.sh
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/scripts/download-build-gdb.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# * Copyright (c) 2014 Ericsson and others.
+# * Copyright (c) 2015 Ericsson and others.
# * All rights reserved. This program and the accompanying materials
# * are made available under the terms of the Eclipse Public License v1.0
# * which accompanies this distribution, and is available at
@@ -20,7 +20,7 @@ base_dir="${default_base_dir}"
default_jlevel="4"
jlevel="${default_jlevel}"
-# Default versions (for when "all" is used)
+# Supported versions
default_versions="6.6 6.7.1 6.8 7.0.1 7.1 7.2 7.3.1 7.4.1 7.5.1 7.6.2 7.7.1 7.8.1"
# Is set to "echo" if we are doing a dry-run.
@@ -66,8 +66,11 @@ function echo_header() {
#
# $1: version number
function check_supported() {
- case "$version" in
- "6.6"|"6.7.1"|"6.8"|"7.0.1"|"7.1"|"7.2"|"7.3.1"|"7.4.1"|"7.5.1"|"7.6.2"|"7.7.1"|"7.8.1")
+ local supported_pattern="@(${default_versions// /|})"
+
+ shopt -s extglob
+ case "$version" in
+ ${supported_pattern})
# Supported, do nothing.
;;
*)
@@ -168,12 +171,8 @@ function configure_gdb() {
# Let the user specify some CFLAGS
cflags="${cflags} ${CFLAGS}"
- # The ${dryrun} trick doesn't work here, because of the env var.
- if [ -z "${dryrun}" ]; then
- CFLAGS="${cflags}" ./configure --prefix="${install_dir}/gdb-${version}"
- else
- ${dryrun} CFLAGS="\"${cflags}\"" ./configure --prefix="${install_dir}/gdb-${version}"
- fi
+ # Need to use eval to allow the ${dryrun} trick to work with the env var command at the start.
+ eval ${dryrun} 'CFLAGS="${cflags}" ./configure --prefix="${install_dir}/gdb-${version}"'
${dryrun} popd
}

Back to the top