Revision: 28415
          http://sourceforge.net/p/bibdesk/svn/28415
Author:   hofman
Date:     2023-11-04 10:10:13 +0000 (Sat, 04 Nov 2023)
Log Message:
-----------
Set deployment target to 10.13. Replace logging code and some deprecated 
methods and escape deprecation warning.

Modified Paths:
--------------
    
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Configurations/ConfigCommon.xcconfig
    
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Configurations/ConfigUnitTest.xcconfig
    
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SPUDownloaderDeprecated.m
    trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m
    trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SULog.m
    trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUUpdater.m

Modified: 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Configurations/ConfigCommon.xcconfig
===================================================================
--- 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Configurations/ConfigCommon.xcconfig
  2023-11-04 00:33:09 UTC (rev 28414)
+++ 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Configurations/ConfigCommon.xcconfig
  2023-11-04 10:10:13 UTC (rev 28415)
@@ -26,7 +26,7 @@
 GCC_SYMBOLS_PRIVATE_EXTERN = YES
 GCC_INLINES_ARE_PRIVATE_EXTERN = YES
 ARCHS = $(ARCHS_STANDARD)
-MACOSX_DEPLOYMENT_TARGET = 10.9
+MACOSX_DEPLOYMENT_TARGET = 10.13
 PRODUCT_NAME = ${TARGET_NAME}
 PRODUCT_BUNDLE_IDENTIFIER = 
org.sparkle-project.Sparkle.${PRODUCT_NAME:rfc1034identifier}
 

Modified: 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Configurations/ConfigUnitTest.xcconfig
===================================================================
--- 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Configurations/ConfigUnitTest.xcconfig
        2023-11-04 00:33:09 UTC (rev 28414)
+++ 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Configurations/ConfigUnitTest.xcconfig
        2023-11-04 10:10:13 UTC (rev 28415)
@@ -9,6 +9,6 @@
 WARNING_CFLAGS = $(inherited) -Wno-variadic-macros 
-Wno-gnu-zero-variadic-macro-arguments
 FRAMEWORK_SEARCH_PATHS = $(inherited) $(DEVELOPER_FRAMEWORKS_DIR)
 LD_RUNPATH_SEARCH_PATHS = @loader_path/../Frameworks
-MACOSX_DEPLOYMENT_TARGET = 10.9
+MACOSX_DEPLOYMENT_TARGET = 10.13
 CLANG_ENABLE_MODULES = YES
 SWIFT_OBJC_BRIDGING_HEADER = Tests/Sparkle Unit Tests-Bridging-Header.h

Modified: 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SPUDownloaderDeprecated.m
===================================================================
--- 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SPUDownloaderDeprecated.m 
    2023-11-04 00:33:09 UTC (rev 28414)
+++ 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SPUDownloaderDeprecated.m 
    2023-11-04 10:10:13 UTC (rev 28415)
@@ -39,7 +39,10 @@
             self.desiredFilename = desiredFilename;
             self.bundleIdentifier = bundleIdentifier;
             
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
             self.download = [[NSURLDownload alloc] 
initWithRequest:request.request delegate:self];
+#pragma clang diagnostic pop
         }
     });
 }
@@ -53,7 +56,10 @@
             self.disabledAutomaticTermination = YES;
             
             self.mode = SPUDownloadModeTemporary;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
             self.download = [[NSURLDownload alloc] 
initWithRequest:request.request delegate:self];
+#pragma clang diagnostic pop
         }
     });
 }

Modified: 
trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m
===================================================================
--- trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m 
2023-11-04 00:33:09 UTC (rev 28414)
+++ trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUBasicUpdateDriver.m 
2023-11-04 10:10:13 UTC (rev 28415)
@@ -626,7 +626,7 @@
         NSError *error = nil;
         success = [[NSFileManager defaultManager] 
removeItemAtPath:self.tempDir error:&error]; // Clean up the copied relauncher
         if (!success)
-            [[NSWorkspace sharedWorkspace] 
performFileOperation:NSWorkspaceRecycleOperation source:[self.tempDir 
stringByDeletingLastPathComponent] destination:@"" files:@[[self.tempDir 
lastPathComponent]] tag:NULL];
+            [[NSWorkspace sharedWorkspace] recycleURLs:@[[NSURL 
fileURLWithPath:self.tempDir]] completionHandler:nil];
     }
 }
 

Modified: trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SULog.m
===================================================================
--- trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SULog.m       
2023-11-04 00:33:09 UTC (rev 28414)
+++ trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SULog.m       
2023-11-04 10:10:13 UTC (rev 28415)
@@ -7,124 +7,39 @@
 //
 
 #include "SULog.h"
-
-#include <asl.h>
-#include <Availability.h>
-
-#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101200
 #include <os/log.h>
-#else
 
-typedef struct os_log_s *os_log_t;
-#define os_log_create(subsystem, category) nil
 
-#define os_log(log, format, ...)
-#define os_log_error(log, format, ...)
-
-#endif
-
 #include "AppKitPrevention.h"
-#import "SUOperatingSystem.h"
 
