ports/devel/xdg-utils/patches/patch-scripts_xdg-open_in

33 lines
1.1 KiB
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Fix sed(1), grep(1) usage (i.e. !GNU).
Index: scripts/xdg-open.in
--- scripts/xdg-open.in.orig
+++ scripts/xdg-open.in
@@ -84,7 +84,7 @@ is_file_url_or_path()
file_url_to_path()
{
local file="$1"
- if echo "$file" | grep -q '^file://\(localhost\)\?/'; then
+ if echo "$file" | grep -Eq '^file://(localhost)?/'; then
file=${file#file://localhost}
file=${file#file://}
file=${file%%#*}
@@ -354,7 +354,7 @@ DEBUG 3 "$xdg_user_dir:$xdg_system_dirs"
open_generic_xdg_file_mime()
{
- filetype=`xdg-mime query filetype "$1" | sed "s/;.*//"`
+ filetype=`xdg-mime query filetype "$1" | sed "s/[ ;].*//"`
open_generic_xdg_mime "$1" "$filetype"
}
@@ -439,7 +439,7 @@ open_generic()
if [ x"$BROWSER" = x"" ]; then
BROWSER=www-browser:links2:elinks:links:lynx:w3m
if has_display; then
- BROWSER=x-www-browser:firefox:iceweasel:seamonkey:mozilla:epiphany:konqueror:chromium:chromium-browser:google-chrome:$BROWSER
+ BROWSER=x-www-browser:firefox:chrome:iceweasel:seamonkey:mozilla:epiphany:midori:konqueror:chromium-browser:google-chrome:$BROWSER
fi
fi