Skip to content

Commit

Permalink
{macOS} solve package error if packaging failed before
Browse files Browse the repository at this point in the history
  • Loading branch information
mathildemerle committed Apr 12, 2023
1 parent 595a2ce commit 783fed7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
File renamed without changes.
9 changes: 6 additions & 3 deletions packaging/apple/mac_packager.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ done

#Run fancy packaging apple script

\cp -f @medInria_SOURCE_DIR@/utils/osx_packaging/BaseMedinriaPackage.sparseimage.gz @PROJECT_BINARY_DIR@/MedinriaPackage.sparseimage.gz
# Clean volumes if some packaging failed before, Zsh style
for volume in /Volumes/medInria*; do diskutil unmount $volume; done

\cp -f ${CMAKE_SOURCE_DIR}/packaging/apple/BaseMedinriaPackage.sparseimage.gz @PROJECT_BINARY_DIR@/MedinriaPackage.sparseimage.gz
cd @PROJECT_BINARY_DIR@
gunzip -f MedinriaPackage.sparseimage.gz

devName=`hdiutil attach -readwrite -noverify -noautoopen MedinriaPackage.sparseimage | egrep '^/dev/' | sed 1q | awk '{print $1}'`
diskutil rename "medInria base" "medInria @MEDINRIA_SUPERBUILD_VERSION@"
\cp -rf @medInria_BINARY_DIR@/bin/TmpInstall/medInria.app /Volumes/"medInria @MEDINRIA_SUPERBUILD_VERSION@"/
diskutil rename "medInria base" "medInria.@MEDINRIA_SUPERBUILD_VERSION@"
\cp -rf @medInria_BINARY_DIR@/bin/TmpInstall/medInria.app /Volumes/medInria.@MEDINRIA_SUPERBUILD_VERSION@/

sync
hdiutil detach $devName
Expand Down

0 comments on commit 783fed7

Please sign in to comment.