On Mon, Mar 20, 2023 at 01:49:23PM +0000, Stuart Henderson wrote:
> On 2023/03/20 01:32, Sven M. Hallberg wrote:
> > - gschem calls xdg-open on file:///usr/local/.../foo.html for documentation,
> > so I added devel/xdg-utils to RUN_DEPENDS.
> > Nevertheless, on my system, this does not work. xdg-open does not
> > seem to know what to do and says
> >
> > xdg-open: file 'file:///.../foo.html' does not exist
> >
> > The file does exist. I can reproduce this behavior by running:
> >
> > $ xdg-open file:///tmp/foo.html
> >
> > Is this just a problem with my settings?
>
> This involves a check which works with GNU grep, but not ours.
>
> Not sure whether it makes sense to patch for release or not,
> any opinions Antoine/naddy?
Yes, ok aja
>
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/xdg-utils/Makefile,v
> retrieving revision 1.36
> diff -u -p -r1.36 Makefile
> --- Makefile 2 Jul 2022 08:47:23 -0000 1.36
> +++ Makefile 20 Mar 2023 13:36:07 -0000
> @@ -5,6 +5,7 @@
> COMMENT= utilities to assist desktop integration tasks
>
> DISTNAME= xdg-utils-1.1.3.20210805
> +REVISION= 0
>
> # use a git checkout; releases are not made regularly
> COMMIT= 1a58bc28f6844898532daf9ee1bf6da7764955a9
> Index: patches/patch-scripts_xdg-open_in
> ===================================================================
> RCS file: /cvs/ports/devel/xdg-utils/patches/patch-scripts_xdg-open_in,v
> retrieving revision 1.8
> diff -u -p -r1.8 patch-scripts_xdg-open_in
> --- patches/patch-scripts_xdg-open_in 2 Jul 2022 08:47:23 -0000 1.8
> +++ patches/patch-scripts_xdg-open_in 20 Mar 2023 13:36:07 -0000
> @@ -1,8 +1,17 @@
> -Fix sed(1) usage (i.e. !GNU sed).
> +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()
>
--
Antoine