- if [ -n "$copy_all" ]
- then
- # bulk copy
- mkdir -p "$(dirname "$module_destdir")"
- cp -a "$module_srcdir" "$module_destdir"
- else
- mkdir -p "$module_destdir"
- # only copy sources & license
- license="$module_srcdir/LICENSE"
- cp -a "$module_srcdir"/*.[ch] "$module_destdir"
- [ -e "$license" ] && cp -a "$license" "$module_destdir"
- fi
+ mkdir -p "$module_destdir"
+ # Copy license
+ license="$module_srcdir/LICENSE"
+ [ -e "$license" ] && cp -a "$license" "$module_destdir"
+ for f in $("$modfiles" $MODULES_ARGS --no-license --git-only "$module_dir"); do
+ mkdir -p $(dirname "$module_destdir"/"$f")
+ cp "$module_srcdir"/$f "$module_destdir"/$f
+ done