Skip to content

Commit

Permalink
Merge branch 'master' into feature/LocateSSHCommands
Browse files Browse the repository at this point in the history
  • Loading branch information
uenz authored Nov 2, 2021
2 parents 6bebb81 + 6ebda3a commit 2004997
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 24 deletions.
2 changes: 2 additions & 0 deletions SparkleShare/Common/AboutController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ void CheckForNewVersion ()
UpdateLabelEvent ("Checking for updates…");
Thread.Sleep (500);

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

var web_client = new WebClient ();
var uri = new Uri ("https://www.sparkleshare.org/version");

Expand Down
12 changes: 6 additions & 6 deletions SparkleShare/Mac/checkGit.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh
function abspath()
{
case "${1}" in
Expand Down Expand Up @@ -31,12 +31,12 @@ set -e

if [[ ! -f ${projectFolder}/${gitName} ]];
then
curl --silent --location ${gitDownload} > ${gitName}
test -e ${gitName} || { echo "Failed to download git"; exit 1; }
curl --silent --location ${gitDownload} > ${projectFolder}/${gitName}
test -e ${projectFolder}/${gitName} || { echo "Failed to download git"; exit 1; }

printf "${gitSHA256} ${gitName}" | shasum --check --algorithm 256
printf "${gitSHA256} ${projectFolder}/${gitName}" | shasum --check --algorithm 256

fi

rm git.tar.gz
ln -s $gitName git.tar.gz
rm -f ${projectFolder}/git.tar.gz
ln -s ${projectFolder}/$gitName ${projectFolder}/git.tar.gz
4 changes: 2 additions & 2 deletions SparkleShare/Mac/postBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export PATH=/usr/local/bin:/opt/local/bin:/Library/Frameworks/Mono.framework/Ver

${projectFolder}/checkGit.sh
rm -rf ${bundle}/Contents/Resources/git
mkdir ${bundle}/Contents/Resources/git
mkdir -p ${bundle}/Contents/Resources/git
tar -x -f ${projectFolder}/git.tar.gz --directory ${bundle}/Contents/Resources/git
cp -R SparkleShareInviteOpener.app ${bundle}/Contents/Resources
cp -R ${projectFolder}/SparkleShareInviteOpener.app ${bundle}/Contents/Resources
7 changes: 7 additions & 0 deletions Sparkles/Git/Git.Fetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ public override string Complete (StorageType selected_storage_type)
File.WriteAllText (identifier_path, identifier);
File.SetAttributes (identifier_path, FileAttributes.Hidden);

// The repo is freshly cloned and no config user.name is set yet, so temporary use SparkleShare
// to avoid error 'TELL ME WHO YOU ARE', later on this will be handled in Commit of Git.Repository
var git_config = new GitCommand(TargetFolder, "config user.name \"SparkleShare\"");
git_config.StartAndWaitForExit();
git_config = new GitCommand(TargetFolder, "config user.email \"[email protected]\"");
git_config.StartAndWaitForExit();

// We can't do the "commit --all" shortcut because it doesn't add untracked files
var git_add = new GitCommand (TargetFolder, "add .sparkleshare");
var git_commit = new GitCommand (TargetFolder,
Expand Down
42 changes: 26 additions & 16 deletions Sparkles/InstallationInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,35 @@ public static string OperatingSystemVersion {
get {
if (OperatingSystem == OS.macOS) {
var uname = new Command ("sw_vers", "-productVersion", write_output: false);
string output = uname.StartAndReadStandardOutput ();
string version = output;
string version = uname.StartAndReadStandardOutput ();

//
string[] version_elements= version.Split('.');

// Parse the version number between the periods (e.g. "10.12.1" -> 12)
output = output.Substring (output.IndexOf (".") + 1);
if (output.LastIndexOf (".") != -1) {
output = output.Substring (0, output.LastIndexOf ("."));
}
string release = "Unreleased Version";

switch (int.Parse (output)) {
case 7: release = "Lion"; break;
case 8: release = "Mountain Lion"; break;
case 9: release = "Mavericks"; break;
case 10: release = "Yosemite"; break;
case 11: release = "El Capitan"; break;
case 12: release = "Sierra"; break;
case 13: release = "High Sierra"; break;
case 14: release = "Mojave"; break;
if ((version_elements.Length) >= 2) {
switch (int.Parse (version_elements [0])) {
case 10:
// Parse the version number between the periods (e.g. "10.12.1" -> 12)
switch (int.Parse (version_elements [0])) {
case 7: release = "Lion"; break;
case 8: release = "Mountain Lion"; break;
case 9: release = "Mavericks"; break;
case 10: release = "Yosemite"; break;
case 11: release = "El Capitan"; break;
case 12: release = "Sierra"; break;
case 13: release = "High Sierra"; break;
case 14: release = "Mojave"; break;
case 15: release = "Catalina"; break;
}
break;

case 11:
release = "BigSur"; break;
case 12:
release = "Monterey"; break;
}
}

return string.Format ("{0} ({1})", version, release);
Expand Down

0 comments on commit 2004997

Please sign in to comment.