openbsd-ports/devel/xdg-utils/patches/patch-scripts_xdg-open
ajacoutot 6647e5c240 We don't provide a share/applications/defaults.list file so use
mimeinfo.cache instead (and this file actually contains mimes we do
suport).
Fix typo in xdg-open.

Fixes xdg-open and xdg-mime issues dcoppa@ reported.
ok dcoppa@
2010-05-28 12:41:26 +00:00

38 lines
1.2 KiB
Plaintext

$OpenBSD: patch-scripts_xdg-open,v 1.4 2010/05/28 12:41:26 ajacoutot Exp $
--- scripts/xdg-open.orig Sun Jun 24 21:58:01 2007
+++ scripts/xdg-open Sun Aug 16 01:11:30 2009
@@ -364,7 +364,9 @@ open_generic()
for browser in $BROWSER; do
if [ x"$browser" != x"" ]; then
- browser_with_arg=`echo "$browser" | sed s#%s#"$1"#`
+ browser_with_arg=`printf "$browser" "$1" 2>/dev/null`
+ if [ $? -ne 0 ]; then browser_with_arg=$browser;
+ fi
if [ x"$browser_with_arg" = x"$browser" ]; then "$browser" "$1";
else $browser_with_arg;
@@ -403,12 +405,21 @@ if [ -z "${url}" ] ; then
exit_failure_syntax "file or URL argument missing"
fi
+if which xdg-open-hook > /dev/null 2> /dev/null; then
+ xdg-open-hook "$url"
+ if [ $? -eq 0 ]; then
+ exit_success
+ else
+ exit_failure_operation_failed
+ fi
+fi
+
detectDE
if [ x"$DE" = x"" ]; then
# if BROWSER variable is not set, check some well known browsers instead
if [ x"$BROWSER" = x"" ]; then
- BROWSER=firefox:mozilla:netscape
+ BROWSER=firefox:seamonkey:epiphany:opera:mozilla:netscape
fi
DE=generic
fi