[Rd] SystemRequirements (was DESCRIPTION and PACKAGES files )

Allen S. Rout asr at ufl.edu
Fri Aug 11 17:30:57 CEST 2006


Martin Maechler <maechler at stat.math.ethz.ch> writes:

> I think some R-core members would welcome a detailed proposal on how
> 'SystemRequirements' should be formatted -- maybe even accompanied
> by R code to parse it.  That's a topic also quite well fit to be
> discussed in "this theatre" ..


Discussion follows, and code follows discussion.

----

So, I've been chewing on this offline with Dirk and Simon, and I think
we've settled into, if not complete agreement, a local minimum of
dissatisfaction. :)

Since we may be talking about a new field in DESCRIPTIONs, I'll refer
to 'SystemDepends:' as a machine-readable version of the currently
human-readable SystemRequirements:.


The critical concern which affects SystemDepends: but does not affect
the Depends: field is that Depends: operates over the set of R
packages names, which are nominally under the control of the R
community, and unique in their domain.

Unfortunately, SystemDepends: needs to refer to the domain of "names
different systems have arrived at for things R packages might depend
on".  Sticky.

This is not simply a theoretical problem; the first package I cared
about demonstrated the problem case.  GDD requires that the GD library
be available.  Mr Boutell appears to call his package 'gd', and some
Linux distros do the same, others use 'libgd' in an entirely
reasonable convention.  

Dirk thinks the bookkeeping for the variations would be too much to be
useful:

} I still think that CRAN should not care about distributions; there
} are simply too many of them and stay tend to appear and disappear
} too.


But I think that we only need to mention exceptions, which will
probably be few.  So, if we wish to represent these SystemDepends:
data, I see several choices:

1) per-package, pick a name and tell folks in distros with different
   names to suck it up. 

2) Apply to the package owner for resolution of the "official" name,
   then 1) 

3) Permit some speciation in what packages are required for what
   "system type". 


My code is intended to aid 3); If R-devel decides 3) is not useful, I
would strongly commend 2) over 1); we should not resolve package
nomenclature by local fiat.


----


Here is the format I suggest for a SystemDepends: 


src <- "libgd (>= 1.9.0) (gentoo gd >= 2.0) (debian >= 1.9.2)"

<def>=<name> [<requirements>]
<requirements>=<requirement>[, <requirements>]
<requirement>=([<sysname> [<pkgname>]] [<version cond>])

the code I wrote is intended to take a list of dependencies in this
format, and an optional system-type identifier, and return a string in
normal Depends: format, 'localized' for the supplied system-type.
This was intended to let whatever random cruft folks had written
against extant R Depends: strings to manipulate the extended format
too. 


So, 

extdepstring2depstring(src)

yields "libgd (>= 1.9.0)"

and

extdepstring2depstring(src,systype="debian")

yields "libgd (>= 1.9.2)"

and 

extdepstring2depstring(src,systype="WhoTheHeckAreYou")

yeilds the default. 



----

The code: Submitted for your delectation (or abuse, I suppose)

http://nersp.osg.ufl.edu/~asr/media/extdepstring2depstring_0.6.tar.gz


This package houses a single function, 

 extdepstring2depstring(instring, systype = "", debug=FALSE)

and some tests.  It's my first attempt at an R package, and it passed
check on my box, so please be gentle if I've done dumb stuff.

----


Thank you for your time and consideration.


- Allen S. Rout



More information about the R-devel mailing list