Skip to content

Commit baf948c

Browse files
committed
let find commands ignore whiteout files
1 parent ce7f502 commit baf948c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

create_tarball.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,31 +48,31 @@ module_files_list=${tmpdir}/module_files.list.txt
4848

4949
if [ -d ${eessi_version}/software/${os}/${cpu_arch_subdir}/.lmod ]; then
5050
# include Lmod cache and configuration file (lmodrc.lua),
51-
# skip whiteout files and backup copies of Lmod cache (spiderT.old.*)
52-
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
51+
# skip whiteout files (.wh.*) and backup copies of Lmod cache (spiderT.old.*)
52+
find ${eessi_version}/software/${os}/${cpu_arch_subdir}/.lmod -type f \( \! -name 'spiderT.old.*' -a \! -name '.wh.*' \) >> ${files_list}
5353
fi
5454

5555
# include scripts that were copied by install_scripts.sh, which we want to ship in EESSI repository
5656
if [ -d ${eessi_version}/scripts ]; then
57-
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
57+
find ${eessi_version}/scripts -type f \! -name '.wh.*' >> ${files_list}
5858
fi
5959

6060
# also include init, which is also copied by install_scripts.sh
6161
if [ -d ${eessi_version}/init ]; then
62-
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
62+
find ${eessi_version}/init -type f \! -name '.wh.*' >> ${files_list}
6363
fi
6464

6565
# consider both CPU-only and accelerator subdirectories
6666
for subdir in ${cpu_arch_subdir} ${cpu_arch_subdir}/accel/${accel_subdir}; do
6767

6868
if [ -d ${eessi_version}/software/${os}/${subdir}/modules ]; then
6969
# module files
70-
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
70+
find ${eessi_version}/software/${os}/${subdir}/modules -type f \! -name '.wh.*' >> ${files_list}
7171
# module symlinks
72-
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
72+
find ${eessi_version}/software/${os}/${subdir}/modules -type l \! -name '.wh.*' >> ${files_list}
7373
# module files and symlinks
74-
find ${eessi_version}/software/${os}/${subdir}/modules/all -type f -o -type l \
75-
| grep -v '/\.wh\.' | grep -v '/\.modulerc\.lua' | sed -e 's/.lua$//' | sed -e 's@.*/modules/all/@@g' | sort -u \
74+
find ${eessi_version}/software/${os}/${subdir}/modules/all -type f -o -type l \! -name '.wh.*' \
75+
| grep -v '/\.modulerc\.lua' | sed -e 's/.lua$//' | sed -e 's@.*/modules/all/@@g' | sort -u \
7676
>> ${module_files_list}
7777
fi
7878

0 commit comments

Comments
 (0)