Skip to content

Commit

Permalink
archive-builds.sh: Ignore non-directories in /package/pkg
Browse files Browse the repository at this point in the history
Some .have_archived_on_tape plain files have appeared in /package/pkg so
this script fails when it tries to change the current working directory
into a path which is not a directory.

Check that the path is a directory before changing into it. This can be
done with the existing check, because a check for a subdirectory implies
that the parent is a directory, too. However, we need to use absolute
pathnames, so modify the wildcard to produce absolute pathnames.
donald committed Feb 10, 2024
1 parent f871085 commit 3ebcf62
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/archive-build.sh
Original file line number Diff line number Diff line change
@@ -7,12 +7,11 @@ if [ "$(hostname -s)" != "ellie" ]; then
exit 1
fi

cd /package/pkg
umask 022

for d in *; do
cd /package/pkg/$d
if [[ -d build && $(stat --format=%U .) == "bin" ]]; then
for d in /package/pkg/*; do
if [[ -d $d/build && $(stat --format=%U $d) == "bin" ]]; then
cd $d
echo "archive $d/build"
tar --create --zstd --file build.tar.zstd build/ && rm -rf build
fi

0 comments on commit 3ebcf62

Please sign in to comment.