Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to match neurodatascience/nipoppy:main #72

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions nipoppy/workflow/dicom_org/shell_utils/make_squash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# ========== SETTINGS ==========
# NOTE: fstime is set (to arbitrary value) so that checksums are the same
SQUASHFS_OPTIONS="-no-progress -keep-as-directory -all-root -processors 1 -no-duplicates -wildcards -fstime 1689602400"
COMPRESS_OPTIONS="-noD -noI -noX"
NOCOMPRESS_OPTIONS="-noD -noI -noX"

BASENAME="$(basename $0)"
EXAMPLE_CALL="$BASENAME --exclude exclude.txt --move /data output.squashfs dirA fileB"
Expand All @@ -26,7 +26,7 @@ where:
-e/--exclude exclude files matching patterns in FILE (passed to -ef argument of mksquashfs)
-m/--move move files into a subdirectory of the squashfs
-p/--no-chmod do not set file permissions before squashing (to use if file permissions are already correct)
-c/--no-compress do not compress data, inode table or extended attributes (use options '$COMPRESS_OPTIONS' in mksquashfs call)
-c/--no-compress do not compress data, inode table or extended attributes (use options '$NOCOMPRESS_OPTIONS' in mksquashfs call)
-d/--dry-run print commands but do not execute them
-h/--help print this message and exit

Expand Down Expand Up @@ -169,7 +169,7 @@ fi
if [ ! -z "$NO_COMPRESS" ]
then
info "Not doing compression"
SQUASHFS_OPTIONS="$SQUASHFS_OPTIONS $COMPRESS_OPTIONS"
SQUASHFS_OPTIONS="$SQUASHFS_OPTIONS $NOCOMPRESS_OPTIONS"
fi

if [ ! -z "$NO_CHMOD" ]
Expand All @@ -191,6 +191,10 @@ then
done
fi

# make output directory
run "mkdir -p $(dirname $FPATH_OUTPUT)"

# squash
run "mksquashfs $PATHS_TO_SQUASH $FPATH_OUTPUT $SQUASHFS_OPTIONS"

if [ ! -z "$DPATH_IN_SQUASH" ]
Expand All @@ -203,7 +207,7 @@ then
touch $TMP_FILE
trap 'rm -f "$TMP_FILE"' EXIT

# move to $DATA_PATH
# move to $DPATH_IN_SQUASH
while [ ! "$DPATH_IN_SQUASH" == "/" ]
do
DEST="$(basename $DPATH_IN_SQUASH)"
Expand Down