[Python-apps-commits] r5673 - in packages/gtg/trunk/debian (4 files)

dktrkranz at users.alioth.debian.org dktrkranz at users.alioth.debian.org
Thu Jun 24 18:12:51 UTC 2010


    Date: Thursday, June 24, 2010 @ 18:12:31
  Author: dktrkranz
Revision: 5673

* debian/patches/test_executable.patch:
  - Do not launch program to see if it is available, check if it is
    installed and has executable bit enabled instead.

Added:
  packages/gtg/trunk/debian/patches/
  packages/gtg/trunk/debian/patches/series
  packages/gtg/trunk/debian/patches/test_executable.patch
Modified:
  packages/gtg/trunk/debian/changelog

Modified: packages/gtg/trunk/debian/changelog
===================================================================
--- packages/gtg/trunk/debian/changelog	2010-06-24 16:49:49 UTC (rev 5672)
+++ packages/gtg/trunk/debian/changelog	2010-06-24 18:12:31 UTC (rev 5673)
@@ -1,3 +1,11 @@
+gtg (0.2.4-2) UNRELEASED; urgency=low
+
+  * debian/patches/test_executable.patch:
+    - Do not launch program to see if it is available, check if it is
+      installed and has executable bit enabled instead.
+
+ -- Luca Falavigna <dktrkranz at debian.org>  Thu, 24 Jun 2010 20:11:12 +0200
+
 gtg (0.2.4-1) unstable; urgency=low
 
   * New upstream bugfix release.

Added: packages/gtg/trunk/debian/patches/series
===================================================================
--- packages/gtg/trunk/debian/patches/series	                        (rev 0)
+++ packages/gtg/trunk/debian/patches/series	2010-06-24 18:12:31 UTC (rev 5673)
@@ -0,0 +1 @@
+test_executable.patch

Added: packages/gtg/trunk/debian/patches/test_executable.patch
===================================================================
--- packages/gtg/trunk/debian/patches/test_executable.patch	                        (rev 0)
+++ packages/gtg/trunk/debian/patches/test_executable.patch	2010-06-24 18:12:31 UTC (rev 5673)
@@ -0,0 +1,30 @@
+Do not launch program to see if it is available, check if it
+is installed and has executable bit enable instead.
+
+Index: gtg-0.2.4/GTG/tools/openurl.py
+===================================================================
+--- gtg-0.2.4.orig/GTG/tools/openurl.py	2010-04-15 00:04:24.606249645 +0200
++++ gtg-0.2.4/GTG/tools/openurl.py	2010-04-15 00:07:56.202258428 +0200
+@@ -50,14 +50,18 @@
+         status = _os.waitpid(pid, 0)[1]
+         return _os.WIFEXITED(status) and (_os.WEXITSTATUS(status) == 0)
+ 
+-def _test_executable(*args):
+-    return _spawn_executable(True, True, *args)
++def _test_executable(name):
++    for path in _os.getenv('PATH').split(':'):
++        if _os.path.isfile(_os.path.join(path, name)):
++            if _os.access(_os.path.join(path, name), _os.X_OK):
++                return True
++    return False
+ 
+ def _spawn_quiet(*args):
+     return _spawn_executable(True, False, *args)
+ 
+-_has_xdg = _test_executable('xdg-open', '--help')
+-_has_exo = _test_executable('exo-open', '--help')
++_has_xdg = _test_executable('xdg-open')
++_has_exo = _test_executable('exo-open')
+ 
+ def openurl(url):
+     if _has_xdg: # freedesktop is the best choice :p




More information about the Python-apps-commits mailing list