diff --git a/.gitignore b/.gitignore index 3c5d08c2..a864264b 100644 --- a/.gitignore +++ b/.gitignore @@ -18,8 +18,8 @@ obj/ git-* Sparkles/InstallationInfo.Directory.cs SparkleShare/Linux/sparkleshare -SparkleShare/Mac/git/* SparkleShare/Mac/git* +SparkleShare/Mac/*.tar.gz /sparkleshare-* desktop.ini _ReSharper.* diff --git a/SparkleShare/Mac/checkGit.sh b/SparkleShare/Mac/checkGit.sh index 2a18a1fa..9acee4d9 100755 --- a/SparkleShare/Mac/checkGit.sh +++ b/SparkleShare/Mac/checkGit.sh @@ -11,6 +11,8 @@ function abspath() esac } +export projectFolder=$(dirname $0) +export projectFolder=$(abspath ${projectFolder}) LINE=$(cat ${projectFolder}/git.download) TMP=() @@ -19,23 +21,22 @@ for val in $LINE ; do TMP+=("$val") done -export projectFolder=$(dirname $0) -export projectFolder=$(abspath ${projectFolder}) export gitDownload="${TMP[0]}" +export gitName=${gitDownload##*/} export gitSHA256="${TMP[1]}" + set -e -if [ ! -f ${projectFolder}/git.tar.gz ] +if [[ ! -f ${projectFolder}/${gitName} ]]; then - curl --silent --location ${gitDownload} > git.tar.gz - test -e git.tar.gz || { echo "Failed to download git"; exit 1; } + curl --silent --location ${gitDownload} > ${gitName} + test -e ${gitName} || { echo "Failed to download git"; exit 1; } - printf "${gitSHA256} git.tar.gz" | shasum --check --algorithm 256 + printf "${gitSHA256} ${gitName}" | shasum --check --algorithm 256 - mkdir git/ - tar xzf git.tar.gz --directory git/ - tar czf git.tar.gz git/ - rm -rf git/ fi + +rm git.tar.gz +ln -s $gitName git.tar.gz diff --git a/SparkleShare/Mac/config b/SparkleShare/Mac/config deleted file mode 100644 index 83138436..00000000 --- a/SparkleShare/Mac/config +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/SparkleShare/Mac/git.download b/SparkleShare/Mac/git.download index 6d45ac8e..84d2e19d 100644 --- a/SparkleShare/Mac/git.download +++ b/SparkleShare/Mac/git.download @@ -1 +1 @@ -https://github.com/desktop/dugite-native/releases/download/v2.16.2/dugite-native-v2.16.2-macOS-119.tar.gz 65d608eb16e0e262bae6bd7828b28cf640455e949003fec94c1233e084b9ccde +https://github.com/desktop/dugite-native/releases/download/v2.29.2-2/dugite-native-v2.29.2-f9ceb12-macOS.tar.gz ff16488ebbb3a0000fac34c8afc01bc4e839ad478717fbcbbe0c207642b5872c diff --git a/SparkleShare/Mac/packReleaseDist.sh b/SparkleShare/Mac/packReleaseDist.sh index 6305f7bb..352c6025 100755 --- a/SparkleShare/Mac/packReleaseDist.sh +++ b/SparkleShare/Mac/packReleaseDist.sh @@ -8,12 +8,17 @@ echo packing ${bundle} for release without Mono framework dependency export MONO_PATH=`readlink /Library/Frameworks/Mono.framework/Versions/Current` export PKG_CONFIG_PATH=/usr/lib/pkgconfig:${MONO_PATH}/lib/pkgconfig -export AS="as -arch i386" -export CC="cc -arch i386 -lobjc -liconv -framework Foundation" export PATH=/usr/local/bin:/opt/local/bin:/Library/Frameworks/Mono.framework/Versions/Current/bin:/usr/bin:/bin cd ${bundle}/Contents/MonoBundle/ # merge all Assemblies into one Mac binary -mkbundle --static --deps --config ./config -o ../MacOS/SparkleShare SparkleShare.exe Sparkles.dll Xamarin.Mac.dll Sparkles.Git.dll +mkbundle \ + --simple \ + -v \ + --config ./config \ + --library libxammac.dylib \ + --library libmono-native-compat.0.dylib \ + -o ../MacOS/SparkleShare \ + SparkleShare.exe Sparkles.dll Sparkles.Git.dll rm *.dll *.exe diff --git a/SparkleShare/Mac/postBuild.sh b/SparkleShare/Mac/postBuild.sh index 6fe1222d..53d5d0b7 100755 --- a/SparkleShare/Mac/postBuild.sh +++ b/SparkleShare/Mac/postBuild.sh @@ -9,6 +9,7 @@ echo Postprocessing ${bundle}... export PATH=/usr/local/bin:/opt/local/bin:/Library/Frameworks/Mono.framework/Versions/Current/bin:/usr/bin:/bin ${projectFolder}/checkGit.sh -tar -x -f ${projectFolder}/git.tar.gz --directory ${bundle}/Contents/Resources +rm -rf ${bundle}/Contents/Resources/git +mkdir ${bundle}/Contents/Resources/git +tar -x -f ${projectFolder}/git.tar.gz --directory ${bundle}/Contents/Resources/git cp -R SparkleShareInviteOpener.app ${bundle}/Contents/Resources -cp config ${bundle}/Contents/MonoBundle diff --git a/Sparkles/Git/Git.Repository.cs b/Sparkles/Git/Git.Repository.cs index bcee17a9..ac19964c 100644 --- a/Sparkles/Git/Git.Repository.cs +++ b/Sparkles/Git/Git.Repository.cs @@ -936,7 +936,12 @@ namespace Sparkles.Git { string HEAD_file_path = Path.Combine (child_path, "HEAD"); if (File.Exists (HEAD_file_path)) { - File.Move (HEAD_file_path, HEAD_file_path + ".backup"); + string HEAD_file_path_backup = Path.Combine (child_path, "HEAD.backup"); + if (File.Exists (HEAD_file_path_backup)) { + File.Delete (HEAD_file_path_backup); + } + + File.Move (HEAD_file_path, HEAD_file_path_backup); Logger.LogInfo ("Git", Name + " | Renamed " + HEAD_file_path); }