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

[macOS] solve package error if packaging failed before #1104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
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