Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/macdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémie Laval <jeremie.laval@gmail.com>2012-12-12 04:23:54 +0400
committerJérémie Laval <jeremie.laval@gmail.com>2012-12-12 04:24:29 +0400
commite4a6007f5e61340a2c03cc4b79990722106498b5 (patch)
treeeb3fc5d345c2b07de9774db50b922183f1b6b1c1
parentf9458b5e53e69ed8a9c1af73484ea30449ef33cb (diff)
[macdoc] Fix freshness checks to take into account /Developer under Xcode and XamMac
-rw-r--r--AppDelegate.cs3
-rw-r--r--AppleDocHandler.cs6
2 files changed, 5 insertions, 4 deletions
diff --git a/AppDelegate.cs b/AppDelegate.cs
index 8d2eb13..679a7a7 100644
--- a/AppDelegate.cs
+++ b/AppDelegate.cs
@@ -147,7 +147,7 @@ namespace macdoc
bool docOutdated = AppleDocHandler.CheckAppleDocFreshness (ProductUtils.GetDocFeedForProduct (p),
out infos);
if (!docOutdated)
- mergeOutdated = AppleDocHandler.CheckMergedDocumentationFreshness (infos);
+ mergeOutdated = AppleDocHandler.CheckMergedDocumentationFreshness (infos, p);
return Tuple.Create (docOutdated, mergeOutdated);
});
}).ContinueWith (t => {
@@ -276,6 +276,7 @@ namespace macdoc
.Select (kvp => Task.Factory.StartNew (() => {
var mergeToolPath = ProductUtils.GetMergeToolForProduct (kvp.Key);
var docOutdated = kvp.Value.Item1;
+
// If the script has its setuid bit on and user as root, then we launch it directly otherwise we first restore it
if (!RootLauncher.IsRootEnabled (mergeToolPath)) {
RootLauncher.LaunchExternalTool (mergeToolPath, new string[] { "--self-repair" });
diff --git a/AppleDocHandler.cs b/AppleDocHandler.cs
index a499d04..b5f1f68 100644
--- a/AppleDocHandler.cs
+++ b/AppleDocHandler.cs
@@ -18,6 +18,7 @@ namespace macdoc
}
readonly string[] searchPaths = new[] {
+ "/Applications/Xcode.app/Contents/Developer/Documentation/DocSets/",
"/Library/Developer/Shared/Documentation/DocSets/",
"/Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/"
};
@@ -112,7 +113,7 @@ namespace macdoc
return needRefresh;
}
- public bool CheckMergedDocumentationFreshness (AppleDocInformation infos)
+ public bool CheckMergedDocumentationFreshness (AppleDocInformation infos, Product product)
{
var statusFile = Path.Combine (baseApplicationPath, "macdoc");
if (!Directory.Exists (statusFile)) {
@@ -121,14 +122,13 @@ namespace macdoc
} catch {}
return true;
}
- statusFile = Path.Combine (statusFile, "merge.status");
+ statusFile = Path.Combine (statusFile, product == Product.MonoMac ? "merge.mac.status" : "merge.status");
if (!File.Exists (statusFile))
return true;
if (!string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("APPLEDOCWIZARD_FORCE_MERGE")))
return true;
var mergedVersion = CloneFillWithZeros (new Version (File.ReadAllText (statusFile)));
-
return mergedVersion != infos.Version;
}