From Mark.Bravington at csiro.au  Thu Mar 12 21:45:18 2009
From: Mark.Bravington at csiro.au (Mark.Bravington at csiro.au)
Date: Thu, 12 Mar 2009 21:45:18 +0100 (CET)
Subject: [Rd] installed.packages and package info cache buglet (PR#13592)
Message-ID: <20090312204518.C7516282EF2D@mail.pubhealth.ku.dk>

Looks like there is a buglet in 'installed.packages', around line 17:

    for (lib in lib.loc) {
        dest <- file.path(tempdir(), paste("libloc_", URLencode(lib,=20
            TRUE), paste(fields, collapse =3D ","), ".rds", sep =3D ""))
        if (!noCache && file.exists(dest) && file.info(dest)$mtime >=20
            file.info(lib.loc)$mtime) {

                      ^^^^^^^
                     =20
The 'lib.loc' should be 'lib', otherwise the comparison is always against t=
he first library in 'lib.loc', not against the one being checked. [Normally=
 the multiple test in '>' would flag a warning from 'if', but the &&s mean =
that only the first element is used.]

I can't provide a reproducible example for this, because it's so installati=
on-dependent.

Still present in R-devel from 8th March.

Mark Bravington
CSIRO
Hobart
Australia

--please do not edit the information below--

Version:
 platform =3D i386-pc-mingw32
 arch =3D i386
 os =3D mingw32
 system =3D i386, mingw32
 status =3D Patched
 major =3D 2
 minor =3D 8.1
 year =3D 2009
 month =3D 02
 day =3D 12
 svn rev =3D 47919
 language =3D R
 version.string =3D R version 2.8.1 Patched (2009-02-12 r47919)

Windows XP (build 2600) Service Pack 2

Locale:
LC_COLLATE=3DEnglish_Australia.1252;LC_CTYPE=3DEnglish_Australia.1252;LC_MO=
NETARY=3DEnglish_Australia.1252;LC_NUMERIC=3DC;LC_TIME=3DEnglish_Australia.=
1252

Search Path:
 .GlobalEnv, package:grDevices, package:ad, package:chstuff, package:handy2=
, package:tweedie, package:statmod, package:handy, package:debug, package:m=
vbutils, mvb.session.info, package:tools, package:tcltk, package:boot, pack=
age:stats, package:graphics, package:utils, package:methods, Autoloads, pac=
kage:base



[Rd] installed.packages and package info cache buglet (PR#13592)
Mark.Bravington at csiro.au