[Rd] update.packages fails again (PR#972)
Kurt Hornik
Kurt.Hornik@ci.tuwien.ac.at
Sat, 9 Jun 2001 08:28:12 +0200
>>>>> ripley writes:
> It's happened again:
> exactRankTests_0.4-2.tar.gz has
> Depends: R > 1.3.0
> which is not only impossible, but breaks update.packages.
> How can we test for this?
Damn it. I thought that my Perl code in R CMD check
if($description->{"Depends"} =~ /\bR *\([^)]*\)/) {
## The `Depends' field is not required, and currently only R
## version dependencies are used, which must be of the form
## `R ($op $version)' with `$op' one of `<=' or `>='.
$log->checking("DESCRIPTION Depends field");
$description->{"Depends"} =~ /\bR *\(([^) ]+) *([^) ]+)\)/;
if((($1 eq "<=") || ($1 eq ">=")) && $2) {
$log->result("OK");
}
else {
$log->warning();
$log->message(" malformed Depends field");
}
}
was good enough. It is intended to check for just that: even more
precisely for exactly what is used by R lateron.
For the offending package I get no warning. Argh.
> Unfortunately once such a package is installed, it has to be manually
> uninstalled before update.packages will work again.
> *PLEASE* can people read the manual to get the syntax right: it is
> Depends: R (>= 1.3.0)
> but such packages should not be in the main part of CRAN yet.
How can this be installed? I though if you ran R CMD INSTALL then it
would figure this out. At least, this is what
depends=`get_dcf_field Depends DESCRIPTION`
depends=`echo ${depends} | grep 'R *('`
if test "${depends}"; then
depends=`echo ${depends} | sed 's/.*R *(\([^)]*\)).*/\1/;s/=/= /'`
dep_operator=`set - ${depends}; echo ${1}`
dep_version=`set - ${depends}; echo ${2}`
## Currently, only operators `<=' and `>=' are supported. Hence we
## check this, and also whether we found a version string.
if (test "${dep_operator}" = "<=" \
|| test "${dep_operator}" = ">=") \
&& test -n "${dep_version}"; then
dep_ok=`expr ${R_VERSION} ${dep_operator} ${dep_version} `
if test ${dep_ok} -eq 0; then
echo "ERROR: This R is version ${R_VERSION}"
echo " package \`${pkg}' depends on R ${dep_version}"
exit 1;
fi
else
echo "WARNING: malformed \`Depends' field in \`DESCRIPTION'"
fi
fi
in INSTALL is supposed to do. Same problem, most likely.
Will have a look later.
-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._