aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorperky <perky@FreeBSD.org>2007-03-29 15:20:09 +0800
committerperky <perky@FreeBSD.org>2007-03-29 15:20:09 +0800
commit694d3d582d3e6428377d49d84a50fdf1b4f7f491 (patch)
tree3e459612befff92accc58ab5d55dcb6cd35c2336 /devel
parente4300b515839f100bf9499063c2ace3fcfc3d2f5 (diff)
downloadfreebsd-ports-gnome-694d3d582d3e6428377d49d84a50fdf1b4f7f491.tar.gz
freebsd-ports-gnome-694d3d582d3e6428377d49d84a50fdf1b4f7f491.tar.zst
freebsd-ports-gnome-694d3d582d3e6428377d49d84a50fdf1b4f7f491.zip
- Add a patch to fix a bug on setproctitle support. [1]
- Pass the maintainership to python@. PR: 108085 Submitted by: Martin Kammerhofer <dada@pluto.tugraz.at>
Diffstat (limited to 'devel')
-rw-r--r--devel/py-freebsd/Makefile3
-rw-r--r--devel/py-freebsd/files/patch-src-process.c52
2 files changed, 54 insertions, 1 deletions
diff --git a/devel/py-freebsd/Makefile b/devel/py-freebsd/Makefile
index f297b1b4a00a..a6adbc551bbc 100644
--- a/devel/py-freebsd/Makefile
+++ b/devel/py-freebsd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= freebsd
PORTVERSION= 0.9.3
+PORTREVISION= 1
CATEGORIES= devel python
MASTER_SITES= ${MASTER_SITE_LOCAL} \
http://people.freebsd.org/~perky/distfiles/
@@ -14,7 +15,7 @@ MASTER_SITE_SUBDIR= perky
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
DISTNAME= py-freebsd-${PORTVERSION}
-MAINTAINER= perky@FreeBSD.org
+MAINTAINER= python@FreeBSD.org
COMMENT= Python interface to FreeBSD-specific system libraries
USE_PYTHON= 2.3+
diff --git a/devel/py-freebsd/files/patch-src-process.c b/devel/py-freebsd/files/patch-src-process.c
new file mode 100644
index 000000000000..910492080eb0
--- /dev/null
+++ b/devel/py-freebsd/files/patch-src-process.c
@@ -0,0 +1,52 @@
+--- src/process.c.orig Sun May 8 08:55:00 2005
++++ src/process.c Sat Nov 25 18:12:52 2006
+@@ -51,10 +51,19 @@
+ static PyObject *
+ PyFB_setprogname(PyObject *self, PyObject *args)
+ {
+- char *progname;
++ const char *progname;
++ static PyObject *namestr = NULL;
+
+ if (!PyArg_ParseTuple(args, "s:setprogname", &progname))
+ return NULL;
++ /*
++ * Setprogname(3) does not copy the string, it only stores the
++ * string pointer. Make sure that the string object does not
++ * get garbage collected and its memory reused!
++ */
++ Py_XDECREF(namestr); /* maybe free old progname */
++ PyArg_ParseTuple(args, "O", &namestr);
++ Py_INCREF(namestr); /* keep new progname object */
+
+ setprogname(progname);
+ Py_RETURN_NONE;
+@@ -64,16 +73,24 @@
+ static char PyFB_setproctitle__doc__[] =
+ "setproctitle(title):\n"
+ "The setproctitle() library routine sets the process title that\n"
+-"appears on the ps(1) command.";
++"appears on the ps(1) command. The progname and a colon are\n"
++"prepended automatically. This behaviour is suppressed when the\n"
++"title starts with a dash (-) character. Calling with a None\n"
++"argument restores a default process title.";
+
+ static PyObject *
+ PyFB_setproctitle(PyObject *self, PyObject *args)
+ {
+- char *newtitle;
++ const char *newtitle;
+
+- if (!PyArg_ParseTuple(args, "s:setproctitle", &newtitle))
++ if (!PyArg_ParseTuple(args, "z:setproctitle", &newtitle))
+ return NULL;
+
+- setproctitle(newtitle);
++ if (newtitle == NULL)
++ setproctitle(NULL);
++ else if (*newtitle == '-')
++ setproctitle("-%s", newtitle+1);
++ else
++ setproctitle("%s", newtitle);
+ Py_RETURN_NONE;
+ }