[19521] trunk/dports/sysutils/xattr

source_changes at macosforge.org source_changes at macosforge.org
Wed Sep 13 17:40:15 PDT 2006


Revision: 19521
Author:   markd at macports.org
Date:     2006-09-13 17:40:13 -0700 (Wed, 13 Sep 2006)

Log Message:
-----------
Closes 8484.  Add patches.

Modified Paths:
--------------
    trunk/dports/sysutils/xattr/Portfile

Added Paths:
-----------
    trunk/dports/sysutils/xattr/files/
    trunk/dports/sysutils/xattr/files/patch-XARemoveOperation.c.diff
    trunk/dports/sysutils/xattr/files/patch-XASetOperation.c.diff
    trunk/dports/sysutils/xattr/files/patch-xattr.c.diff

Modified: trunk/dports/sysutils/xattr/Portfile
===================================================================
--- trunk/dports/sysutils/xattr/Portfile	2006-09-13 20:54:59 UTC (rev 19520)
+++ trunk/dports/sysutils/xattr/Portfile	2006-09-14 00:40:13 UTC (rev 19521)
@@ -4,6 +4,7 @@
 
 name			xattr
 version			0.1
+revision		1
 categories		sysutils
 platforms		darwin
 maintainers		drernie at opendarwin.org
@@ -17,6 +18,9 @@
 checksums		md5 a0c523e3daf195bb7099a81c9d01c394
 use_bzip2		yes
 
+patchfiles		patch-XARemoveOperation.c.diff \
+			patch-XASetOperation.c.diff \
+			patch-xattr.c.diff
 use_configure	no
 
 build.type		pbx

Added: trunk/dports/sysutils/xattr/files/patch-XARemoveOperation.c.diff
===================================================================
--- trunk/dports/sysutils/xattr/files/patch-XARemoveOperation.c.diff	                        (rev 0)
+++ trunk/dports/sysutils/xattr/files/patch-XARemoveOperation.c.diff	2006-09-14 00:40:13 UTC (rev 19521)
@@ -0,0 +1,46 @@
+--- XARemoveOperation.c	2005-02-11 21:08:05.000000000 +0100
++++ XARemoveOperation.c.new	2006-04-19 17:35:08.000000000 +0200
+@@ -9,7 +9,9 @@
+ 
+ #include "XARemoveOperation.h"
+ #include <XAOperationInternal.h>
+-#include "xattr.h"
++#include <errno.h>
++#include <fcntl.h>
++#include <sys/xattr.h>
+ 
+ typedef struct __XARemoveOperation
+ {
+@@ -121,7 +123,7 @@
+ 
+ Boolean XARemoveOperationPerform(XAOperationRef opaqueRef, int fd, CFStringRef path)
+ {
+-	Boolean bRet = 0x00;
++	Boolean bRet = 0x01;
+ 	
+ 	XARemoveOperationRef operationRef = (XARemoveOperationRef)opaqueRef;
+ 	
+@@ -129,14 +131,22 @@
+ 	
+ 	char *key = calloc(bSize, sizeof(*key));
+ 	
+-	int options = XATTR_CREATE | XATTR_REPLACE;
++	int options = 0x00;
+ 	
+ 	if(CFStringGetCString(operationRef->key, key, bSize, kCFStringEncodingUTF8))
+ 	{
++		int fRet = fcntl(fd, F_NOCACHE, 0x01);
++
++		if(fRet < 0x00)
++			fprintf(stderr, "WARN: fcntl for key \"%s\" failed\n", key);
++		
+ 		int iRet = fremovexattr(fd, key, options);
+ 		
+ 		if(iRet < 0x00)
+ 		{
++			if(errno != ENOATTR)
++				fprintf(stderr, "ERROR: fremovexattr failed: %s\n", strerror(errno));
++
+ 			bRet = 0x00;
+ 		}
+ 	}

Added: trunk/dports/sysutils/xattr/files/patch-XASetOperation.c.diff
===================================================================
--- trunk/dports/sysutils/xattr/files/patch-XASetOperation.c.diff	                        (rev 0)
+++ trunk/dports/sysutils/xattr/files/patch-XASetOperation.c.diff	2006-09-14 00:40:13 UTC (rev 19521)
@@ -0,0 +1,50 @@
+--- XASetOperation.c	2005-04-13 07:12:23.000000000 +0200
++++ XASetOperation.c.new	2006-04-19 17:35:55.000000000 +0200
+@@ -12,13 +12,13 @@
+ #include <XAOperationInternal.h>
+ #include <unistd.h>
+ #include <stdio.h>
++#include <errno.h>
+ #include <fcntl.h>
+ #include <string.h>
+ #include <mach/mach.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-
+-#include "xattr.h"
++#include <sys/xattr.h>
+ 
+ typedef struct __XASetOperation
+ {
+@@ -225,7 +225,7 @@
+ 
+ Boolean XASetOperationPerform(XAOperationRef opaqueRef, int fd, CFStringRef path)
+ {
+-	Boolean bRet = 0x00;
++	Boolean bRet = 0x01;
+ 	
+ 	XASetOperationRef operationRef = (XASetOperationRef)opaqueRef;
+ 	
+@@ -241,7 +241,21 @@
+ 	
+ 	if(CFStringGetCString(operationRef->key, key, bSize, kCFStringEncodingUTF8))
+ 	{
+-		size = fsetxattr(fd, key, (void *)bytes, size, position, options);
++
++		int fRet = fcntl(fd, F_NOCACHE, 0x01);
++
++		if(fRet < 0x00)
++			fprintf(stderr, "WARN: fcntl for key \"%s\" failed\n", key);
++		
++		int iRet = fsetxattr(fd, key, (void *)bytes, size, position, options);
++		
++		if(iRet < 0x00)
++		{
++			if(errno != EEXIST || errno != ENOATTR)
++				fprintf(stderr, "ERROR: fsetxattr failed: %s\n", strerror(errno));
++
++			bRet = 0x00;
++		}
+ 	}
+ 	
+ 	free(key);	

Added: trunk/dports/sysutils/xattr/files/patch-xattr.c.diff
===================================================================
--- trunk/dports/sysutils/xattr/files/patch-xattr.c.diff	                        (rev 0)
+++ trunk/dports/sysutils/xattr/files/patch-xattr.c.diff	2006-09-14 00:40:13 UTC (rev 19521)
@@ -0,0 +1,15 @@
+--- xattr.c	2005-04-13 07:32:41.000000000 +0200
++++ xattr.c.new	2006-04-19 17:32:57.000000000 +0200
+@@ -19,8 +19,10 @@
+ 	fprintf(stdout, "                   delete a key/value attribute pair\n\n");
+ 	fprintf(stdout, "           --list: [-l]  list all key/value attribute pairs\n\n");
+ 	fprintf(stdout, " --list-parseable: [-lp] list all key/value attribute pairs in a parseable format\n\n");
+-	fprintf(stdout, "            --get: [-g]  print key/value pair\n\n");
+-	fprintf(stdout, "  --get-parseable: [-gp] print key/value pair in a parseable format\n\n");
++	fprintf(stdout, "            --get: [-g]  key path\n");
++	fprintf(stdout, "                   print key/value pair\n\n");
++	fprintf(stdout, "  --get-parseable: [-gp] key path\n");
++	fprintf(stdout, "                   print key/value pair in a parseable format\n\n");
+ }
+ 
+ int main(int argc, char **argv)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20060913/fed6bd2c/attachment.html


More information about the macports-changes mailing list