On Tue, 21 Jan 2020 at 17:32:51 -0700, Aaron Bieber wrote:
> Hi,
> 
> This diff does two things:
> 
> - Fix vmctl completion. Currently the hostname bits are off.
> - Fix 'fish_config' now that browsers are unveil'd.
> 
> Both patches have been sent upstream:
>   https://github.com/fish-shell/fish-shell/pull/6523
>   https://github.com/fish-shell/fish-shell/pull/6522
> 
> OK?
> 

Previous diff was incorrect. Here is a fixed version that uses python 3 and has
a re-gen'd PLIST

diff --git a/shells/fish/Makefile b/shells/fish/Makefile
index 41e58668faf..87154ffe195 100644
--- a/shells/fish/Makefile
+++ b/shells/fish/Makefile
@@ -4,7 +4,7 @@ COMMENT =               friendly interactive shell
 
 V =                    3.0.2
 DISTNAME =             fish-$V
-REVISION =             1
+REVISION =             2
 
 CATEGORIES =           shells
 
@@ -37,6 +37,7 @@ LIB_DEPENDS =         devel/pcre2 \
 
 RUN_DEPENDS =          misc/gnugetopt
 
+MODPY_VERSION =                ${MODPY_DEFAULT_VERSION_3}
 MODPY_ADJ_FILES =      share/tools/create_manpage_completions.py \
                        share/tools/deroff.py \
                        share/tools/web_config/webconfig.py
