summaryrefslogtreecommitdiffstats
path: root/crtSignedContainer.sh
diff options
context:
space:
mode:
authorDave Heller <hellerda@us.ibm.com>2017-10-10 23:30:23 -0400
committerDave Heller <hellerda@us.ibm.com>2017-10-11 11:59:17 -0400
commit9d9ed21130cebe1e40171799f2390e97669e5bfd (patch)
treed5f03de326e5946e9c917798d3ffeea8b4367ca6 /crtSignedContainer.sh
parent09479b5d5280c9706337a96116300ccce76b8053 (diff)
downloadsb-signing-utils-9d9ed21130cebe1e40171799f2390e97669e5bfd.tar.gz
sb-signing-utils-9d9ed21130cebe1e40171799f2390e97669e5bfd.zip
Support comma delimted list for --archiveIn
Signed-off-by: Dave Heller <hellerda@us.ibm.com>
Diffstat (limited to 'crtSignedContainer.sh')
-rwxr-xr-xcrtSignedContainer.sh24
1 files changed, 16 insertions, 8 deletions
diff --git a/crtSignedContainer.sh b/crtSignedContainer.sh
index ee5da09..2c0d998 100755
--- a/crtSignedContainer.sh
+++ b/crtSignedContainer.sh
@@ -103,18 +103,18 @@ exportArchive () {
}
importArchive () {
- echo "--> $P: Importing achive: $SB_ARCHIVE_IN..."
+ echo "--> $P: Importing archive: $1..."
- test ! -f "$SB_ARCHIVE_IN" && die "archiveIn file not found: $SB_ARCHIVE_IN"
+ test ! -f "$1" && die "archiveIn file not found: $1"
cd "$TOPDIR"
- archpath=$(tar -tf "$SB_ARCHIVE_IN" | head -1)
+ archpath=$(tar -tf "$1" | head -1)
archdir=$(echo $archpath | cut -d/ -f1)
archsubdir=$(echo $archpath | cut -d/ -f2)
test -z "$archdir" -o -z "$archsubdir" && \
- die "Cannot determine archive content for $SB_ARCHIVE_IN"
+ die "Cannot determine archive content for $1"
if [ -d "$archsubdir" ]; then
# We already have this subdir in the cache, make a backup
@@ -124,8 +124,8 @@ importArchive () {
mkdir $archsubdir
fi
- if ! tar -xf "$SB_ARCHIVE_IN"; then
- echo "--> $P: Error $? unpacking archive: $SB_ARCHIVE_IN"
+ if ! tar -xf "$1"; then
+ echo "--> $P: Error $? unpacking archive: $1"
fi
# Move the unpacked files and remove the temporary archive directory
@@ -422,9 +422,17 @@ if [ -n "$SB_ARCHIVE_OUT" ]; then
fi
#
-# If --archiveIn requested, import the file now
+# If --archiveIn requested, import the file(s) now
#
-test -n "$SB_ARCHIVE_IN" && importArchive "$SB_ARCHIVE_IN"
+if [ -n "$SB_ARCHIVE_IN" ]
+then
+ IFS=","
+ for f in $SB_ARCHIVE_IN
+ do
+ f="${f# }"; f="${f% }" # strip leading or trailing space
+ importArchive "$f"
+ done
+fi
#
# Set arguments for (program) execution
OpenPOWER on IntegriCloud