Skip to content

Commit

Permalink
Update to match neurodatascience/nipoppy:main (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
michellewang authored Oct 12, 2023
2 parents 5dea76d + 2c72f13 commit 391a52b
Showing 1 changed file with 8 additions and 4 deletions.
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

0 comments on commit 391a52b

Please sign in to comment.