@@ -38,6 +38,7 @@ cd ${overlay_upper_dir}/versions/
3838echo " >> Collecting list of files/directories to include in tarball via ${PWD} ..."
3939
4040files_list=${tmpdir} /files.list.txt
41+ module_files_list=${tmpdir} /module_files.list.txt
4142
4243if [ -d ${pilot_version} /software/${os} /${cpu_arch_subdir} /.lmod ]; then
4344 # include Lmod cache and configuration file (lmodrc.lua),
@@ -49,12 +50,26 @@ if [ -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules ]; then
4950 find ${pilot_version} /software/${os} /${cpu_arch_subdir} /modules -type f | grep -v ' /\.wh\.' >> ${files_list}
5051 # module symlinks
5152 find ${pilot_version} /software/${os} /${cpu_arch_subdir} /modules -type l | grep -v ' /\.wh\.' >> ${files_list}
53+ # module files and symlinks
54+ find ${pilot_version} /software/${os} /${cpu_arch_subdir} /modules/all -type f -o -type l \
55+ | grep -v ' /\.wh\.' | sed -e ' s/.lua$//' | awk -F' /' ' {printf "%s/%s\n", $(NF-1), $NF}' | sort | uniq \
56+ >> ${module_files_list}
5257fi
53- if [ -d ${pilot_version} /software/${os} /${cpu_arch_subdir} /software ]; then
54- # installation directories
55- ls -d ${pilot_version} /software/${os} /${cpu_arch_subdir} /software/* /* | grep -v ' /\.wh\.' >> ${files_list}
58+ if [ -d ${pilot_version} /software/${os} /${cpu_arch_subdir} /software -a -r ${module_files_list} ]; then
59+ # installation directories but only those for which module files were created
60+ for package_version in $( cat ${module_files_list} ) ; do
61+ echo " handling ${package_version} "
62+ ls -d ${pilot_version} /software/${os} /${cpu_arch_subdir} /software/${package_version} \
63+ | grep -v ' /\.wh\.' >> ${files_list}
64+ done
5665fi
5766
67+ # add a bit debug output
68+ echo " wrote file list to ${files_list} "
69+ [ -r ${files_list} ] && cat ${files_list}
70+ echo " wrote module file list to ${module_files_list} "
71+ [ -r ${module_files_list} ] && cat ${module_files_list}
72+
5873topdir=${cvmfs_repo} /versions/
5974
6075echo " >> Creating tarball ${target_tgz} from ${topdir} ..."
0 commit comments