[Rd] available.packages (PR#9841)

zivan.karaman at gmail.com zivan.karaman at gmail.com
Tue Aug 21 17:08:26 CEST 2007


------=_Part_60506_18925213.1187708869863
Content-Type: text/plain; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Thank you very much for your explanation, it woks correctly indeed.




On 8/19/07, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
>
> The documented specification is file:///d:/CRAN (as specified by RFC1738)=
,
> so this is working correctly.
>
> The CHANGES file for 2.2.0 says:
>
>     o   file:// URLs are now interpreted by download.file(),
>         download.packages() and url() in the same way as Mozilla-based
>         browsers.  That is, the expected form is
>
>                 file:///d:/path/to/file
>
>         with *three* slashes.
>
> The point is that this is file:// + host + / + path/to/file, and host is
> missing.  That some versions of IE did not follow the standard is part of
> the confusion here.
>
> Note that ?available.packages does say
>
>      If a repository is
>      local, i.e., the URL starts with '"file:"', then the packages are
>      not downloaded but used directly.  (Both '"file:"' and
>      '"file:///"' are allowed as prefixes to a file path, the latter
>      for an absolute file path.)
>
> but 'file:' does not work with drives on Windows.  That seems clearly to
> rule out your usage.
>
>
> On Fri, 10 Aug 2007, zivan.karaman at gmail.com wrote:
>
> > Full_Name: Zivan Karaman
> > Version: 2.5.1
> > OS: Windows XP SP2
> > Submission from: (NULL) (195.6.68.214)
> >
> >
> > I think that I have encountered a bug in the function "
> available.packages" when
> > using a local repository (file://=85) on Windows.
> >
> > Version information:
> > platform       i386-pc-mingw32
> > arch           i386
> > os             mingw32
> > system         i386, mingw32
> > status
> > major          2
> > minor          5.1
> > year           2007
> > month          06
> > day            27
> > svn rev        42083
> > language       R
> > version.string R version 2.5.1 (2007-06-27)
> >
> > I have made a copy of the CRAN "/bin/windows/contrib/2.5" directory in
> the
> > "D:/CRAN" folder on my machine.
> >
> > When I issue the command:
> >
> > available.packages(contrib.url("file://D:/CRAN"))
> >
> > I get the follwoing message:
> > Error in gzfile(file, "r") : unable to open connection
> > In addition: Warning message:
> > cannot open compressed file ':/CRAN/bin/windows/contrib/2.5/PACKAGES'
> in:
> > gzfile(file, "r")
> >
> > Looking at the source code, I've spotted the following lines which seem
> to cause
> > trouble:
> >
> >            if (.Platform$OS.type =3D=3D "windows") {
> >                if (length(grep("[A-Za-z]:", tmpf)))
> >                  tmpf <- substring(tmpf, 2)
> >            }
> > Deleting them, the function works OK.
> >
> > ______________________________________________
> > R-devel at r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
> >
>
> --
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595

------=_Part_60506_18925213.1187708869863
Content-Type: text/html; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<p class=3D"MsoNormal" style=3D"MARGIN: 0cm 0cm 0pt"><span lang=3D"EN-GB" s=
tyle=3D"mso-ansi-language: EN-GB"><font size=3D"2"><font face=3D"Verdana">T=
hank you very much for your explanation, it woks correctly indeed.</font></=
font></span>
</p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0cm 0cm 0pt"><span lang=3D"EN-GB" s=
tyle=3D"mso-ansi-language: EN-GB"><font size=3D"2"><font face=3D"Verdana">&=
nbsp;</font></font></span></p><br><br>
<div><span class=3D"gmail_quote">On 8/19/07, <b class=3D"gmail_sendername">=
Prof Brian Ripley</b> &lt;<a href=3D"mailto:ripley at stats.ox.ac.uk">ripley at s=
tats.ox.ac.uk</a>&gt; wrote:</span>
<blockquote class=3D"gmail_quote" style=3D"PADDING-LEFT: 1ex; MARGIN: 0px 0=
px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">The documented specification is =
file:///d:/CRAN (as specified by RFC1738),<br>so this is working correctly.
<br><br>The CHANGES file for 2.2.0 says:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;o&n=
bsp;&nbsp; file:// URLs are now interpreted by download.file(),<br>&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;download.packages() and url() in th=
e same way as Mozilla-based<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;browsers.&nbsp;&nbsp;That is, the expected form is
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file:///d:/path/to/file<br><br>&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with *three* slashes.<br><br>The point is =
that this is file:// + host + / + path/to/file, and host is<br>missing.&nbs=
p;&nbsp;That some versions of IE did not follow the standard is part of
<br>the confusion here.<br><br>Note that ?available.packages does say<br><b=
r>&nbsp;&nbsp;&nbsp;&nbsp; If a repository is<br>&nbsp;&nbsp;&nbsp;&nbsp; l=
ocal, i.e., the URL starts with &#39;&quot;file:&quot;&#39;, then the packa=
ges are<br>&nbsp;&nbsp;&nbsp;&nbsp; not downloaded but used directly.&nbsp;=
&nbsp;(Both &#39;&quot;file:&quot;&#39; and
<br>&nbsp;&nbsp;&nbsp;&nbsp; &#39;&quot;file:///&quot;&#39; are allowed as =
prefixes to a file path, the latter<br>&nbsp;&nbsp;&nbsp;&nbsp; for an abso=
lute file path.)<br><br>but &#39;file:&#39; does not work with drives on Wi=
ndows.&nbsp;&nbsp;That seems clearly to<br>rule out your usage.
<br><br><br>On Fri, 10 Aug 2007, <a href=3D"mailto:zivan.karaman at gmail.com"=
>zivan.karaman at gmail.com</a> wrote:<br><br>&gt; Full_Name: Zivan Karaman<br=
>&gt; Version: 2.5.1<br>&gt; OS: Windows XP SP2<br>&gt; Submission from: (N=
ULL) (
<a href=3D"http://195.6.68.214">195.6.68.214</a>)<br>&gt;<br>&gt;<br>&gt; I=
 think that I have encountered a bug in the function &quot;available.packag=
es&quot; when<br>&gt; using a local repository (file://=85) on Windows.<br>
&gt;<br>&gt; Version information:<br>&gt; platform&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; i386-pc-mingw32<br>&gt; arch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp; i386<br>&gt; os&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mingw32<br>&gt; system&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; i386, mingw32<br>&gt; status<br>&gt; maj=
or&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2<br>&gt; min=
or&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
5.1<br>&gt; year&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
; 2007<br>&gt; month&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;06<br>&gt; day&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;27<br>&gt; svn rev&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;42083<br>&gt; language&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; R<br>&gt;=
 version.string R version 2.5.1 (2007-06-27)<br>&gt;<br>&gt; I have made a =
copy of the CRAN &quot;/bin/windows/contrib/2.5&quot; directory in the
<br>&gt; &quot;D:/CRAN&quot; folder on my machine.<br>&gt;<br>&gt; When I i=
ssue the command:<br>&gt;<br>&gt; available.packages(contrib.url(&quot;file=
://D:/CRAN&quot;))<br>&gt;<br>&gt; I get the follwoing message:<br>&gt; Err=
or in gzfile(file, &quot;r&quot;) : unable to open connection
<br>&gt; In addition: Warning message:<br>&gt; cannot open compressed file =
&#39;:/CRAN/bin/windows/contrib/2.5/PACKAGES&#39; in:<br>&gt; gzfile(file, =
&quot;r&quot;)<br>&gt;<br>&gt; Looking at the source code, I&#39;ve spotted=
 the following lines which seem to cause
<br>&gt; trouble:<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (.Platform$OS.type =3D=3D &quot;windows&qu=
ot;) {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (length(grep(&quot;[A-Za-z]:&quot;, t=
mpf)))<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tmpf &lt;- substring(tmpf, 2=
)<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;}<br>&gt; Deleting them, the function works OK.<br>&gt;<br>&gt; __________=
____________________________________<br>&gt; <a href=3D"mailto:R-devel at r-pr=
oject.org">R-devel at r-project.org</a> mailing list<br>&gt;=20
<a href=3D"https://stat.ethz.ch/mailman/listinfo/r-devel">https://stat.ethz=
.ch/mailman/listinfo/r-devel</a><br>&gt;<br><br>--<br>Brian D. Ripley,&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=3D"mailto:ripley at stats.ox.ac.uk">ripley=
@stats.ox.ac.uk
</a><br>Professor of Applied Statistics,&nbsp;&nbsp;<a href=3D"http://www.s=
tats.ox.ac.uk/~ripley/">http://www.stats.ox.ac.uk/~ripley/</a><br>Universit=
y of Oxford,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; Tel:&nbsp;&nbsp;+44 1865 272861 (self)<br>1 South Parks Road,&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +44 1865 272866 (PA)
<br>Oxford OX1 3TG, UK&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fax:&nbsp;&nbsp;+44 1865 272595<=
/blockquote></div><br>

------=_Part_60506_18925213.1187708869863--



More information about the R-devel mailing list