Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Feb 2003 14:51:18 +0100 (CET)
From:      Anton Berezin <tobez@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/48281: Patch editors/vim to use fetch instead of wget for network file editing
Message-ID:  <20030214135118.71D9F2C708E@heechee.tobez.org>

next in thread | raw e-mail | index | archive | help

>Number:         48281
>Category:       ports
>Synopsis:       Patch editors/vim to use fetch instead of wget for network file editing
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 14 06:00:28 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Anton Berezin
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
>Environment:
System: FreeBSD heechee.tobez.org 4.7-STABLE FreeBSD 4.7-STABLE #0: Sat Jan 25 21:10:24 CET 2003 tobez@heechee.tobez.org:/usr/home/tobez/src/FreeBSD/RELENG_4/obj/usr/home/tobez/src/FreeBSD/RELENG_4/src/sys/HEECHEE i386


	
>Description:

The new network file editing feature in vim 6.1 uses wget for http://XXX
file editing.  As wget is not a utility installed by default on FreeBSD,
it seems useful to patch vim to use fetch(1) instead.

>How-To-Repeat:

Install lang/vim port and type vim http://www.freebsd.org/ without
having ftp/wget port installed.

>Fix:

A new file, files/patch-netrw.vim, is introduced by this patch.  I have
not bumped the PORTREVISION, leaving this to the maintainer;  sorry
about that.

diff -u --show-c-function -ruN vim.orig/files/patch-netrw.vim vim/files/patch-netrw.vim
--- files/patch-netrw.vim	Thu Jan  1 01:00:00 1970
+++ files/patch-netrw.vim	Fri Feb 14 14:30:40 2003
@@ -0,0 +1,59 @@
+--- ../runtime/plugin/netrw.vim.orig	Fri Feb 14 13:53:44 2003
++++ ../runtime/plugin/netrw.vim	Fri Feb 14 13:54:17 2003
+@@ -38,7 +38,7 @@
+ " :Nread "machine file"				uses ftp   with <.netrc>
+ " :Nread "machine id password file"		uses ftp
+ " :Nread "ftp://[user@]machine[[:#]port]/file"	uses ftp   autodetects <.netrc>
+-" :Nread "http://[user@]machine/file"		uses http  uses wget
++" :Nread "http://[user@]machine/file"		uses http  uses fetch
+ " :Nread "rcp://[user@]machine/file"		uses rcp
+ " :Nread "scp://[user@]machine/file"		uses scp
+ " :Nread "dav://machine[:port]/file"		uses cadaver
+@@ -179,7 +179,7 @@ function! s:NetRead(...)
+     echo ':Nread "machine path"                    uses ftp   with <.netrc>'
+     echo ':Nread "machine id password path"        uses ftp'
+     echo ':Nread ftp://[user@]machine[:port]/path  uses ftp   autodetects <.netrc>'
+-    echo ":Nread http://[user@]machine/path        uses http  wget"
++    echo ":Nread http://[user@]machine/path        uses http  fetch"
+     echo ":Nread rcp://[user@]machine/path         uses rcp"
+     echo ":Nread scp://[user@]machine/path         uses scp"
+     echo ":Nread dav://machine[:port]/path         uses cadaver"
+@@ -292,17 +292,17 @@ function! s:NetRead(...)
+    let result = s:NetGetFile(readcmd, tmpfile)
+    let b:netrw_lastfile = choice
+ 
+-  elseif     b:netrw_method  == 5	" read with http (wget)
++  elseif     b:netrw_method  == 5	" read with http (fetch)
+ "	Decho "DBG: read via http (method #5)"
+    if match(b:netrw_fname,"#") == -1
+-    exe "!wget -O " . tmpfile . " http://" . g:netrw_machine . b:netrw_fname
++    exe "!fetch -o " . tmpfile . " http://" . g:netrw_machine . b:netrw_fname
+     let result = s:NetGetFile(readcmd, tmpfile)
+    else
+     let netrw_html= substitute(b:netrw_fname,"#.*$","","")
+     let netrw_tag = substitute(b:netrw_fname,"^.*#","","")
+ "    	call Decho("DBG: netrw_html<".netrw_html.">")
+ "    	call Decho("DBG: netrw_tag <".netrw_tag.">")
+-    exe "!wget -O " . tmpfile . " http://" . g:netrw_machine . netrw_html
++    exe "!fetch -o " . tmpfile . " http://" . g:netrw_machine . netrw_html
+     let result = s:NetGetFile(readcmd, tmpfile)
+     exe 'norm! 1G/<\s*a\s\+name=\s*"'.netrw_tag.'"/\<CR>'
+    endif
+@@ -544,7 +544,7 @@ endfunction
+ "	     2: ftp + <.netrc>
+ "	     3: ftp + machine, id, password, and [path]filename
+ "	     4: scp
+-"	     5: http (wget)
++"	     5: http (fetch)
+ "	     6: cadaver
+ function! s:NetMethod(choice)  " globals: method machine id passwd fname
+ "	Decho "DBG: NetMethod(a:choice<".a:choice.">) {"
+@@ -562,7 +562,7 @@ function! s:NetMethod(choice)  " globals
+  " rcpurm : rcp://[user@]host/filename			Use rcp
+  " rcphf  : [user@]host:filename			Use rcp
+  " scpurm : scp://[user@]host/filename			Use scp
+- " httpurm: http://[user@]host/filename			Use wget
++ " httpurm: http://[user@]host/filename			Use fetch
+  " davurm : dav://host[:port]/path                      Use cadaver
+  let mipf   = '\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)'
+  let mf     = '\(\S\+\)\s\+\(\S\+\)'

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030214135118.71D9F2C708E>