diff --git a/shells/fish/patches/patch-share_completions_vmctl_fish 
b/shells/fish/patches/patch-share_completions_vmctl_fish
new file mode 100644
index 00000000000..023c845466d
--- /dev/null
+++ b/shells/fish/patches/patch-share_completions_vmctl_fish
@@ -0,0 +1,20 @@
+$OpenBSD$
+
+https://github.com/fish-shell/fish-shell/pull/6523
+
+Index: share/completions/vmctl.fish
+--- share/completions/vmctl.fish.orig
++++ share/completions/vmctl.fish
+@@ -1,4 +1,11 @@
+ 
++function __fish_get_vmctl_vms
++      for line in (vmctl status | string match -e -v "MAXMEM");
++              set a (string split " " $line)
++              and printf "%s " $a[-1]
++      end
++end
++
+ complete -c vmctl -xa 'console create load log reload reset start status stop 
pause unpause send receive' -n 'not __fish_seen_subcommand_from list console 
create load log reload reset start status stop pause unpause send receive'
+-complete -c vmctl -n '__fish_seen_subcommand_from console reload reset start 
status stop pause unpause send receive' -xa '(vmctl status | string match -e -v 
"MAXMEM" | string replace -r "^(\s+\S+\s+){7}" "")'
++complete -c vmctl -n '__fish_seen_subcommand_from console reload reset start 
status stop pause unpause send receive' -xa (__fish_get_vmctl_vms)
+ 
diff --git a/shells/fish/patches/patch-share_tools_web_config_webconfig_py 
b/shells/fish/patches/patch-share_tools_web_config_webconfig_py
new file mode 100644
index 00000000000..d2dfdb345ea
--- /dev/null
+++ b/shells/fish/patches/patch-share_tools_web_config_webconfig_py
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+https://github.com/fish-shell/fish-shell/pull/6522
+
+Index: share/tools/web_config/webconfig.py
+--- share/tools/web_config/webconfig.py.orig
++++ share/tools/web_config/webconfig.py
+@@ -1172,10 +1172,15 @@ url = 'http://localhost:%d/%s/%s' % (PORT, authkey, in
+ # Create temporary file to hold redirect to real server. This prevents 
exposing
+ # the URL containing the authentication key on the command line (see
+ # CVE-2014-2914 or https://github.com/fish-shell/fish-shell/issues/1438).
+-if 'XDG_CACHE_HOME' in os.environ:
+-    dirname = os.path.expanduser(os.path.expandvars('$XDG_CACHE_HOME/fish/'))
++if platform.system() == 'OpenBSD':
++    # On OpenBSD the main browsers use unveil, which prevents file access
++    # to most of the disk. ~/Downloads is unrestricted in both, so use that.
++    dirname = os.path.expanduser('~/Downloads/fish/')
+ else:
+-    dirname = os.path.expanduser('~/.cache/fish/')
++    if 'XDG_CACHE_HOME' in os.environ:
++        dirname = 
os.path.expanduser(os.path.expandvars('$XDG_CACHE_HOME/fish/'))
++    else:
++        dirname = os.path.expanduser('~/.cache/fish/')
+ 
+ os.umask(0o0077)
+ try:
diff --git a/shells/fish/pkg/PLIST b/shells/fish/pkg/PLIST
index bde804df0b2..fc720cee435 100644
--- a/shells/fish/pkg/PLIST
+++ b/shells/fish/pkg/PLIST
@@ -921,11 +921,14 @@ share/fish/man/man1/
 @man share/fish/man/man1/wait.1
 @man share/fish/man/man1/while.1
 share/fish/tools/
+${MODPY_COMMENT}share/fish/tools/${MODPY_PYCACHE}/
+share/fish/tools/${MODPY_PYCACHE}create_manpage_completions.${MODPY_PYC_MAGIC_TAG}pyc
+share/fish/tools/${MODPY_PYCACHE}deroff.${MODPY_PYC_MAGIC_TAG}pyc
 share/fish/tools/create_manpage_completions.py
-share/fish/tools/create_manpage_completions.pyc
 share/fish/tools/deroff.py
-share/fish/tools/deroff.pyc
 share/fish/tools/web_config/
+${MODPY_COMMENT}share/fish/tools/web_config/${MODPY_PYCACHE}/
+share/fish/tools/web_config/${MODPY_PYCACHE}webconfig.${MODPY_PYC_MAGIC_TAG}pyc
 share/fish/tools/web_config/delete.png
 share/fish/tools/web_config/favicon.png
 share/fish/tools/web_config/fishconfig.css
@@ -963,17 +966,35 @@ 
share/fish/tools/web_config/sample_prompts/screen_savvy.fish
 share/fish/tools/web_config/sample_prompts/sorin.fish
 share/fish/tools/web_config/sample_prompts/terlar.fish
 share/fish/tools/web_config/webconfig.py
-share/fish/tools/web_config/webconfig.pyc
 share/fish/vendor_completions.d/
 share/fish/vendor_conf.d/
 share/fish/vendor_functions.d/
+share/locale/
+share/locale/de/
+share/locale/de/LC_MESSAGES/
 share/locale/de/LC_MESSAGES/fish.mo
+share/locale/en/
+share/locale/en/LC_MESSAGES/
 share/locale/en/LC_MESSAGES/fish.mo
+share/locale/fr/
+share/locale/fr/LC_MESSAGES/
 share/locale/fr/LC_MESSAGES/fish.mo
+share/locale/nb/
+share/locale/nb/LC_MESSAGES/
 share/locale/nb/LC_MESSAGES/fish.mo
+share/locale/nn/
+share/locale/nn/LC_MESSAGES/
 share/locale/nn/LC_MESSAGES/fish.mo
+share/locale/pl/
+share/locale/pl/LC_MESSAGES/
 share/locale/pl/LC_MESSAGES/fish.mo
+share/locale/pt_BR/
+share/locale/pt_BR/LC_MESSAGES/
 share/locale/pt_BR/LC_MESSAGES/fish.mo
+share/locale/sv/
+share/locale/sv/LC_MESSAGES/
 share/locale/sv/LC_MESSAGES/fish.mo
+share/locale/zh_CN/
+share/locale/zh_CN/LC_MESSAGES/
 share/locale/zh_CN/LC_MESSAGES/fish.mo
 share/pkgconfig/fish.pc

-- 
PGP: 0x1F81112D62A9ADCE / 3586 3350 BFEA C101 DB1A  4AF0 1F81 112D 62A9 ADCE

Reply via email to