From 3c650ae28a320b4d0c45829cc551482e138146c0 Mon Sep 17 00:00:00 2001 From: Tom Scavo Date: Sat, 14 Jan 2017 17:22:26 -0500 Subject: [PATCH] Add http_tools.sh to the dependency list --- bin/check_idp_error_urls.sh | 13 ++++++------ bin/list_local_idp_error_urls.sh | 35 ++++++++++++++++---------------- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/bin/check_idp_error_urls.sh b/bin/check_idp_error_urls.sh index 71848d1..51eb40d 100755 --- a/bin/check_idp_error_urls.sh +++ b/bin/check_idp_error_urls.sh @@ -1,7 +1,7 @@ #!/bin/bash ####################################################################### -# Copyright 2015--2016 Internet2 +# Copyright 2015--2017 Internet2 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -226,11 +226,6 @@ HELP_MSG script_bin=${0%/*} # equivalent to dirname $0 script_name=${0##*/} # equivalent to basename $0 -# library filenames (always list command_paths first) -LIB_FILENAMES="command_paths.sh -compatible_mktemp.sh -md_tools.sh" - # determine the source lib directory if [ -z "$LIB_DIR" ]; then echo "ERROR: $script_name requires env var LIB_DIR" >&2 @@ -241,6 +236,12 @@ if [ ! -d "$LIB_DIR" ]; then exit 2 fi +# library filenames (always list command_paths first) +LIB_FILENAMES="command_paths.sh +compatible_mktemp.sh +http_tools.sh +md_tools.sh" + # source lib files for lib_filename in $LIB_FILENAMES; do lib_file="$LIB_DIR/$lib_filename" diff --git a/bin/list_local_idp_error_urls.sh b/bin/list_local_idp_error_urls.sh index c405dca..481ddea 100755 --- a/bin/list_local_idp_error_urls.sh +++ b/bin/list_local_idp_error_urls.sh @@ -1,7 +1,7 @@ #!/bin/bash ####################################################################### -# Copyright 2015--2016 Internet2 +# Copyright 2015--2017 Internet2 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -47,11 +47,6 @@ HELP_MSG script_name=${0##*/} # equivalent to basename $0 script_bin=${0%/*} # equivalent to dirname $0 -# library filenames -COMMAND_PATHS_FILENAME=command_paths.sh -COMPATIBLE_MKTEMP_FILENAME=compatible_mktemp.sh -MD_TOOLS_FILENAME=md_tools.sh - ####################################################################### # Process command-line options and arguments ####################################################################### @@ -157,19 +152,25 @@ if [ ! -d "$LIB_DIR" ]; then fi $verbose_mode && printf "$script_name using source lib directory: %s\n" "$LIB_DIR" -# source lib files (always source command_paths first) -for source_filename in $COMMAND_PATHS_FILENAME $COMPATIBLE_MKTEMP_FILENAME $MD_TOOLS_FILENAME; do - source_file="$LIB_DIR/$source_filename" - if [ ! -f "$source_file" ]; then - echo "ERROR: $script_name: file does not exist: $source_file" >&2 +# library filenames (always list command_paths first) +LIB_FILENAMES="command_paths.sh +compatible_mktemp.sh +http_tools.sh +md_tools.sh" + +# source lib files +for lib_filename in $LIB_FILENAMES; do + lib_file="$LIB_DIR/$lib_filename" + if [ ! -f "$lib_file" ]; then + echo "ERROR: $script_name: lib file does not exist: $lib_file" >&2 exit 2 fi - $verbose_mode && printf "$script_name sourcing lib file: %s\n" "$source_file" - source "$source_file" >&2 - exit_status=$? - if [ $exit_status -ne 0 ]; then - echo "ERROR: $script_name failed to source script $source_file" >&2 - exit $exit_status + $verbose_mode && printf "$script_name sourcing lib file: %s\n" "$lib_file" + source "$lib_file" + status_code=$? + if [ $status_code -ne 0 ]; then + echo "ERROR: $script_name failed to source lib file ($status_code) $lib_file" >&2 + exit 2 fi done