From ripley at stats.ox.ac.uk  Sun Oct 25 12:48:52 2009
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sun, 25 Oct 2009 11:48:52 +0000 (GMT)
Subject: [Rd] reg-tests-1.R failure with unstable
In-Reply-To: <307b90470910250233o1ff0934bl8a4ba7b673420c86@mail.gmail.com>
References: <307b90470910230430o2724fd99j90a226315b7cfc25@mail.gmail.com>
	<307b90470910250233o1ff0934bl8a4ba7b673420c86@mail.gmail.com>
Message-ID: <alpine.LFD.2.00.0910251126140.18677@gannet.stats.ox.ac.uk>

On Sun, 25 Oct 2009, Hiroyuki Kawakatsu wrote:

> On Fri, Oct 23, 2009, Hiroyuki Kawakatsu wrote:
>> Hi,
>>
>> I am getting an error from one of the test files
>> tests/reg-tests-1.R using the unstable version (r50179).
>> (i've learned my lessons; this is a clean build.) The tail
>> of reg-tests-1.Rout.fail is
>>
>> Loading required package: myTst
>> building package pkgA ...
>> installing package pkgA using file pkgA_1.0.tar.gz ...
>> Error in as.octmode(mode) : invalid digits
>> Error in install.packages(r, lib = "myLib", repos = NULL, type = "source") :
>> ?(converted from warning) installation of package 'pkgA_1.0.tar.gz'
>> had non-zero exit status
>> Execution halted
> [...]
>
> I think I have tracked this down to the following line in utils:::untar2()
>        mode <- rawToChar(block[101:107])
> mode contains a trailing space as in "000755 " which causes the invalid
> digits error in as.octmode(). If I change the line to
>        mode <- rawToChar(block[101:106])
> untar2("pkgA_1.0.tar.gz") unpacks the test package but I, of course,
> do not know whether this is a general fix.
>
> Am I the only one seeing this problem (FreeBSD 9.0-CURRENT)?

Seems this is a bug in the tar program on your OS: this should be 
'0000755(nul)' in the 8 bytes 101:108. And that's in every account of 
the tar format I have found, including the former POSIX standard.

(Note to Peter D: we don't use getOct for this one, as it is not a 
field that is allowed to be space-padded.)

I guess we need to work around this ... to a large extent we have got 
away with using tar format in the past because everyone was using GNU 
tar, but others are coming into use.

[A quick check confirms that bsdtar from the libarchive project does 
this, as used by Snow Leopard and AFAIK FreeBSD >= 8.  So I can 
reproduce it.]

-- 
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] reg-tests-1.R failure with unstable
Prof Brian Ripley