summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E.H. Turner <jturner@gemini.edu>2016-08-23 19:08:38 -0400
committerJames E.H. Turner <jturner@gemini.edu>2016-08-23 19:08:38 -0400
commit9be55f5d7dce4f34bc14b417b9cb4201246986ff (patch)
treeeb2d48875329e7ab1790e8694789ce74956061fd
parent9f9f83832bcb08f9d477fbe89c80dc5d1f2e29c7 (diff)
downloadastroconda-iraf-helpers-9be55f5d7dce4f34bc14b417b9cb4201246986ff.tar.gz
Move iraf package filename definitions into their own file, for use by multiple sh scripts. Also quote a few path variables properly, in case of spaces.
-rwxr-xr-xscripts/check_iraf_pkg_build10
-rw-r--r--scripts/iraf_defs7
-rwxr-xr-xscripts/unmangle_interpreter2
3 files changed, 12 insertions, 7 deletions
diff --git a/scripts/check_iraf_pkg_build b/scripts/check_iraf_pkg_build
index 58619bf..e33190f 100755
--- a/scripts/check_iraf_pkg_build
+++ b/scripts/check_iraf_pkg_build
@@ -11,13 +11,11 @@
# 4 build incomplete with respect to manifest
# 6 both of the above
-log_name="build_log"
-err_log_name="build_log.errors"
-manifest_name="ur_manifest"
-pkg_patt_name="ur_mkpkg_patterns"
-
usage="Usage: check_iraf_pkg_build PATH"
+# Source some common IRAF package defs (log_name etc.) from the same dir:
+. `dirname "$0"`/iraf_defs
+
# Parse argument(s):
st=1
unset pkg_path
@@ -47,7 +45,7 @@ if [ $st != 0 -o -z "$pkg_path" ]; then
fi
# Add a trailing slash if needed (as per IRAF custom):
-pkg_path=`echo $pkg_path | sed -e 's|/*$|/|'`
+pkg_path=`echo "$pkg_path" | sed -e 's|/*$|/|'`
# Make sure the specified path is readable:
if [ ! -d "$pkg_path" -o ! -r "$pkg_path" ]; then
diff --git a/scripts/iraf_defs b/scripts/iraf_defs
new file mode 100644
index 0000000..4428ed3
--- /dev/null
+++ b/scripts/iraf_defs
@@ -0,0 +1,7 @@
+# Some common IRAF-package name definitions for the sh scripts in this dir.
+
+log_name="build_log"
+err_log_name="build_log.errors"
+manifest_name="ur_manifest"
+pkg_patt_name="ur_mkpkg_patterns"
+
diff --git a/scripts/unmangle_interpreter b/scripts/unmangle_interpreter
index 709fb4f..d060ecb 100755
--- a/scripts/unmangle_interpreter
+++ b/scripts/unmangle_interpreter
@@ -4,7 +4,7 @@
scripts="update_extern_pkg"
# Work in the directory where this script and those to be updated live:
-cd `dirname $0` || exit 1 # (should never fail if this script can be executed)
+cd `dirname "$0"` || exit 1 # (should never fail if this script can be executed)
# Put temporary copies in a tmp/ directory in the conda environment or /tmp/:
tmp="$PREFIX/tmp"