From ripley at stats.ox.ac.uk  Thu Apr  4 22:14:46 2013
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Thu, 04 Apr 2013 21:14:46 +0100
Subject: [Rd] R 3.0.0: wrong MD5 checksums for Windows?
In-Reply-To: <CAFDcVCRGV2E_2L37ZMZEnkGuo0UyUEnrBYYAQWJF9oG79i4a=w@mail.gmail.com>
References: <CANdJ3dWo_ybrYXZJn4ORJA+HWwbxs9V152w4Nzygus5gUgbXSA@mail.gmail.com>
	<515DD02C.9020507@gmail.com>
	<CAFDcVCRGV2E_2L37ZMZEnkGuo0UyUEnrBYYAQWJF9oG79i4a=w@mail.gmail.com>
Message-ID: <515DDF36.2060807@stats.ox.ac.uk>

On 04/04/2013 20:26, Henrik Bengtsson wrote:
> On Thu, Apr 4, 2013 at 12:10 PM, Duncan Murdoch
> <murdoch.duncan at gmail.com> wrote:
>> On 04/04/2013 2:38 PM, Tal Galili wrote:
>>>
>>> Hello dear R-devel,
>>>
>>> When installing R 3.0.0 on Windows 7, and then running:
>>>
>>> require(tools)
>>> checkMD5sums(dir=R.home())
>>>
>>> I get the following massage:
>>> files ???etc/Rconsole???, ???etc/Rprofile.site??? have the wrong MD5
>>> checksums
>>> [1] FALSE
>>
>>
>> Rprofile.site is likely to be changed when you install R. It's pretty easy
>> to change Rconsole as well.
>>
>> So perhaps the bug is that we are running checksums on those at all.
>
> Maybe this is what you just implied/said, but if the MD5 checksums are
> calculated on files with '\n' line breaks (on the build server) and
> then they are simply rewritten "as-is" upon installation (but with
> '\n' translated to '\r\n').  This could happen if they are written
> using cat() or writeLines(), which writes using text-mode connections
> and therefore have all '\n' translated to '\r\n' on Windows, e.g. (on
> Windows):
>
>> cat("a\nb", file="foo.txt"); file.info("foo.txt")$size
> [1] 4
>> cat("a\rb", file="foo.txt"); file.info("foo.txt")$size
> [1] 3
>> cat("a\r\nb", file="foo.txt"); file.info("foo.txt")$size
> [1] 5
>> writeChar("a\nb", eos=NULL, con="foo.txt"); file.info("foo.txt")$size
> [1] 3
>
> I've been bitten by '\n' -> '\r\n' so many times (e.g. can cause
> unnecessary SVN commits/updates).  Out of curiosity, as of 2013, are
> there any good reasons for generating '\r\n' - what Windows software
> does not handle '\n' these days?

Inno Setup: the installer software!

>
> /Henrik
>
>>
>> Duncan Murdoch
>>
>>>
>>> This happens when using the 32 and the 64 bit version of R.
>>> And was also reported by 2 other users on other machines, as can be seen
>>> in
>>> the comments to this post:
>>>
>>> http://www.r-statistics.com/2013/04/r-3-0-0-is-released-whats-new-and-how-to-upgrade/
>>>
>>> The R version was downloaded from this mirror:
>>> http://cran.rstudio.com/bin/windows/base/
>>> And installed on both the C and D drive on different computers (to
>>> rule-out
>>> any permission issues during installation).
>>>
>>>
>>>
>>> I hope I didn't miss anything,
>>> Tal
>>>
>>> ----------------Contact
>>> Details:-------------------------------------------------------
>>> Contact me: Tal.Galili at gmail.com |
>>> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
>>> www.r-statistics.com (English)
>>>
>>> ----------------------------------------------------------------------------------------------
>>>
>>>          [[alternative HTML version deleted]]
>>>
>>>
>>>
>>> ______________________________________________
>>> R-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
> ______________________________________________
> 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



[Rd] R 3.0.0: wrong MD5 checksums for Windows?
Prof Brian Ripley