The R Project SVN R

Rev

Rev 48764 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 48764 Rev 48855
Line 33... Line 33...
33
use Text::Wrap;
33
use Text::Wrap;
34
 
34
 
35
## Don't buffer output.
35
## Don't buffer output.
36
$| = 1;
36
$| = 1;
37
 
37
 
38
my $revision = ' $Rev: 48764 $ ';
38
my $revision = ' $Rev: 48855 $ ';
39
my $version;
39
my $version;
40
my $name;
40
my $name;
41
$revision =~ / ([\d\.]*) /;
41
$revision =~ / ([\d\.]*) /;
42
$version = $1;
42
$version = $1;
43
($name = $0) =~ s|.*/||;
43
($name = $0) =~ s|.*/||;
Line 48... Line 48...
48
my $opt_tests = 1;
48
my $opt_tests = 1;
49
my $opt_latex = 1;
49
my $opt_latex = 1;
50
my $opt_use_gct = 0;
50
my $opt_use_gct = 0;
51
my $opt_codoc = 1;
51
my $opt_codoc = 1;
52
my $opt_install = 1;
52
my $opt_install = 1;
-
 
53
my $spec_install = 0;
53
my $opt_vignettes = 1;
54
my $opt_vignettes = 1;
54
my $opt_use_valgrind = 0;
55
my $opt_use_valgrind = 0;
55
my $opt_rcfile = "";		# Only set this if $ENV{"HOME"} is set.
56
my $opt_rcfile = "";		# Only set this if $ENV{"HOME"} is set.
56
$opt_rcfile = &file_path($ENV{"HOME"}, ".R", "check.conf")
57
$opt_rcfile = &file_path($ENV{"HOME"}, ".R", "check.conf")
57
    if defined($ENV{"HOME"});
58
    if defined($ENV{"HOME"});
Line 74... Line 75...
74
GetOptions(@known_options) or usage();
75
GetOptions(@known_options) or usage();
75
 
76
 
76
R_version("R add-on package checker", $version) if $opt_version;
77
R_version("R add-on package checker", $version) if $opt_version;
77
usage() if $opt_help;
78
usage() if $opt_help;
78
 
79
 
-
 
80
## record some of the options used.
-
 
81
my @opts;
-
 
82
push @opts,"--install=fake" if $opt_install eq "fake";
-
 
83
push @opts,"--install=no" if $opt_install eq "no";
-
 
84
push @opts,"--no-install" if $opt_no_install;
-
 
85
 
79
$opt_clean = 0 if $opt_no_clean;
86
$opt_clean = 0 if $opt_no_clean;
80
$opt_examples = 0 if $opt_no_examples;
87
$opt_examples = 0 if $opt_no_examples;
81
$opt_tests = 0 if $opt_no_tests;
88
$opt_tests = 0 if $opt_no_tests;
82
$opt_latex = 0 if $opt_no_latex;
89
$opt_latex = 0 if $opt_no_latex;
83
$opt_codoc = 0 if $opt_no_codoc;
90
$opt_codoc = 0 if $opt_no_codoc;
Line 85... Line 92...
85
$opt_vignettes = 0 if $opt_no_vignettes;
92
$opt_vignettes = 0 if $opt_no_vignettes;
86
 
93
 
87
if($opt_install eq "fake") {
94
if($opt_install eq "fake") {
88
    ## If we fake installation, then we cannot *run* any code.
95
    ## If we fake installation, then we cannot *run* any code.
89
    $opt_examples = $opt_tests = $opt_vignettes = 0;
96
    $opt_examples = $opt_tests = $opt_vignettes = 0;
-
 
97
    $spec_install = 1;
90
}
98
}
91
$opt_install = 0 if($opt_install eq "no");
99
$opt_install = 0 if($opt_install eq "no");
92
 
-
 
-
 
100
$spec_install = 1 if !$opt_install;
93
 
101
 
94
my $opt_ff_calls = 1;
102
my $opt_ff_calls = 1;
95
## The neverending story ...
103
## The neverending story ...
96
## For the time being, allow to turn this off by setting the environment
104
## For the time being, allow to turn this off by setting the environment
97
## variable _R_CHECK_FF_CALLS_ to a Perl 'null' value.
105
## variable _R_CHECK_FF_CALLS_ to a Perl 'null' value.
Line 353... Line 361...
353
    @out = R_runR("tools:::.find_charset()", "--slave --vanilla");
361
    @out = R_runR("tools:::.find_charset()", "--slave --vanilla");
354
    $log->message("using session @out");
362
    $log->message("using session @out");
355
    $is_ascii = 1 if $out[0] =~ /ASCII$/;
363
    $is_ascii = 1 if $out[0] =~ /ASCII$/;
356
 
364
 
357
    ## report options used
365
    ## report options used
358
    my @opts;
-
 
359
    push @opts,"--no-install" if !$opt_install;
-
 
360
    push @opts,"--no-codoc" if !$opt_codoc;
366
    push @opts,"--no-codoc" if !$opt_codoc;
361
    push @opts,"--no-examples" if !$opt_examples;
367
    push @opts,"--no-examples" if !$opt_examples && !$spec_install;
362
    push @opts,"--no-tests" if !$opt_tests;
368
    push @opts,"--no-tests" if !$opt_tests && !$spec_install;
363
    push @opts,"--no-vignettes" if !$opt_vignettes;
369
    push @opts,"--no-vignettes" if !$opt_vignettes && !$spec_install;
364
    push @opts,"--use-gct" if $opt_use_gct;
370
    push @opts,"--use-gct" if $opt_use_gct;
365
    push @opts,"--use-valgrind" if $opt_use_valgrind;
371
    push @opts,"--use-valgrind" if $opt_use_valgrind;
-
 
372
    if (@opts == 1) {
-
 
373
	$log->message("using option '" . $opts[0] . "'");
-
 
374
    } elsif (@opts) {
366
    $log->message("using options '" . join(" ", @opts) . "'") if @opts;
375
	$log->message("using options '" . join(" ", @opts) . "'");
-
 
376
    }
367
 
377
 
368
    if(!$opt_library) {
378
    if(!$opt_library) {
369
	$library = $pkgoutdir;
379
	$library = $pkgoutdir;
370
	$ENV{'R_LIBS'} = env_path($library, $R_LIBS);
380
	$ENV{'R_LIBS'} = env_path($library, $R_LIBS);
371
    }
381
    }