[104672] trunk/dports/aqua/launch

ryandesign at macports.org ryandesign at macports.org
Sun Mar 31 01:27:25 PDT 2013


Revision: 104672
          https://trac.macports.org/changeset/104672
Author:   ryandesign at macports.org
Date:     2013-03-31 01:27:25 -0700 (Sun, 31 Mar 2013)
Log Message:
-----------
launch: fix building on OS X 10.8 and later by applying upstream revision 651 to remove an obsolete error code constant (#38600) and also fix a buffer overflow; apply upstream revision 314 to handle new error codes used by OS X 10.4 and later; use unversioned docdir; rename patch file

Revision Links:
--------------
    https://trac.macports.org/changeset/651
    https://trac.macports.org/changeset/314

Modified Paths:
--------------
    trunk/dports/aqua/launch/Portfile

Added Paths:
-----------
    trunk/dports/aqua/launch/files/patch-main.c.diff

Removed Paths:
-------------
    trunk/dports/aqua/launch/files/patch-main.c

Modified: trunk/dports/aqua/launch/Portfile
===================================================================
--- trunk/dports/aqua/launch/Portfile	2013-03-31 08:05:34 UTC (rev 104671)
+++ trunk/dports/aqua/launch/Portfile	2013-03-31 08:27:25 UTC (rev 104672)
@@ -5,13 +5,15 @@
 
 name            launch
 version         1.1
+revision        1
 license         BSD
 maintainers     nomaintainer
-description     command-line launcher for Mac OS X in the spirit of open
 
+description     command-line launcher for OS X in the spirit of open
+
 long_description \
     Apple provides a simple command-line launching program called open \
-    with Mac OS X. It offers few options - launching applications by name \
+    with OS X. It offers few options - launching applications by name \
     or by path, launching TextEdit, or opening a number of applications, \
     documents, folders, or URLs. With the exception of special support for \
     TextEdit (open -a), launch does all this and more.
@@ -23,7 +25,7 @@
                 sha1 000d6f1063f1b9091a8b10de90cfa778ed6a6ed1 \
                 rmd160 7eba376fdedd322ecfcc4d429bf608dcd1e79c34
 
-patchfiles      patch-main.c
+patchfiles      patch-main.c.diff
 
 xcode.destroot.path ${prefix}/bin
 
@@ -31,7 +33,7 @@
     xinstall -m 0444 ${worksrcpath}/${name}.1 \
         ${destroot}${prefix}/share/man/man1
 
-    set docdir ${prefix}/share/doc/${name}-${version}
+    set docdir ${prefix}/share/doc/${name}
     xinstall -d ${destroot}${docdir}
     xinstall -m 0644 ${worksrcpath}/README ${destroot}${docdir}
 }

Deleted: trunk/dports/aqua/launch/files/patch-main.c
===================================================================
--- trunk/dports/aqua/launch/files/patch-main.c	2013-03-31 08:05:34 UTC (rev 104671)
+++ trunk/dports/aqua/launch/files/patch-main.c	2013-03-31 08:27:25 UTC (rev 104672)
@@ -1,60 +0,0 @@
---- main.c.orig	2006-10-30 02:56:23.000000000 -0800
-+++ main.c	2009-08-28 13:58:09.000000000 -0700
-@@ -147,7 +147,7 @@
-     len = strlen(errDesc) + 10 * sizeof(char);
-     str = (char *)malloc(len);
-     if (str != NULL)
--        snprintf(str, len, "%s (%ld)", errDesc, err);
-+        snprintf(str, len, "%s (%d)", errDesc, (int)err);
-     else
-         str = failedStr;
-     return str;
-@@ -580,7 +580,7 @@
-     if (bigSize == 0) {
-         if (littleSize == 0) {
-             printf("zero bytes on disk (zero bytes used)\n"); return;
--        } else if (littleSize < 1024) printf("%lu bytes", littleSize);
-+        } else if (littleSize < 1024) printf("%u bytes", (unsigned int)littleSize);
-         else {
-             UInt32 adjSize = littleSize >> 10;
-             if (adjSize < 1024) printf("%.1f KB", DFORMAT(littleSize));
-@@ -594,10 +594,10 @@
-             }
-         }
-     } else {
--        if (bigSize < 256) printf("%lu GB", bigSize);
-+        if (bigSize < 256) printf("%u GB", (unsigned int)bigSize);
-         else {
-             bigSize >>= 2;
--            printf("%lu TB", bigSize);
-+            printf("%u TB", (unsigned int)bigSize);
-         }
-     }
-     printf(" on disk (%llu bytes used)\n", logicalSize);
-@@ -616,7 +616,7 @@
- 	switch (fscInfo.valence) {
- 	case 0: printf("zero items\n"); break;
- 	case 1: printf("1 item\n"); break;
--	default: printf("%lu items\n", fscInfo.valence);
-+	default: printf("%u items\n", (unsigned int)fscInfo.valence);
- 	}
-     } else {
-         printSizes("data fork size", fscInfo.dataLogicalSize, fscInfo.dataPhysicalSize, true);
-@@ -735,7 +735,7 @@
-             printf("unknown (cputype %d, subtype %d)", fat[i].cputype, fat[i].cpusubtype);
-             continue;
-         }
--        printf(arch->description);
-+        printf("%s", arch->description);
-     }
-     printf("\n");
- }
-@@ -880,7 +880,7 @@
- 
- 	if (version != NULL) {
- 	    printf("\tversion: %s", utf8StringFromCFStringRef(version));
--	    if (intVersion != 0) printf(" [0x%lx = %lu]", intVersion, intVersion);
-+	    if (intVersion != 0) printf(" [0x%x = %u]", (unsigned int)intVersion, (unsigned int)intVersion);
- 	    putchar('\n');
- 	    CFRelease(version);
- 	}

