[Python-apps-commits] r6082 - in packages/gtg/trunk/debian (3 files)
dktrkranz at users.alioth.debian.org
dktrkranz at users.alioth.debian.org
Sun Sep 5 08:54:05 UTC 2010
Date: Sunday, September 5, 2010 @ 08:53:58
Author: dktrkranz
Revision: 6082
* debian/patches/x_is_running.patch:
- Check existence of X lock files and associated PIDs to see if X
is running (Closes: #595430).
Added:
packages/gtg/trunk/debian/patches/x_is_running.patch
Modified:
packages/gtg/trunk/debian/changelog
packages/gtg/trunk/debian/patches/series
Modified: packages/gtg/trunk/debian/changelog
===================================================================
--- packages/gtg/trunk/debian/changelog 2010-09-05 01:48:08 UTC (rev 6081)
+++ packages/gtg/trunk/debian/changelog 2010-09-05 08:53:58 UTC (rev 6082)
@@ -1,3 +1,11 @@
+gtg (0.2.4-4) UNRELEASED; urgency=low
+
+ * debian/patches/x_is_running.patch:
+ - Check existence of X lock files and associated PIDs to see if X
+ is running (Closes: #595430).
+
+ -- Luca Falavigna <dktrkranz at debian.org> Sun, 05 Sep 2010 10:49:08 +0200
+
gtg (0.2.4-3) unstable; urgency=low
* debian/patches/xml_temp_file.patch:
Modified: packages/gtg/trunk/debian/patches/series
===================================================================
--- packages/gtg/trunk/debian/patches/series 2010-09-05 01:48:08 UTC (rev 6081)
+++ packages/gtg/trunk/debian/patches/series 2010-09-05 08:53:58 UTC (rev 6082)
@@ -1,3 +1,4 @@
test_executable.patch
reaper_hang.patch
xml_temp_file.patch
+x_is_running.patch
Added: packages/gtg/trunk/debian/patches/x_is_running.patch
===================================================================
--- packages/gtg/trunk/debian/patches/x_is_running.patch (rev 0)
+++ packages/gtg/trunk/debian/patches/x_is_running.patch 2010-09-05 08:53:58 UTC (rev 6082)
@@ -0,0 +1,27 @@
+Check existence of X lock files and associated PIDs to see if X is running
+
+Index: gtg-0.2.4/gtg
+===================================================================
+--- gtg-0.2.4.orig/gtg 2010-09-05 01:48:47.340398151 +0200
++++ gtg-0.2.4/gtg 2010-09-05 01:49:39.808415847 +0200
+@@ -32,10 +32,17 @@
+ from optparse import OptionParser
+
+ def X_is_running():
++ from glob import glob
+ from subprocess import Popen, PIPE
+- p = Popen(["xset", "-q"], stdout=PIPE, stderr=PIPE)
+- p.communicate()
+- return p.returncode == 0
++ for lock in glob("/tmp/.X*-lock"):
++ file = open(lock, "r")
++ pid = file.read().strip()
++ file.close()
++ p = Popen(["ps", "-p", pid], stdout=PIPE, stderr=PIPE)
++ p.communicate()
++ if p.returncode == 0:
++ return True
++ return False
+
+ try:
+ parser = OptionParser()
More information about the Python-apps-commits
mailing list