@@ -20,7 +20,7 @@ _usage() {
2020 echo " "
2121 echo -e " -b <path>\tbase path for source image builds"
2222 echo -e " -c <path>\tbuild context for the container image. Can be provided via CONTEXT_DIR env variable"
23- echo -e " -e <path>\textra src for the container image. Can be provided via EXTRA_SRC_DIR env variable "
23+ echo -e " -e <path>\textra src for the container image. Can be provided multiple times "
2424 echo -e " -s <path>\tdirectory of SRPMS to add. Can be provided via SRPM_DIR env variable"
2525 echo -e " -o <path>\toutput the OCI image to path. Can be provided via OUTPUT_DIR env variable"
2626 echo -e " -d <drivers>\tenumerate specific source drivers to run"
@@ -1032,11 +1032,15 @@ sourcedriver_extra_src_dir() {
10321032 local tarname
10331033 local mimetype
10341034 local source_info
1035+ local counter=0
10351036
1036- if [ -n " ${EXTRA_SRC_DIR} " ]; then
1037+ for extra_src_dir in " ${EXTRA_SRC_DIR_ARRAY[@]} "
1038+ do
1039+ _info " adding extra source directory $extra_src_dir "
10371040 _debug " $self : writing to $out_dir and $manifest_dir "
1038- tarname=" extra-src.tar"
1039- _tar -C " ${EXTRA_SRC_DIR} " \
1041+ tarname=" extra-src-${counter} .tar"
1042+ counter+=1
1043+ _tar -C " ${extra_src_dir} " \
10401044 --sort=name --mtime=@0 --owner=0 --group=0 --mode=' a+rw' --no-xattrs --no-selinux --no-acls \
10411045 -cf " ${out_dir} /${tarname} " .
10421046 mimetype=" $( file --brief --mime-type " ${out_dir} " /" ${tarname} " ) "
@@ -1056,14 +1060,14 @@ sourcedriver_extra_src_dir() {
10561060 if [ $ret -ne 0 ] ; then
10571061 return 1
10581062 fi
1059- fi
1063+ done
10601064}
10611065
10621066
10631067main () {
10641068 local base_dir
10651069 local input_context_dir
1066- local input_extra_src_dir
1070+ local input_extra_src_dir_array
10671071 local input_srpm_dir
10681072 local drivers
10691073 local image_ref
@@ -1080,6 +1084,8 @@ main() {
10801084 local unpack_dir
10811085 local work_dir
10821086
1087+ declare -a input_extra_src_dir_array
1088+
10831089 _init " ${@ } "
10841090 _subcommand " ${@ } "
10851091
@@ -1094,7 +1100,7 @@ main() {
10941100 input_context_dir=${OPTARG}
10951101 ;;
10961102 e)
1097- input_extra_src_dir= ${OPTARG}
1103+ input_extra_src_dir_array+=( " ${OPTARG} " )
10981104 ;;
10991105 d)
11001106 drivers=${OPTARG}
@@ -1143,7 +1149,7 @@ main() {
11431149 # These three variables are slightly special, in that they're globals that
11441150 # specific drivers will expect.
11451151 export CONTEXT_DIR=" ${CONTEXT_DIR:- $input_context_dir } "
1146- export EXTRA_SRC_DIR= " ${EXTRA_SRC_DIR :- $input_extra_src_dir } "
1152+ export EXTRA_SRC_DIR_ARRAY=( " ${input_extra_src_dir_array[@]} " )
11471153 export SRPM_DIR=" ${SRPM_DIR:- $input_srpm_dir } "
11481154
11491155 output_dir=" ${OUTPUT_DIR:- $output_dir } "
0 commit comments