[58151] trunk/dports/lang/python26

blb at macports.org blb at macports.org
Tue Sep 22 19:46:13 PDT 2009


Revision: 58151
          http://trac.macports.org/changeset/58151
Author:   blb at macports.org
Date:     2009-09-22 19:46:10 -0700 (Tue, 22 Sep 2009)
Log Message:
-----------
lang/python26 - fix getgroups implementation with Apple patch, ticket #21559

Modified Paths:
--------------
    trunk/dports/lang/python26/Portfile

Added Paths:
-----------
    trunk/dports/lang/python26/files/posixmodule.c.ed

Modified: trunk/dports/lang/python26/Portfile
===================================================================
--- trunk/dports/lang/python26/Portfile	2009-09-23 02:03:56 UTC (rev 58150)
+++ trunk/dports/lang/python26/Portfile	2009-09-23 02:46:10 UTC (rev 58151)
@@ -5,7 +5,7 @@
 
 name                    python26
 version                 2.6.2
-revision                5
+revision                6
 set major               [lindex [split $version .] 0]
 set branch              [join [lrange [split ${version} .] 0 1] .]
 categories              lang
@@ -70,6 +70,9 @@
    # http://trac.macports.org/ticket/21517
    system "cd ${worksrcpath} && ed - Modules/_localemodule.c < ${filespath}/_localemodule.c.ed"
    system "cd ${worksrcpath} && ed - Lib/locale.py < ${filespath}/locale.py.ed"
+
+   # http://trac.macports.org/ticket/21559
+   system "cd ${worksrcpath} && ed - Modules/posixmodule.c < ${filespath}/posixmodule.c.ed"
 }
 
 build.target            all

Added: trunk/dports/lang/python26/files/posixmodule.c.ed
===================================================================
--- trunk/dports/lang/python26/files/posixmodule.c.ed	                        (rev 0)
+++ trunk/dports/lang/python26/files/posixmodule.c.ed	2009-09-23 02:46:10 UTC (rev 58151)
@@ -0,0 +1,66 @@
+/PyInt_FromLong((long)st->st_uid)/s//PyInt_FromLong((long)(int)st->st_uid)/
+/PyInt_FromLong((long)st->st_gid)/s//PyInt_FromLong((long)(int)st->st_gid)/
+/^posix_chown/a
+.
+/long uid, gid;/s//int uid, gid;/
+/"etll:chown"/s//"etii:chown"/
+/return PyInt_FromLong((long)getegid());/s//return PyInt_FromLong((long)(int)getegid());/
+/return PyInt_FromLong((long)geteuid());/s//return PyInt_FromLong((long)(int)geteuid());/
+/return PyInt_FromLong((long)getgid());/s//return PyInt_FromLong((long)(int)getgid());/
+/^posix_getgroups/-1i
+#include <pwd.h>
+int getgrouplist_2(const char *name, gid_t basegid, gid_t **groups);
+
+.
+/gid_t grouplist\[MAX_GROUPS\];/c
+        gid_t *grouplist = NULL;
+        struct passwd *pw;
+.
+/n = getgroups(MAX_GROUPS, grouplist);/c
+        if ((pw = getpwuid(getuid())) == NULL) {
+            errno = EINVAL;
+            posix_error();
+            return NULL;
+        }
+        n = getgrouplist_2(pw->pw_name, pw->pw_gid, &grouplist);
+.
+/if (n < 0)/c
+        if (n < 0) {
+            errno = EINVAL;
+.
+/else {/s//} else {/
+/PyInt_FromLong((long)grouplist\[i\]);/s//PyInt_FromLong((long)(int)grouplist[i]);/
+/return result;/i
+    if (grouplist) free(grouplist);
+.
+/return PyInt_FromLong((long)getuid());/s//return PyInt_FromLong((long)(int)getuid());/
+/^posix_setgroups/a
+.
+/gid_t grouplist\[MAX_GROUPS\];/s//gid_t *grouplist;/
+/if (len > MAX_GROUPS) {/a
+.
+.,/^[ 	]*}/c
+	if ((grouplist = (gid_t *)malloc(len * sizeof(gid_t))) == NULL) {
+		PyErr_NoMemory();
+		return NULL;
+	}
+.
+/if (grouplist\[i\] != x) {/s//if ((int)grouplist[i] != x) {/
+/if (grouplist\[i\] != x) {/s//if ((int)grouplist[i] != x) {/
+/Py_INCREF(Py_None);/i
+	free(grouplist);
+.
+/^static struct constdef posix_constants_confstr/a
+.
+/^};/i
+#ifdef _CS_DARWIN_USER_DIR
+    {"CS_DARWIN_USER_DIR", _CS_DARWIN_USER_DIR},
+#endif
+#ifdef _CS_DARWIN_USER_TEMP_DIR
+    {"CS_DARWIN_USER_TEMP_DIR", _CS_DARWIN_USER_TEMP_DIR},
+#endif
+#ifdef _CS_DARWIN_USER_CACHE_DIR
+    {"CS_DARWIN_USER_CACHE_DIR", _CS_DARWIN_USER_CACHE_DIR},
+#endif
+.
+w
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090922/891361d6/attachment.html>


More information about the macports-changes mailing list