pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/hub hub: Avoid possible vim-isms when vi(1) is used



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7722652121f1
branches:  trunk
changeset: 309144:7722652121f1
user:      leot <leot%pkgsrc.org@localhost>
date:      Sun Jun 10 10:42:56 2018 +0000

description:
hub: Avoid possible vim-isms when vi(1) is used

If the editor used matches the `\b(?:[gm]?vim|vi)(?:\.exe)?$' regular
expression hub automatically add as arguments `--cmd'. The `--cmd' passed is
probably supported only by vim so delete the `|vi' from the RE in order to not
append possible non-standard arguments to non-vim vi-s.

(This was spotted using `hub pull-request' that failed due non supported
argument passed to vi)

Bump PKGREVISION

diffstat:

 net/hub/Makefile                       |   3 ++-
 net/hub/distinfo                       |   3 ++-
 net/hub/patches/patch-github_editor.go |  18 ++++++++++++++++++
 3 files changed, 22 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r 1ab80daa9f44 -r 7722652121f1 net/hub/Makefile
--- a/net/hub/Makefile  Sun Jun 10 04:35:53 2018 +0000
+++ b/net/hub/Makefile  Sun Jun 10 10:42:56 2018 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.5 2018/06/01 15:46:43 leot Exp $
+# $NetBSD: Makefile,v 1.6 2018/06/10 10:42:56 leot Exp $
 
 DISTNAME=      hub-2.3.0
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=github/}
 GITHUB_TAG=    v${PKGVERSION_NOREV}
diff -r 1ab80daa9f44 -r 7722652121f1 net/hub/distinfo
--- a/net/hub/distinfo  Sun Jun 10 04:35:53 2018 +0000
+++ b/net/hub/distinfo  Sun Jun 10 10:42:56 2018 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.2 2018/06/01 15:42:22 leot Exp $
+$NetBSD: distinfo,v 1.3 2018/06/10 10:42:56 leot Exp $
 
 SHA1 (hub-2.3.0.tar.gz) = 5e88d5f1226d21f129d844d7a2daaf72297fd040
 RMD160 (hub-2.3.0.tar.gz) = 9f1ce6f14d35f550e5bc3b7c845519cf5b5d9aac
 SHA512 (hub-2.3.0.tar.gz) = 560b4efde80d9074111b2adcf7fe29ce751d2bc185d5e5f9a86b05dbc62f9df9d712a5684c8ff9acd73047d2eb99735beb087a69f23cf162a14488655fd77bdf
 Size (hub-2.3.0.tar.gz) = 978882 bytes
+SHA1 (patch-github_editor.go) = fa21efb055ea91c689eceb676548cf528a6aaefe
diff -r 1ab80daa9f44 -r 7722652121f1 net/hub/patches/patch-github_editor.go
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/hub/patches/patch-github_editor.go    Sun Jun 10 10:42:56 2018 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-github_editor.go,v 1.1 2018/06/10 10:42:56 leot Exp $
+
+Avoid vim-isms.
+
+vi(1) is not always vim, avoid to treat it as such and to pass to
+it possible not supported arguments.
+
+--- github/editor.go.orig      2018-05-29 13:34:37.000000000 +0000
++++ github/editor.go
+@@ -129,7 +129,7 @@ func (e *Editor) readContent() (content 
+ 
+ func openTextEditor(program, file string) error {
+       editCmd := cmd.New(program)
+-      r := regexp.MustCompile(`\b(?:[gm]?vim|vi)(?:\.exe)?$`)
++      r := regexp.MustCompile(`\b(?:[gm]?vim)(?:\.exe)?$`)
+       if r.MatchString(editCmd.Name) {
+               editCmd.WithArg("--cmd")
+               editCmd.WithArg("set ft=gitcommit tw=0 wrap lbr")



Home | Main Index | Thread Index | Old Index