<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[130541] trunk/dports/perl/p5-macosx-file</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/130541">130541</a></dd>
<dt>Author</dt> <dd>larryv@macports.org</dd>
<dt>Date</dt> <dd>2014-12-31 12:52:48 -0800 (Wed, 31 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>p5-macosx-file: Refactor patches

- use-FSPathCopyObjectSync.patch: <a href="https://trac.macports.org/changeset/48869">r48869</a>
- fix-Copy-tiger.patch: <a href="https://trac.macports.org/changeset/49288">r49288</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsperlp5macosxfilePortfile">trunk/dports/perl/p5-macosx-file/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportsperlp5macosxfilefilesfixCopytigerpatch">trunk/dports/perl/p5-macosx-file/files/fix-Copy-tiger.patch</a></li>
<li><a href="#trunkdportsperlp5macosxfilefilesuseFSPathCopyObjectSyncpatch">trunk/dports/perl/p5-macosx-file/files/use-FSPathCopyObjectSync.patch</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkdportsperlp5macosxfilefilespatchCopyCopypmdiff">trunk/dports/perl/p5-macosx-file/files/patch-Copy-Copy.pm.diff</a></li>
<li><a href="#trunkdportsperlp5macosxfilefilespatchCopyfilecopycdiff">trunk/dports/perl/p5-macosx-file/files/patch-Copy-filecopy.c.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsperlp5macosxfilePortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/perl/p5-macosx-file/Portfile (130540 => 130541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/perl/p5-macosx-file/Portfile        2014-12-31 19:33:15 UTC (rev 130540)
+++ trunk/dports/perl/p5-macosx-file/Portfile        2014-12-31 20:52:48 UTC (rev 130541)
</span><span class="lines">@@ -24,8 +24,8 @@
</span><span class="cx"> 
</span><span class="cx"> if {${perl5.major} ne &quot;&quot;} {
</span><span class="cx"> supported_archs     i386 ppc
</span><del>-patchfiles          patch-Copy-Copy.pm.diff \
-                    patch-Copy-filecopy.c.diff
</del><ins>+patchfiles          use-FSPathCopyObjectSync.patch \
+                    fix-Copy-tiger.patch
</ins><span class="cx"> post-patch {
</span><span class="cx">     reinplace &quot;s|/usr/local|${prefix}|g&quot; ${worksrcpath}/Makefile.PL
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkdportsperlp5macosxfilefilesfixCopytigerpatchfromrev130540trunkdportsperlp5macosxfilefilespatchCopyfilecopycdiff"></a>
<div class="copfile"><h4>Copied: trunk/dports/perl/p5-macosx-file/files/fix-Copy-tiger.patch (from rev 130540, trunk/dports/perl/p5-macosx-file/files/patch-Copy-filecopy.c.diff) (0 => 130541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/perl/p5-macosx-file/files/fix-Copy-tiger.patch                                (rev 0)
+++ trunk/dports/perl/p5-macosx-file/files/fix-Copy-tiger.patch        2014-12-31 20:52:48 UTC (rev 130541)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+Index: Copy/filecopy.c
+===================================================================
+--- Copy/filecopy.c.orig
++++ Copy/filecopy.c
+@@ -6,6 +6,14 @@
+ #include &lt;Files.h&gt;
+ #include &quot;common/util.c&quot;

++#ifndef kPOSIXErrorBase
++#define kPOSIXErrorBase 100000L
++#endif
++
++#ifndef kPOSIXErrorERANGE
++#define kPOSIXErrorERANGE 100034L
++#endif
++
+ #ifdef _INC_PERL_XSUB_H
+ static int
+ setcopyerr(int err, char *filename, int line)
</ins></span></pre></div>
<a id="trunkdportsperlp5macosxfilefilespatchCopyCopypmdiff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/perl/p5-macosx-file/files/patch-Copy-Copy.pm.diff (130540 => 130541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/perl/p5-macosx-file/files/patch-Copy-Copy.pm.diff        2014-12-31 19:33:15 UTC (rev 130540)
+++ trunk/dports/perl/p5-macosx-file/files/patch-Copy-Copy.pm.diff        2014-12-31 20:52:48 UTC (rev 130541)
</span><span class="lines">@@ -1,11 +0,0 @@
</span><del>---- Copy/Copy.pm.orig        2005-08-18 23:12:28.000000000 -0700
-+++ Copy/Copy.pm        2009-03-25 17:22:19.000000000 -0700
-@@ -85,7 +85,7 @@

-     my ($srcdev, $srcino, $srcmode, $srcuid, $srcgid, $srcatime, $srcmtime)
-         = (lstat($src))[0,1,2,4,5,8,9];
--    unless(-f _){
-+    unless(-e _){
-         $MacOSX::File::OSErr = -43; # fnfErr;
-         $! = &amp;Errno::ENOENT;
-         return;
</del></span></pre></div>
<a id="trunkdportsperlp5macosxfilefilespatchCopyfilecopycdiff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/perl/p5-macosx-file/files/patch-Copy-filecopy.c.diff (130540 => 130541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/perl/p5-macosx-file/files/patch-Copy-filecopy.c.diff        2014-12-31 19:33:15 UTC (rev 130540)
+++ trunk/dports/perl/p5-macosx-file/files/patch-Copy-filecopy.c.diff        2014-12-31 20:52:48 UTC (rev 130541)
</span><span class="lines">@@ -1,106 +0,0 @@
</span><del>---- Copy/filecopy.c.orig        2005-08-18 23:12:28.000000000 -0700
-+++ Copy/filecopy.c        2009-04-03 18:02:48.000000000 -0700
-@@ -3,9 +3,18 @@
-  */

- #undef I_POLL
-+// #include &lt;libgen.h&gt;
- #include &lt;Files.h&gt;
- #include &quot;common/util.c&quot;

-+#ifndef        kPOSIXErrorBase
-+# define        kPOSIXErrorBase 100000L
-+#endif        /* kPOSIXErrorBase */
-+
-+#ifndef        kPOSIXErrorERANGE
-+# define        kPOSIXErrorERANGE 100034L
-+#endif        /* kPOSIXErrorERANGE */
-+
- #ifdef _INC_PERL_XSUB_H
- static int
- setcopyerr(int err, char *filename, int line)
-@@ -166,46 +175,46 @@

- #define min(x, y) ((x) &lt; y) ? (x) : (y)

--static OSErr
--filecopy(char *src, char *dst, UInt64 maxbufsize, int preserve){
--    OSErr err;
--    FSCatalogInfo srcCat, dstCat;
--    FSRef srcFS, dstFS;
--    HFSUniStr255 forkName;
--    UTCDateTime  now;
--    
--    if (err = FSPathMakeRef(src, &amp;srcFS, NULL)) 
--    { return err; }
--    
--    if (err = FSGetCatalogInfo(&amp;srcFS, kFSCatInfoGettableInfo, &amp;srcCat, 
--                               NULL, NULL, NULL))
--    { return err; }
--
--    bcopy(&amp;srcCat, &amp;dstCat, sizeof(FSCatalogInfo));
--
--    if (err = newfile(dst, &amp;dstFS, &amp;dstCat)){ 
--        fpf(stderr, &quot;Cannot Create File %s\n&quot;, dst);
--        return err; 
--    }
--    if (srcCat.dataLogicalSize){
--        setbufsiz(min(srcCat.dataPhysicalSize, maxbufsize));
--        FSGetDataForkName(&amp;forkName); 
--        if (err = copyfork(&amp;forkName, &amp;srcFS, &amp;dstFS))
--        { return err; }
--    }
--    if (srcCat.rsrcLogicalSize){
--        setbufsiz(min(srcCat.rsrcPhysicalSize, maxbufsize));
--        FSGetResourceForkName(&amp;forkName);
--        if (err = copyfork(&amp;forkName, &amp;srcFS, &amp;dstFS))
--        { return err; }
--    }
--    freebuf();
--    if (preserve){
--        err =  FSSetCatalogInfo(&amp;dstFS, kFSCatInfoSettableInfo, &amp;srcCat);
--    }
--    return err;
-+static OSStatus
-+filecopy(char *src, char *dst, UInt64 maxbufsize, int preserve)
-+{
-+        OSStatus status;
-+        char                        *destDir = NULL;
-+        CFStringRef                destFname;
-+        char                        *lastSlash = NULL;
-+        char                        *tmpString = NULL;
-+        
-+        if (NULL == dst || NULL == src) {
-+                return -1;
-+        }
-+        /* split the dst into the dir and the filename */
-+        if (NULL == (tmpString = dirname(dst))) {
-+                /* dirname() failed... */
-+                return errno + kPOSIXErrorBase;
-+        }
-+        destDir = calloc((strlen(tmpString) + 2), sizeof(char));
-+        if (NULL == destDir) {
-+                /* failed to allocate mem */
-+                return errno + kPOSIXErrorBase;
-+        }
-+        if (strlcpy(destDir, tmpString, (strlen(tmpString) + 1)) &gt; (strlen(tmpString))) {
-+                /* argh! */
-+                return kPOSIXErrorERANGE;
-+        }
-+        if (NULL == (tmpString = basename(dst))) {
-+                /* basename() failed... */
-+                return errno + kPOSIXErrorBase;
-+        }
-+        destFname = CFStringCreateWithCString(kCFAllocatorDefault, tmpString, kCFStringEncodingMacRoman);
-+
-+        status = FSPathCopyObjectSync(src, destDir, destFname, NULL, kFSFileOperationSkipPreflight);
-+        
-+        // fprintf(stderr, &quot;FSPathCOpyObjectSync(%s, %s, %s,...) status is \&quot;%d\&quot;\n&quot;, (NULL != src ? src : &quot;&lt;NULL&gt;&quot;), (NULL != destDir ? destDir: &quot;&lt;NULL&gt;&quot;), (NULL != tmpString ? tmpString: &quot;&lt;NULL&gt;&quot;), status);
-+        
-+        return status;
- }

-+
- /*
- static OSErr 
- filemove(char *src, char *dst){
</del></span></pre></div>
<a id="trunkdportsperlp5macosxfilefilesuseFSPathCopyObjectSyncpatchfromrev130540trunkdportsperlp5macosxfilefilespatchCopyfilecopycdiff"></a>
<div class="copfile"><h4>Copied: trunk/dports/perl/p5-macosx-file/files/use-FSPathCopyObjectSync.patch (from rev 130540, trunk/dports/perl/p5-macosx-file/files/patch-Copy-filecopy.c.diff) (0 => 130541)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/perl/p5-macosx-file/files/use-FSPathCopyObjectSync.patch                                (rev 0)
+++ trunk/dports/perl/p5-macosx-file/files/use-FSPathCopyObjectSync.patch        2014-12-31 20:52:48 UTC (rev 130541)
</span><span class="lines">@@ -0,0 +1,102 @@
</span><ins>+Index: Copy/filecopy.c
+===================================================================
+--- Copy/filecopy.c.orig
++++ Copy/filecopy.c
+@@ -166,46 +166,46 @@ copyfork(HFSUniStr255 *forkName, FSRef *

+ #define min(x, y) ((x) &lt; y) ? (x) : (y)

+-static OSErr
+-filecopy(char *src, char *dst, UInt64 maxbufsize, int preserve){
+-    OSErr err;
+-    FSCatalogInfo srcCat, dstCat;
+-    FSRef srcFS, dstFS;
+-    HFSUniStr255 forkName;
+-    UTCDateTime  now;
+-    
+-    if (err = FSPathMakeRef(src, &amp;srcFS, NULL)) 
+-    { return err; }
+-    
+-    if (err = FSGetCatalogInfo(&amp;srcFS, kFSCatInfoGettableInfo, &amp;srcCat, 
+-                               NULL, NULL, NULL))
+-    { return err; }
+-
+-    bcopy(&amp;srcCat, &amp;dstCat, sizeof(FSCatalogInfo));
+-
+-    if (err = newfile(dst, &amp;dstFS, &amp;dstCat)){ 
+-        fpf(stderr, &quot;Cannot Create File %s\n&quot;, dst);
+-        return err; 
+-    }
+-    if (srcCat.dataLogicalSize){
+-        setbufsiz(min(srcCat.dataPhysicalSize, maxbufsize));
+-        FSGetDataForkName(&amp;forkName); 
+-        if (err = copyfork(&amp;forkName, &amp;srcFS, &amp;dstFS))
+-        { return err; }
+-    }
+-    if (srcCat.rsrcLogicalSize){
+-        setbufsiz(min(srcCat.rsrcPhysicalSize, maxbufsize));
+-        FSGetResourceForkName(&amp;forkName);
+-        if (err = copyfork(&amp;forkName, &amp;srcFS, &amp;dstFS))
+-        { return err; }
+-    }
+-    freebuf();
+-    if (preserve){
+-        err =  FSSetCatalogInfo(&amp;dstFS, kFSCatInfoSettableInfo, &amp;srcCat);
+-    }
+-    return err;
++static OSStatus
++filecopy(char *src, char *dst, UInt64 maxbufsize, int preserve)
++{
++        OSStatus status;
++        char                        *destDir = NULL;
++        CFStringRef                destFname;
++        char                        *lastSlash = NULL;
++        char                        *tmpString = NULL;
++        
++        if (NULL == dst || NULL == src) {
++                return -1;
++        }
++        /* split the dst into the dir and the filename */
++        if (NULL == (tmpString = dirname(dst))) {
++                /* dirname() failed... */
++                return errno + kPOSIXErrorBase;
++        }
++        destDir = calloc((strlen(tmpString) + 2), sizeof(char));
++        if (NULL == destDir) {
++                /* failed to allocate mem */
++                return errno + kPOSIXErrorBase;
++        }
++        if (strlcpy(destDir, tmpString, (strlen(tmpString) + 1)) &gt; (strlen(tmpString))) {
++                /* argh! */
++                return kPOSIXErrorERANGE;
++        }
++        if (NULL == (tmpString = basename(dst))) {
++                /* basename() failed... */
++                return errno + kPOSIXErrorBase;
++        }
++        destFname = CFStringCreateWithCString(kCFAllocatorDefault, tmpString, kCFStringEncodingMacRoman);
++
++        status = FSPathCopyObjectSync(src, destDir, destFname, NULL, kFSFileOperationSkipPreflight);
++        
++        // fprintf(stderr, &quot;FSPathCOpyObjectSync(%s, %s, %s,...) status is \&quot;%d\&quot;\n&quot;, (NULL != src ? src : &quot;&lt;NULL&gt;&quot;), (NULL != destDir ? destDir: &quot;&lt;NULL&gt;&quot;), (NULL != tmpString ? tmpString: &quot;&lt;NULL&gt;&quot;), status);
++        
++        return status;
+ }

++
+ /*
+ static OSErr 
+ filemove(char *src, char *dst){
+Index: Copy/Copy.pm
+===================================================================
+--- Copy/Copy.pm.orig
++++ Copy/Copy.pm
+@@ -85,7 +85,7 @@ sub copy($$;$$){

+     my ($srcdev, $srcino, $srcmode, $srcuid, $srcgid, $srcatime, $srcmtime)
+         = (lstat($src))[0,1,2,4,5,8,9];
+-    unless(-f _){
++    unless(-e _){
+         $MacOSX::File::OSErr = -43; # fnfErr;
+         $! = &amp;Errno::ENOENT;
+         return;
</ins></span></pre>
</div>
</div>

</body>
</html>