From tobez@tobez.org  Fri Feb 14 05:51:23 2003
Return-Path: <tobez@tobez.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 21CCB37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 14 Feb 2003 05:51:23 -0800 (PST)
Received: from heechee.tobez.org (heechee.tobez.org [213.237.10.254])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6FE2B43F75
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 14 Feb 2003 05:51:21 -0800 (PST)
	(envelope-from tobez@tobez.org)
Received: by heechee.tobez.org (Postfix, from userid 1001)
	id 71D9F2C708E; Fri, 14 Feb 2003 14:51:18 +0100 (CET)
Message-Id: <20030214135118.71D9F2C708E@heechee.tobez.org>
Date: Fri, 14 Feb 2003 14:51:18 +0100 (CET)
From: Anton Berezin <tobez@FreeBSD.org>
Reply-To: Anton Berezin <tobez@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Patch editors/vim to use fetch instead of wget for network file editing
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>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:    obrien
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 14 06:00:28 PST 2003
>Closed-Date:    Mon Jan 02 23:18:23 GMT 2006
>Last-Modified:  Tue Jan 03 08:42:28 GMT 2006
>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:
Responsible-Changed-From-To: freebsd-ports-bugs->obrien 
Responsible-Changed-By: tobez 
Responsible-Changed-When: Fri Feb 14 15:02:32 CET 2003 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=48281 
State-Changed-From-To: open->feedback 
State-Changed-By: obrien 
State-Changed-When: Mon Oct 24 01:40:33 GMT 2005 
State-Changed-Why:  
Vim 6.4 attempts to take into account FreeBSD's 'fetch'. 
Can you check to see if you think that 6.4's plugin/netrw.vim is sufficient 
or not? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=48281 
State-Changed-From-To: feedback->closed 
State-Changed-By: edwin 
State-Changed-When: Mon Jan 2 23:17:56 UTC 2006 
State-Changed-Why:  
Should be changed in vim 6.4

http://www.freebsd.org/cgi/query-pr.cgi?pr=48281 
>Unformatted:
