diff options
author | Tomáš Levora <t.levora@partner.samsung.com> | 2019-04-23 14:28:47 +0200 |
---|---|---|
committer | Tomáš Levora <t.levora@partner.samsung.com> | 2019-05-09 12:24:21 +0200 |
commit | 284fbf8afb0ff784507e7b0f8b9d325e8644f67c (patch) | |
tree | 8facf71bf7bb9325b2f428d5d8e1daa5a396c7e2 /build/creating_data/save-docker-images.sh | |
parent | 029b36f9f0faedc18b032ebb8c598118ff80f67b (diff) |
Fix download scripts to handle empty lines
Fixing download and saving scripts to be able to ignore empty or 00D
ending lines in lists
Issue-ID: OOM-1818
Change-Id: I55ef1dfbea628f8c1d4b19745536e629a2dbe0c9
Signed-off-by: Tomáš Levora <t.levora@partner.samsung.com>
Diffstat (limited to 'build/creating_data/save-docker-images.sh')
-rwxr-xr-x | build/creating_data/save-docker-images.sh | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/build/creating_data/save-docker-images.sh b/build/creating_data/save-docker-images.sh index 4c764556..0a72d15b 100755 --- a/build/creating_data/save-docker-images.sh +++ b/build/creating_data/save-docker-images.sh @@ -19,15 +19,10 @@ # COPYRIGHT NOTICE ENDS HERE -# boilerplate -RELATIVE_PATH=../ # relative path from this script to 'common-functions.sh' -if [ "$IS_COMMON_FUNCTIONS_SOURCED" != YES ] ; then - SCRIPT_DIR=$(dirname "${0}") - LOCAL_PATH=$(readlink -f "$SCRIPT_DIR") - . "${LOCAL_PATH}"/"${RELATIVE_PATH}"/common-functions.sh -fi +# Load common-functions library +. $(dirname ${0})/../common-functions.sh -LIST="${1}" +LIST_FILE="${1}" IMG_DIR="${2}" if [[ -z "$IMG_DIR" ]]; then @@ -56,11 +51,9 @@ save_image() { echo "Save all images" line=1 -lines=$(wc -l ${LIST}) -while read -r image; do +lines=$(clean_list "$LIST_FILE" | wc -l) +for image in $(clean_list "$LIST_FILE"); do echo "== pkg #$line of $lines ==" - save_image "${image}" line=$((line+1)) - -done < "${LIST}" +done
\ No newline at end of file |