Copied: trunk/dports/aqua/launch/files/patch-main.c.diff (from rev 104657, trunk/dports/aqua/launch/files/patch-main.c)
===================================================================
--- trunk/dports/aqua/launch/files/patch-main.c.diff	                        (rev 0)
+++ trunk/dports/aqua/launch/files/patch-main.c.diff	2013-03-31 08:27:25 UTC (rev 104672)
@@ -0,0 +1,97 @@
+--- main.c.orig	2006-10-30 04:56:23.000000000 -0600
++++ main.c	2013-03-31 03:17:46.000000000 -0500
+@@ -69,10 +69,17 @@
+ 
+ static errList ERRS = {
+     // Launch Services errors
++    { kLSAppInTrashErr, "application is in the Trash" },
++    { kLSExecutableIncorrectFormat, "executable is unsupported on this processor architecture" },
+     { kLSUnknownErr, "unknown Launch Services error" },
+-    { kLSApplicationNotFoundErr, "application not found" },
++    { kLSNotAnApplicationErr, "item is not an application" },
++    { kLSDataUnavailableErr, "item metadata is unavailable" },
++    { kLSApplicationNotFoundErr, "application not found for document" },
++    { kLSUnknownTypeErr, "cannot determine item kind" },
+     { kLSLaunchInProgressErr, "application is being opened; please try again after the application is open" },
+-    { kLSNotRegisteredErr, "application not registered in Launch Services database" },
++    { kLSServerCommunicationErr, "unable to connect to Launch Services.\nAre you logged in?" },
++    { kLSIncompatibleSystemVersionErr, "application is incompatible with this version of Mac OS X" },
++    { kLSNoLaunchPermissionErr, "no permission to launch this application", },
+     { kLSNoExecutableErr, "application package contains no executable, or an unusable executable" },
+     { kLSNoClassicEnvironmentErr, "Classic environment required but not available" },
+     { kLSMultipleSessionsNotSupportedErr, "unable to launch multiple instances of application" },
+@@ -89,7 +96,6 @@
+     { nsvErr, "the volume cannot be found (buggy filesystem?)" },
+     { procNotFound, "unable to connect to system service.\nAre you logged in?" },
+     { kCGErrorIllegalArgument, "window server error.\nAre you logged in?" },
+-    { kCGErrorApplicationRequiresNewerSystem, "application requires a newer Mac OS X version" },
+     { fnfErr, "file not found" },
+     { 0, NULL }
+ };
+@@ -147,7 +153,7 @@
+     len = strlen(errDesc) + 10 * sizeof(char);
+     str = (char *)malloc(len);
+     if (str != NULL)
+-        snprintf(str, len, "%s (%ld)", errDesc, err);
++        snprintf(str, len, "%s (%d)", errDesc, (int)err);
+     else
+         str = failedStr;
+     return str;
+@@ -580,7 +586,7 @@
+     if (bigSize == 0) {
+         if (littleSize == 0) {
+             printf("zero bytes on disk (zero bytes used)\n"); return;
+-        } else if (littleSize < 1024) printf("%lu bytes", littleSize);
++        } else if (littleSize < 1024) printf("%u bytes", (unsigned int)littleSize);
+         else {
+             UInt32 adjSize = littleSize >> 10;
+             if (adjSize < 1024) printf("%.1f KB", DFORMAT(littleSize));
+@@ -594,10 +600,10 @@
+             }
+         }
+     } else {
+-        if (bigSize < 256) printf("%lu GB", bigSize);
++        if (bigSize < 256) printf("%u GB", (unsigned int)bigSize);
+         else {
+             bigSize >>= 2;
+-            printf("%lu TB", bigSize);
++            printf("%u TB", (unsigned int)bigSize);
+         }
+     }
+     printf(" on disk (%llu bytes used)\n", logicalSize);
+@@ -616,7 +622,7 @@
+ 	switch (fscInfo.valence) {
+ 	case 0: printf("zero items\n"); break;
+ 	case 1: printf("1 item\n"); break;
+-	default: printf("%lu items\n", fscInfo.valence);
++	default: printf("%u items\n", (unsigned int)fscInfo.valence);
+ 	}
+     } else {
+         printSizes("data fork size", fscInfo.dataLogicalSize, fscInfo.dataPhysicalSize, true);
+@@ -651,7 +657,7 @@
+     CFStringRef typeStr = CFStringCreateWithBytes(NULL, (UInt8 *)&osType, 4, CFStringGetSystemEncoding(), false);
+     if (typeStr == NULL) {
+ 	// punt to displaying verbatim
+-	static char tmpBuffer[4];
++	static char tmpBuffer[5];
+ 	tmpBuffer[4] = '\0';
+ 	strncpy(tmpBuffer, (const char *)&osType, 4);
+ 	return tmpBuffer;
+@@ -735,7 +741,7 @@
+             printf("unknown (cputype %d, subtype %d)", fat[i].cputype, fat[i].cpusubtype);
+             continue;
+         }
+-        printf(arch->description);
++        printf("%s", arch->description);
+     }
+     printf("\n");
+ }
+@@ -880,7 +886,7 @@
+ 
+ 	if (version != NULL) {
+ 	    printf("\tversion: %s", utf8StringFromCFStringRef(version));
+-	    if (intVersion != 0) printf(" [0x%lx = %lu]", intVersion, intVersion);
++	    if (intVersion != 0) printf(" [0x%x = %u]", (unsigned int)intVersion, (unsigned int)intVersion);
+ 	    putchar('\n');
+ 	    CFRelease(version);
+ 	}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130331/f6b339ff/attachment.html>


More information about the macports-changes mailing list