ports/139827: [MAINTAINER] deskutils/gtg: add patch
Ruslan Mahmatkhanov
cvs-src at yandex.ru
Wed Oct 21 21:20:03 UTC 2009
>Number: 139827
>Category: ports
>Synopsis: [MAINTAINER] deskutils/gtg: add patch
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Wed Oct 21 21:20:00 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: Ruslan Mahmatkhanov
>Release: FreeBSD 8.0-RC1
>Organization:
>Environment:
FreeBSD 8.0-RC1 i386
>Description:
Add patch, that fix code, that checks if there already instance of application is running. It was submitted upstream. See: https://bugs.launchpad.net/gtg/+bug/430816
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
diff -ruN gtg.old/Makefile gtg/Makefile
--- gtg.old/Makefile 2009-09-14 11:53:01.000000000 +0400
+++ gtg/Makefile 2009-10-22 01:03:14.000000000 +0400
@@ -7,7 +7,7 @@
PORTNAME= gtg
PORTVERSION= 0.1.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= deskutils gnome python
MASTER_SITES= http://launchpad.net/gtg/trunk/${PORTVERSION}/+download/
diff -ruN gtg.old/files/patch-GTG_gtg.py gtg/files/patch-GTG_gtg.py
--- gtg.old/files/patch-GTG_gtg.py 1970-01-01 03:00:00.000000000 +0300
+++ gtg/files/patch-GTG_gtg.py 2009-10-22 01:00:54.000000000 +0400
@@ -0,0 +1,40 @@
+--- GTG/gtg.py.orig 2009-07-04 16:26:24.000000000 +0400
++++ GTG/gtg.py 2009-09-16 19:43:28.000000000 +0400
+@@ -58,28 +58,24 @@
+ #we allow one instance of gtg by data directory.
+ def check_instance(directory):
+ """ Check if gtg is already running. """
+- pidfile = directory + "gtg.pid"
++ pidfile = os.path.join(directory, "gtg.pid")
+ if not os.path.exists(pidfile):
+- f = open(pidfile, "w")
+- f.close()
+- os.chmod(pidfile, 0600)
++ open(pidfile, "w").close()
++ os.chmod(pidfile, 0600)
+
+ #see if gtg is already running
+- f = open(pidfile, "r")
+- pid = f.readline()
+- f.close()
++ pid = open(pidfile, "r").readline()
+ if pid:
+- p = os.system("ps --no-heading --pid " + pid)
+- p_name = os.popen("ps -f --pid " + pid).read()
++ p = os.system("/bin/ps %s >/dev/null" % pid)
++ p_name = os.popen("/bin/ps -f %s" % pid).read()
+ if p == 0 and "gtg" in p_name:
+ print _("gtg is already running!")
+ #todo : expose the browser (will be possible when we have dbus)
+ sys.exit(0)
+-
++
+ #write the pid file
+- f = open(pidfile, "w")
+- f.write(str(os.getpid()))
+- f.close()
++ with open(pidfile, "w") as f:
++ f.write(`os.getpid()`)
+
+ #=== MAIN CLASS ================================================================
+
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list