Refresh MacQetDeploy.sh scripts

This commit is contained in:
Laurent Trinques 2023-01-25 12:27:25 +01:00
parent ede9e7f063
commit 7db9430b3c

View File

@ -79,15 +79,11 @@ GITCOMMIT=$(git rev-parse --short HEAD)
A=$(git rev-list HEAD --count)
HEAD=$(($A+473))
#VERSION=$(cat sources/qet.h | grep "const QString version" | cut -d\" -f2 | cut -d\" -f1) #Find version tag in GIT sources/qet.h
#tagName=$(cat sources/qet.h | grep displayedVersion | cut -d\" -f2 | cut -d\" -f1) #Find displayedVersion tag in GIT sources/qet.h
VERSION=0.100
tagName=0.100-DEV
# On recupere le numero de version de l'originale
#tagName=$(sed -n "s/const QString displayedVersion =\(.*\)/\1/p" sources/qet.h | cut -d\" -f2 | cut -d\" -f1 )
VERSION=$(cat sources/qetversion.cpp | grep "return QVersionNumber{ 0, "| head -n 1| cut -c32-40| sed -e 's/,/./g' -e 's/ //g') #Find major, minor, and micro version numbers in sources/qetversion.cp
# Dmg de la dernière revision déjà créé
if [ -e "build-aux/mac-osx/${APPNAME} $tagName r$HEAD.dmg" ] ; then
if [ -e "build-aux/mac-osx/${APPNAME} $VERSION r$HEAD.dmg" ] ; then
echo "There are not new updates, make disk image can"
echo "take a lot of time (5 min). Can you continu?"
echo "[y/n]"
@ -101,41 +97,6 @@ if [ -e "build-aux/mac-osx/${APPNAME} $tagName r$HEAD.dmg" ] ; then
fi
### Version tag ####################################################
echo
echo "______________________________________________________________"
echo "Add version tag:"
echo "Adding the version tag..."
# On sauve l'orginale
mkdir temp
cp -Rf "sources/qet.h" "temp/qet.h"
# On modifie l'originale avec le numero de revision du depot svn
#sed -i "" "s/const QString displayedVersion =.*/const QString displayedVersion = \"$tagName r$GITCOMMIT\";/" sources/qet.h
# Apres la compilation
cleanVerionTag () {
echo
echo "______________________________________________________________"
echo "Clean version tag:"
# On remet le code source comme il etait
echo "Cleaning version tag..."
# On supprime le fichier modifier
rm -rf "sources/qet.h"
# On remet l'ancien original
cp -Rf "temp/qet.h" "sources/qet.h"
# On suprime l'ancienne copie
rm -rf "temp"
}
### make install ####################################################
echo
@ -193,7 +154,7 @@ fi
cp -R ${current_dir}/misc/Info.plist qelectrotech.app/Contents/
cp -R ${current_dir}/ico/mac_icon/*.icns qelectrotech.app/Contents/Resources/
# On rajoute le numero de version pour "cmd + i"
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $tagName r$HEAD" "qelectrotech.app/Contents/Info.plist" # Version number
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $VERSION r$HEAD" "qelectrotech.app/Contents/Info.plist" # Version number
### copy over frameworks ############################################
@ -267,11 +228,11 @@ echo 'Preparing (removing hold files)... '
if [ -e "/Volumes/${APPNAME}" ]; then
hdiutil detach -quiet "/Volumes/${APPNAME}"
fi
if [ -e "${APPNAME} $tagName r$HEAD.dmg" ] ; then
rm -f "${APPNAME} $tagName r$HEAD.dmg"
if [ -e "${APPNAME} $VERSION r$HEAD.dmg" ] ; then
rm -f "${APPNAME} $VERSION r$HEAD.dmg"
fi
if [ -e "build-aux/mac-osx/${APPNAME} $tagName r$HEAD.dmg" ] ; then
rm -f "build-aux/mac-osx/${APPNAME} $tagName r$HEAD.dmg"
if [ -e "build-aux/mac-osx/${APPNAME} $VERSION r$HEAD.dmg" ] ; then
rm -f "build-aux/mac-osx/${APPNAME} $VERSION r$HEAD.dmg"
fi
if [ -e $imagedir ] ; then
rm -rf $imagedir
@ -294,13 +255,13 @@ strip "$imagedir/$APPBIN"
# Creating a disk image from a folder
echo 'Creating disk image... '
hdiutil create -quiet -ov -srcfolder $imagedir -format UDBZ -volname "${APPNAME}" "${APPNAME} $tagName r$HEAD.dmg"
hdiutil internet-enable -yes -quiet "${APPNAME} $tagName r$HEAD.dmg"
hdiutil create -quiet -ov -srcfolder $imagedir -format UDBZ -volname "${APPNAME}" "${APPNAME} $VERSION r$HEAD.dmg"
hdiutil internet-enable -yes -quiet "${APPNAME} $VERSION r$HEAD.dmg"
# Clean up disk folder
echo 'Cleaning up... '
cp -Rf "${APPNAME} $tagName r$HEAD.dmg" "build-aux/mac-osx/${APPNAME} $tagName r$HEAD.dmg"
rm -f "${APPNAME} $tagName r$HEAD.dmg"
cp -Rf "${APPNAME} $VERSION r$HEAD.dmg" "build-aux/mac-osx/${APPNAME} $VERSION r$HEAD.dmg"
rm -f "${APPNAME} $VERSION r$HEAD.dmg"
rm -rf $imagedir
rm -rf $BUNDLE
@ -336,14 +297,14 @@ echo The disque image is in the folder \'build-aux/mac-osx\'.
#rsync to TF DMG builds
echo -e "\033[1;31mWould you like to upload MacOS packages "${APPNAME}"-"$tagName"_"r$HEAD.dmg", n/Y?.\033[m"
echo -e "\033[1;31mWould you like to upload MacOS packages "${APPNAME}"-"$VERSION"_"r$HEAD.dmg", n/Y?.\033[m"
read a
if [[ $a == "Y" || $a == "y" ]]; then
cp -Rf "build-aux/mac-osx/${APPNAME} $tagName r$HEAD.dmg" /Users/laurent/MAC_OS_X/
cp -Rf "build-aux/mac-osx/${APPNAME} $VERSION r$HEAD.dmg" /Users/laurent/MAC_OS_X/
rsync -e ssh -av --delete-after --no-owner --no-g --chmod=g+w --progress --exclude='.DS_Store' /Users/laurent/MAC_OS_X/ scorpio810@ssh.tuxfamily.org:/home/qet/qet-repository/builds/MAC_OS_X/
if [ $? != 0 ]; then
{
echo "RSYNC ERROR: problem syncing ${APPNAME} $tagName r$HEAD.dmg"
echo "RSYNC ERROR: problem syncing ${APPNAME} $VERSION r$HEAD.dmg"
rsync -e ssh -av --delete-after --no-owner --no-g --chmod=g+w --progress --exclude='.DS_Store' /Users/laurent/MAC_OS_X/ scorpio810@ssh.tuxfamily.org:/home/qet/qet-repository/builds/MAC_OS_X/
} fi