From 092cb49cf76735df48110fe86a1e9bb4e2c571c0 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Fri, 17 Mar 2023 12:42:05 +0100 Subject: [PATCH 1/4] attempt to fix issue #225 --- create_tarball.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/create_tarball.sh b/create_tarball.sh index 56ac8ab7ad..08dc4f4d7e 100755 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -38,6 +38,7 @@ cd ${overlay_upper_dir}/versions/ echo ">> Collecting list of files/directories to include in tarball via ${PWD}..." files_list=${tmpdir}/files.list.txt +module_files_list=${tmpdir}/module_files.list.txt if [ -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/.lmod ]; then # include Lmod cache and configuration file (lmodrc.lua), @@ -49,12 +50,26 @@ if [ -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules ]; then find ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules -type f | grep -v '/\.wh\.' >> ${files_list} # module symlinks find ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules -type l | grep -v '/\.wh\.' >> ${files_list} + # module files and symlinks + find ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules -type f -o -type l \ + | grep -v '/\.wh\.' | sed -e 's/.lua$//' | awk -F'/' '{printf "%s/%s\n", $(NF-1), $NF}' | sort | uniq \ + >> ${module_files_list} fi if [ -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/software ]; then # installation directories - ls -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/software/*/* | grep -v '/\.wh\.' >> ${files_list} + # ls -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/software/*/* | grep -v '/\.wh\.' >> ${files_list} + for package_version in $(cat ${module_files_list}); do + echo "handling ${package_version}" + ls -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/software/${package_version} \ + | grep -v '/\.wh\.' >> ${files_list} + done fi +echo "wrote file list to ${files_list}" +cat ${files_list} +echo "wrote module file list to ${module_files_list}" +cat ${module_files_list} + topdir=${cvmfs_repo}/versions/ echo ">> Creating tarball ${target_tgz} from ${topdir}..." From 7a750d508d00821cd5b90e38b1471b6a2433a77e Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Fri, 17 Mar 2023 19:17:02 +0100 Subject: [PATCH 2/4] add comments, small improvements --- create_tarball.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/create_tarball.sh b/create_tarball.sh index 08dc4f4d7e..9381407d10 100755 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -51,13 +51,12 @@ if [ -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules ]; then # module symlinks find ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules -type l | grep -v '/\.wh\.' >> ${files_list} # module files and symlinks - find ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules -type f -o -type l \ + find ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules/all -type f -o -type l \ | grep -v '/\.wh\.' | sed -e 's/.lua$//' | awk -F'/' '{printf "%s/%s\n", $(NF-1), $NF}' | sort | uniq \ >> ${module_files_list} fi if [ -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/software ]; then - # installation directories - # ls -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/software/*/* | grep -v '/\.wh\.' >> ${files_list} + # installation directories but only those for which module files were created for package_version in $(cat ${module_files_list}); do echo "handling ${package_version}" ls -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/software/${package_version} \ @@ -65,6 +64,7 @@ if [ -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/software ]; then done fi +# add a bit debug output echo "wrote file list to ${files_list}" cat ${files_list} echo "wrote module file list to ${module_files_list}" From 69f662795dca88559f4885e5fa80a16c0da655fe Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Fri, 17 Mar 2023 22:13:21 +0100 Subject: [PATCH 3/4] improve handling of potentially non existing list files --- create_tarball.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/create_tarball.sh b/create_tarball.sh index 9381407d10..fd04a195cb 100755 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -55,7 +55,7 @@ if [ -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules ]; then | grep -v '/\.wh\.' | sed -e 's/.lua$//' | awk -F'/' '{printf "%s/%s\n", $(NF-1), $NF}' | sort | uniq \ >> ${module_files_list} fi -if [ -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/software ]; then +if [ -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/software -a -r ${module_files_list} ]; then # installation directories but only those for which module files were created for package_version in $(cat ${module_files_list}); do echo "handling ${package_version}" @@ -66,9 +66,9 @@ fi # add a bit debug output echo "wrote file list to ${files_list}" -cat ${files_list} +[ -r ${files_list} ] && cat ${files_list} echo "wrote module file list to ${module_files_list}" -cat ${module_files_list} +[ -r ${module_files_list} ] && cat ${module_files_list} topdir=${cvmfs_repo}/versions/ From 4d132273569f6d40e503bdd48b5b3aca88f7c907 Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Tue, 11 Apr 2023 12:34:39 +0200 Subject: [PATCH 4/4] update determining directories to tar + adding a note on assumptions made --- create_tarball.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/create_tarball.sh b/create_tarball.sh index fd04a195cb..b6c72b341d 100755 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -52,11 +52,16 @@ if [ -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules ]; then find ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules -type l | grep -v '/\.wh\.' >> ${files_list} # module files and symlinks find ${pilot_version}/software/${os}/${cpu_arch_subdir}/modules/all -type f -o -type l \ - | grep -v '/\.wh\.' | sed -e 's/.lua$//' | awk -F'/' '{printf "%s/%s\n", $(NF-1), $NF}' | sort | uniq \ + | grep -v '/\.wh\.' | sed -e 's/.lua$//' | sed -e 's@.*/modules/all/@@g' | sort -u \ >> ${module_files_list} fi if [ -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/software -a -r ${module_files_list} ]; then # installation directories but only those for which module files were created + # Note, we assume that module names (as defined by 'PACKAGE_NAME/VERSION.lua' + # using EasyBuild's standard module naming scheme) match the name of the + # software installation directory (expected to be 'PACKAGE_NAME/VERSION/'). + # If either side changes (module naming scheme or naming of software + # installation directories), the procedure will likely not work. for package_version in $(cat ${module_files_list}); do echo "handling ${package_version}" ls -d ${pilot_version}/software/${os}/${cpu_arch_subdir}/software/${package_version} \