diff options
-rw-r--r-- | AppDelegate.cs | 3 | ||||
-rw-r--r-- | AppleDocHandler.cs | 6 |
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; } |