Bug#615667: grass: Use xdg-open for GRASS_HTML_BROWSER when available

Christopher James Halse Rogers raof at ubuntu.com
Mon Feb 28 00:15:04 UTC 2011


Package: grass
Version: 6.4.0-2
Severity: wishlist
Tags: patch

When xdg-open is available it would be good to use it for GRASS_HTML_BROWSER
instead of x-www-browser.  The x-www-browser alternate is system-wide, while
xdg-open will use the browser the user has configured in their DE (eg: in
Preferred Applications in GNOME).

The attached git commit changes the www-browser patch to prefer xdg-open over
x-www-browser when available.


-- System Information:
Debian Release: squeeze/sid
  APT prefers natty-updates
  APT policy: (500, 'natty-updates'), (500, 'natty-security'), (500, 'natty')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-5-generic (SMP w/2 CPU cores)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
-------------- next part --------------
>From 596d2d56a70f76d5b5d43d50d722ad16677bee5c Mon Sep 17 00:00:00 2001
From: Thibault Lemaitre <thibault.lemaitre at laposte.net>
Date: Mon, 28 Feb 2011 11:04:59 +1100
Subject: [PATCH] Use xdg-open for GRASS_HTML_BROWSER when available.

---
 debian/patches/www-browser |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/debian/patches/www-browser b/debian/patches/www-browser
index e814734..06d36e6 100644
--- a/debian/patches/www-browser
+++ b/debian/patches/www-browser
@@ -1,8 +1,8 @@
 Index: grass/lib/init/init.sh
 ===================================================================
---- grass.orig/lib/init/init.sh	2011-02-14 17:15:01.000000000 +0100
-+++ grass/lib/init/init.sh	2011-02-14 17:28:01.000000000 +0100
-@@ -325,53 +325,11 @@
+--- grass.orig/lib/init/init.sh	2011-02-28 10:59:35.514747971 +1100
++++ grass/lib/init/init.sh	2011-02-28 11:00:17.216340777 +1100
+@@ -325,53 +325,13 @@
  
  # try and find a web browser if one isn't already specified
  if [ ! "$GRASS_HTML_BROWSER" ] ; then
@@ -18,7 +18,11 @@ Index: grass/lib/init/init.sh
 -	iexplore="$SYSTEMDRIVE/Program Files/Internet Explorer/iexplore.exe"
 -	if [ -f "$iexplore" ] ; then
 -	    GRASS_HTML_BROWSER=$iexplore
--	else
++	if [ -x /usr/bin/xdg-open ] ; then
++		GRASS_HTML_BROWSER=xdg-open
++	elif [ -x /usr/bin/x-www-browser ] ; then
++		GRASS_HTML_BROWSER=x-www-browser
+ 	else
 -	    GRASS_HTML_BROWSER="iexplore"
 -	fi
 -
@@ -38,9 +42,6 @@ Index: grass/lib/init/init.sh
 -	done
 -	if [ -n "$GRASS_HTML_BROWSER" ] ; then
 -	   break
-+	if [ -x /usr/bin/x-www-browser ] ; then
-+		GRASS_HTML_BROWSER=x-www-browser
-+	else 
 +		GRASS_HTML_BROWSER=true
  	fi
 -      done
-- 
1.7.4.1



More information about the Pkg-grass-devel mailing list