-// For converting constants to string literals using the preprocessor
-#define STRINGIFY(x) #x
-#define TO_STRING(x) STRINGIFY(x)
-
-
 void SULog(SULogLevel level, NSString *format, ...)
 {
-    static aslclient client;
-    static dispatch_queue_t queue;
     static dispatch_once_t onceToken;
-
     static os_log_t logger;
-    static BOOL hasOSLogging;
 
     dispatch_once(&onceToken, ^{
-        NSBundle *mainBundle = [NSBundle mainBundle];
-
-        hasOSLogging = [SUOperatingSystem 
isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 12, 0}];
-#if __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
-        hasOSLogging = NO;
-#endif
-
-        if (hasOSLogging) {
-            const char *subsystem = SPARKLE_BUNDLE_IDENTIFIER;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-            // This creates a thread-safe object
-            logger = os_log_create(subsystem, "Sparkle");
-#pragma clang diagnostic pop
-        } else {
-            uint32_t options = ASL_OPT_NO_DELAY;
-            // Act the same way os_log() does; don't log to stderr if a 
terminal device is attached
-            if (!isatty(STDERR_FILENO)) {
-                options |= ASL_OPT_STDERR;
-            }
-
-            NSString *displayName = [[NSFileManager defaultManager] 
displayNameAtPath:mainBundle.bundlePath];
-            client = asl_open([displayName stringByAppendingString:@" [Sparkle 
" TO_STRING(SPARKLE_VERSION) "]"].UTF8String, SPARKLE_BUNDLE_IDENTIFIER, 
options);
-            queue = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
-        }
+        const char *subsystem = SPARKLE_BUNDLE_IDENTIFIER;
+        // This creates a thread-safe object
+        logger = os_log_create(subsystem, "Sparkle");
     });
 
-    if (!hasOSLogging && client == NULL) {
-        return;
-    }
-
     va_list ap;
     va_start(ap, format);
     NSString *logMessage = [[NSString alloc] initWithFormat:format 
arguments:ap];
     va_end(ap);
-
-    // Use os_log if available (on 10.12+)
-    if (hasOSLogging) {
-        // We'll make all of our messages formatted as public; just don't log 
sensitive information.
-        // Note we don't take advantage of info like the source line number 
because we wrap this macro inside our own function
-        // And we don't really leverage of os_log's deferred formatting 
processing because we format the string before passing it in
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-        switch (level) {
-            case SULogLevelDefault:
-                // See docs for OS_LOG_TYPE_DEFAULT
-                // By default, OS_LOG_TYPE_DEFAULT seems to be more noticable 
than OS_LOG_TYPE_INFO
-                os_log(logger, "%{public}@", logMessage);
-                break;
-            case SULogLevelError:
-                // See docs for OS_LOG_TYPE_ERROR
-                os_log_error(logger, "%{public}@", logMessage);
-                break;
-        }
-#pragma clang diagnostic pop
-        return;
+    
+    // We'll make all of our messages formatted as public; just don't log 
sensitive information.
+    // Note we don't take advantage of info like the source line number 
because we wrap this macro inside our own function
+    // And we don't really leverage of os_log's deferred formatting processing 
because we format the string before passing it in
+    switch (level) {
+        case SULogLevelDefault:
+            // See docs for OS_LOG_TYPE_DEFAULT
+            // By default, OS_LOG_TYPE_DEFAULT seems to be more noticable than 
OS_LOG_TYPE_INFO
+            os_log(logger, "%{public}@", logMessage);
+            break;
+        case SULogLevelError:
+            // See docs for OS_LOG_TYPE_ERROR
+            os_log_error(logger, "%{public}@", logMessage);
+            break;
     }
-
-    // Otherwise use ASL
-    // Make sure we do not async, because if we async, the log may not be 
delivered deterministically
-    dispatch_sync(queue, ^{
-        aslmsg message = asl_new(ASL_TYPE_MSG);
-        if (message == NULL) {
-            return;
-        }
-
-        if (asl_set(message, ASL_KEY_MSG, logMessage.UTF8String) != 0) {
-            return;
-        }
-        
-        int levelSetResult;
-        switch (level) {
-            case SULogLevelDefault:
-                // Just use one level below the error level
-                levelSetResult = asl_set(message, ASL_KEY_LEVEL, 
TO_STRING(ASL_LEVEL_WARNING));
-                break;
-            case SULogLevelError:
-                levelSetResult = asl_set(message, ASL_KEY_LEVEL, 
TO_STRING(ASL_LEVEL_ERR));
-                break;
-        }
-        if (levelSetResult != 0) {
-            return;
-        }
-        
-        asl_send(client, message);
-    });
 }

Modified: trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUUpdater.m
===================================================================
--- trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUUpdater.m   
2023-11-04 00:33:09 UTC (rev 28414)
+++ trunk/bibdesk_vendorsrc/andymatuschak/Sparkle/Sparkle/SUUpdater.m   
2023-11-04 10:10:13 UTC (rev 28415)
@@ -515,7 +515,7 @@
 }
 
 static NSString *escapeURLComponent(NSString *str) {
-    return [[[[str 
stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]
+    return [[[[str 
stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet 
URLQueryAllowedCharacterSet]]
              stringByReplacingOccurrencesOfString:@"=" withString:@"%3d"]
              stringByReplacingOccurrencesOfString:@"&" withString:@"%26"]
              stringByReplacingOccurrencesOfString:@"+" withString:@"%2b"];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to