From ce7f5023babdbe44450847fc8dff954e427ae1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 24 Jun 2025 12:38:16 +0200 Subject: [PATCH 1/4] add ' || true' to grep commands --- create_tarball.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/create_tarball.sh b/create_tarball.sh index bae66fb8..4225d6ce 100755 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -49,17 +49,17 @@ module_files_list=${tmpdir}/module_files.list.txt if [ -d ${eessi_version}/software/${os}/${cpu_arch_subdir}/.lmod ]; then # include Lmod cache and configuration file (lmodrc.lua), # skip whiteout files and backup copies of Lmod cache (spiderT.old.*) - find ${eessi_version}/software/${os}/${cpu_arch_subdir}/.lmod -type f | egrep -v '/\.wh\.|spiderT.old' >> ${files_list} + find ${eessi_version}/software/${os}/${cpu_arch_subdir}/.lmod -type f | egrep -v '/\.wh\.|spiderT.old' >> ${files_list} || true # Make sure we don't exit because of set -e if grep doesn't return a match fi # include scripts that were copied by install_scripts.sh, which we want to ship in EESSI repository if [ -d ${eessi_version}/scripts ]; then - find ${eessi_version}/scripts -type f | grep -v '/\.wh\.' >> ${files_list} + find ${eessi_version}/scripts -type f | grep -v '/\.wh\.' >> ${files_list} || true # Make sure we don't exit because of set -e if grep doesn't return a match fi # also include init, which is also copied by install_scripts.sh if [ -d ${eessi_version}/init ]; then - find ${eessi_version}/init -type f | grep -v '/\.wh\.' >> ${files_list} + find ${eessi_version}/init -type f | grep -v '/\.wh\.' >> ${files_list} || true # Make sure we don't exit because of set -e if grep doesn't return a match fi # consider both CPU-only and accelerator subdirectories From baf948cd15d85f64ba1a9d1066e5ba7e275bfe38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 24 Jun 2025 13:59:52 +0200 Subject: [PATCH 2/4] let find commands ignore whiteout files --- create_tarball.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/create_tarball.sh b/create_tarball.sh index 4225d6ce..16cc96dd 100755 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -48,18 +48,18 @@ module_files_list=${tmpdir}/module_files.list.txt if [ -d ${eessi_version}/software/${os}/${cpu_arch_subdir}/.lmod ]; then # include Lmod cache and configuration file (lmodrc.lua), - # skip whiteout files and backup copies of Lmod cache (spiderT.old.*) - find ${eessi_version}/software/${os}/${cpu_arch_subdir}/.lmod -type f | egrep -v '/\.wh\.|spiderT.old' >> ${files_list} || true # Make sure we don't exit because of set -e if grep doesn't return a match + # skip whiteout files (.wh.*) and backup copies of Lmod cache (spiderT.old.*) + find ${eessi_version}/software/${os}/${cpu_arch_subdir}/.lmod -type f \( \! -name 'spiderT.old.*' -a \! -name '.wh.*' \) >> ${files_list} fi # include scripts that were copied by install_scripts.sh, which we want to ship in EESSI repository if [ -d ${eessi_version}/scripts ]; then - find ${eessi_version}/scripts -type f | grep -v '/\.wh\.' >> ${files_list} || true # Make sure we don't exit because of set -e if grep doesn't return a match + find ${eessi_version}/scripts -type f \! -name '.wh.*' >> ${files_list} fi # also include init, which is also copied by install_scripts.sh if [ -d ${eessi_version}/init ]; then - find ${eessi_version}/init -type f | grep -v '/\.wh\.' >> ${files_list} || true # Make sure we don't exit because of set -e if grep doesn't return a match + find ${eessi_version}/init -type f \! -name '.wh.*' >> ${files_list} fi # consider both CPU-only and accelerator subdirectories @@ -67,12 +67,12 @@ for subdir in ${cpu_arch_subdir} ${cpu_arch_subdir}/accel/${accel_subdir}; do if [ -d ${eessi_version}/software/${os}/${subdir}/modules ]; then # module files - find ${eessi_version}/software/${os}/${subdir}/modules -type f | grep -v '/\.wh\.' >> ${files_list} || true # Make sure we don't exit because of set -e if grep doesn't return a match + find ${eessi_version}/software/${os}/${subdir}/modules -type f \! -name '.wh.*' >> ${files_list} # module symlinks - find ${eessi_version}/software/${os}/${subdir}/modules -type l | grep -v '/\.wh\.' >> ${files_list} || true # Make sure we don't exit because of set -e if grep doesn't return a match + find ${eessi_version}/software/${os}/${subdir}/modules -type l \! -name '.wh.*' >> ${files_list} # module files and symlinks - find ${eessi_version}/software/${os}/${subdir}/modules/all -type f -o -type l \ - | grep -v '/\.wh\.' | grep -v '/\.modulerc\.lua' | sed -e 's/.lua$//' | sed -e 's@.*/modules/all/@@g' | sort -u \ + find ${eessi_version}/software/${os}/${subdir}/modules/all -type f -o -type l \! -name '.wh.*' \ + | grep -v '/\.modulerc\.lua' | sed -e 's/.lua$//' | sed -e 's@.*/modules/all/@@g' | sort -u \ >> ${module_files_list} fi From b8c2384af4bfa8468f047efb2c8d60485027cfca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 24 Jun 2025 14:21:23 +0200 Subject: [PATCH 3/4] combine file types for modules to get rid of OR operator --- create_tarball.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create_tarball.sh b/create_tarball.sh index 16cc96dd..8ec4aefa 100755 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -71,7 +71,7 @@ for subdir in ${cpu_arch_subdir} ${cpu_arch_subdir}/accel/${accel_subdir}; do # module symlinks find ${eessi_version}/software/${os}/${subdir}/modules -type l \! -name '.wh.*' >> ${files_list} # module files and symlinks - find ${eessi_version}/software/${os}/${subdir}/modules/all -type f -o -type l \! -name '.wh.*' \ + find ${eessi_version}/software/${os}/${subdir}/modules/all -type f,l \! -name '.wh.*' \ | grep -v '/\.modulerc\.lua' | sed -e 's/.lua$//' | sed -e 's@.*/modules/all/@@g' | sort -u \ >> ${module_files_list} fi From 1fa847697448cc0e280db2e95c17d8fa4aef3d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Tue, 24 Jun 2025 14:27:23 +0200 Subject: [PATCH 4/4] get rid of one more grep command --- create_tarball.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/create_tarball.sh b/create_tarball.sh index 8ec4aefa..b17698ce 100755 --- a/create_tarball.sh +++ b/create_tarball.sh @@ -85,8 +85,7 @@ for subdir in ${cpu_arch_subdir} ${cpu_arch_subdir}/accel/${accel_subdir}; do # installation directories), the procedure will likely not work. for package_version in $(cat ${module_files_list}); do echo "handling ${package_version}" - ls -d ${eessi_version}/software/${os}/${subdir}/software/${package_version} \ - | grep -v '/\.wh\.' >> ${files_list} || true # Make sure we don't exit because of set -e if grep doesn't return a match + find ${eessi_version}/software/${os}/${subdir}/software/${package_version} -maxdepth 0 -type d \! -name '.wh.*' >> ${files_list} done fi done