package names with `.' cause problems in the Depends field

David Kane <David Kane a296180@mica.fmr.com
Wed, 22 May 2002 08:03:25 -0400


Some of my package names have `.' in them. An example is "g.data". R CMD check
complains about this as follows:

* checking for file 'financials/DESCRIPTION' ... OK
* checking package directory ... OK
* checking DESCRIPTION Package field ... OK
* checking DESCRIPTION Version field ... OK
* checking DESCRIPTION License field ... OK
* checking DESCRIPTION Description field ... OK
* checking DESCRIPTION Title field ... OK
* checking DESCRIPTION Author field ... OK
* checking DESCRIPTION Maintainer field ... OK
* checking DESCRIPTION Depends field ... ERROR
Malformed Depends field.
See the information on DESCRIPTION files in section 'Creating R packages'
of the 'Writing R Extensions' manual.
mica|tmp> 

Is the problem:

1) That `.' is not allowed in package names or

2) With R CMD check or

3) With my analysis?

The key Perl code in check seems to be:

	foreach my $dep (@dependencies) {
	    $dep =~ /^\s*(\w+)(\s*\(([^) ]+)\s+([^) ]+)\))?\s*$/;
	    ## The entry is malformed if there is no match, or there is
	    ## a match but the dep_op is different from `<=' or `>', or
	    ## the dep_version does not only consist of digits, `.' or
	    ## `-'.
	    if(!($1) || ($2 && (!(($3 eq "<=") || ($3 eq ">="))
				|| ($4 =~ /[^\d\.\-]/)))) {
		$any++;
		break;
	    }
	}
	if($any == 0) {
	    $log->result("OK")
	}
	else {
	    $log->error();
	    $log->print("Malformed Depends field.\n");
	    $log->print(wrap("", "", @msg_DESCRIPTION));
	    exit(1);
 	}

Alas, I am not Perl savvy enough to fully understand this. Simple testing shows
that the matching yields no matches ($1 is empty) for a name like "g.data". If
`.' is allowed in package names, then I suspect that this is a bug.

Regards,

Dave Kane
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._