From 24d01f55d675348b1b4e9c022aab80af66100e9e Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Tue, 8 Sep 2020 01:25:29 +0100 Subject: Removed all occurances of IFS in low-level scripts Following the previous commit, we recognized that the 'IFS' terms are not necessary and can be even cause problems. So all their occurances in the scripts of Maneage have been removed with this commit. --- project | 16 ++++++++-------- reproduce/software/shell/configure.sh | 4 ++-- reproduce/software/shell/pre-make-build.sh | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/project b/project index d6ad891..61463ec 100755 --- a/project +++ b/project @@ -167,22 +167,22 @@ do # Configure options: - -b|--build-dir) IFS='"' build_dir="$2"; check_v "$1" "$build_dir"; shift;shift;; - -b=*|--build-dir=*) IFS='"' build_dir="${1#*=}"; check_v "$1" "$build_dir"; shift;; - -b*) IFS='"' build_dir=$(echo "$1" | sed -e's/-b//'); check_v "$1" "$build_dir"; shift;; + -b|--build-dir) build_dir="$2"; check_v "$1" "$build_dir"; shift;shift;; + -b=*|--build-dir=*) build_dir="${1#*=}"; check_v "$1" "$build_dir"; shift;; + -b*) build_dir=$(echo "$1" | sed -e's/-b//'); check_v "$1" "$build_dir"; shift;; -e|--existing-conf) existing_conf=1; shift;; -e*|--existing-conf=*) on_off_option_error --existing-conf -e;; --host-cc) host_cc=1; shift;; --host-cc=*) on_off_option_error --host-cc;; - -i|--input-dir) IFS='"' input_dir="$2"; check_v "$1" "$input_dir"; shift;shift;; - -i=*|--input-dir=*) IFS='"' input_dir="${1#*=}"; check_v "$1" "$input_dir"; shift;; + -i|--input-dir) input_dir="$2"; check_v "$1" "$input_dir"; shift;shift;; + -i=*|--input-dir=*) input_dir="${1#*=}"; check_v "$1" "$input_dir"; shift;; -i*) input_dir=$(echo "$1" | sed -e's/-i//'); check_v "$1" "$input_dir"; shift;; -m|--minmapsize) minmapsize="$2"; check_v "$1" "$minmapsize"; shift;shift;; -m=*|--minmapsize=*) minmapsize="${1#*=}"; check_v "$1" "$minmapsize"; shift;; -m*) minmapsize=$(echo "$1" | sed -e's/-m//'); check_v "$1" "$minmapsize"; shift;; - -s|--software-dir) IFS='"' software_dir="$2"; check_v "$1" "$software_dir"; shift;shift;; - -s=*|--software-dir=*) IFS='"' software_dir="${1#*=}"; check_v "$1" "$software_dir"; shift;; - -s*) IFS='"' software_dir=$(echo "$1" | sed -e's/-s//'); check_v "$1" "$software_dir"; shift;; + -s|--software-dir) software_dir="$2"; check_v "$1" "$software_dir"; shift;shift;; + -s=*|--software-dir=*) software_dir="${1#*=}"; check_v "$1" "$software_dir"; shift;; + -s*) software_dir=$(echo "$1" | sed -e's/-s//'); check_v "$1" "$software_dir"; shift;; --check-config) check_config=1; shift;; --check-config=*) on_off_option_error --check-config;; --clean-texdir) clean_texdir=1; shift;; diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh index 21fe1d6..bc43540 100755 --- a/reproduce/software/shell/configure.sh +++ b/reproduce/software/shell/configure.sh @@ -188,7 +188,7 @@ check_permission () free_space_warning() { fs_threshold=$1 - IFS='"' fs_destpath="$2" + fs_destpath="$2" return $(df "$fs_destpath" \ | awk 'FNR==2 {if($4>'$fs_threshold') print 1; \ else print 0; }') @@ -873,7 +873,7 @@ EOF # manipulate file permissions in the directory's filesystem and if # so, see if there is atleast 5GB free space. if ! [ x"$bdir" = x ]; then - if ! $(IFS='"' check_permission "$bdir"); then + if ! $(check_permission "$bdir"); then # Unable to handle permissions well bdir= echo " ** File permissions can't be modified in this directory" diff --git a/reproduce/software/shell/pre-make-build.sh b/reproduce/software/shell/pre-make-build.sh index f11e6e6..4e7d6ad 100755 --- a/reproduce/software/shell/pre-make-build.sh +++ b/reproduce/software/shell/pre-make-build.sh @@ -30,7 +30,7 @@ set -e -# Input arguments (the 'IFS's are to allow space in the name). +# Input arguments. bdir="$1" ddir="$2" downloader="$3" -- cgit v1.2.1