From 2453c039c59f2e9bbc5f3343aaceaca40558d0ee Mon Sep 17 00:00:00 2001 From: Martin Borg Date: Tue, 18 Dec 2018 18:04:34 +0100 Subject: copyrc.sh: Search for artifacts using 'find' Change-Id: I1731b7b69aac9d10fc14122c3b1e6f18696d3d22 Signed-off-by: Martin Borg --- release/RELEASE_CONTENT | 10 ++++++---- release/copyrc.sh | 29 ++++++++++++++++------------- 2 files changed, 22 insertions(+), 17 deletions(-) (limited to 'release') diff --git a/release/RELEASE_CONTENT b/release/RELEASE_CONTENT index 3fb3799..161c599 100644 --- a/release/RELEASE_CONTENT +++ b/release/RELEASE_CONTENT @@ -1,11 +1,13 @@ # The release structure is defined here as: -# : +# : # atom-c3000 images -tmp/deploy/images/atom-c3000/enea-nfv-access-edgelink-netconf-atom-c3000.hddimg:atom-c3000/enea-nfv-access-edgelink-netconf-atom-c3000.hddimg +enea-nfv-access-edgelink-netconf-atom-c3000.hddimg:atom-c3000/enea-nfv-access-edgelink-netconf-atom-c3000.hddimg # xeon-d images -tmp/deploy/images/xeon-d/enea-nfv-access-edgelink-netconf-xeon-d.hddimg:xeon-d/enea-nfv-access-edgelink-netconf-xeon-d.hddimg +enea-nfv-access-edgelink-netconf-xeon-d.hddimg:xeon-d/enea-nfv-access-edgelink-netconf-xeon-d.hddimg # documentation -doc/book-enea-nfv-access-guide-intel/book-enea-nfv-access-guide-intel.pdf:Documentation/book-enea-nfv-access-guide-intel.pdf +book-enea-nfv-access-getting-started.pdf:Documentation/book-enea-nfv-access-getting-started.pdf +book-enea-nfv-access-reference-guide-intel.pdf:Documentation/book-enea-nfv-access-reference-guide-intel.pdf + diff --git a/release/copyrc.sh b/release/copyrc.sh index 7e9616d..8c21838 100755 --- a/release/copyrc.sh +++ b/release/copyrc.sh @@ -10,6 +10,7 @@ Usage: $(basename $0) [OPTIONS] -o ... OPTIONS: + -i Ignore missing files -p Print the release structure without creating it -r Set release definition file (default: RELEASE_CONTENT) @@ -19,8 +20,9 @@ EOF RC_def="./RELEASE_CONTENT" -while getopts "o:pr:" name; do +while getopts "io:pr:" name; do case $name in + i) ignore_missing=1 ;; o) RC_dir=$OPTARG ;; r) RC_def=$OPTARG ;; p) print=1 ;; @@ -59,19 +61,20 @@ while read line; do continue fi - found=0 - for srcdir in ${builddirs[@]}; do - if [ -f "$srcdir/$srcfile" ]; then - found=1 - mkdir -p "$RC_dir/$(dirname "$dstfile")" - cp -Lpv $srcdir/$srcfile $RC_dir/$dstfile - break - fi - done + srcpath=$(find -L ${builddirs[@]} -wholename "*$srcfile" -print -quit) + + if [ "$srcpath" ]; then - if [ "$found" -eq "0" ]; then - echo "ERROR: File '$srcfile' not found" - exit 1 + mkdir -p "$RC_dir/$(dirname "$dstfile")" + cp -Lpvr $srcpath $RC_dir/$dstfile + + else + if [ "$ignore_missing" ]; then + echo "WARNING: File '$srcfile' not found" + else + echo "ERROR: File '$srcfile' not found" + exit 1 + fi fi done < $RC_def -- cgit v1.2.3-54-g00ecf