File tree 9 files changed +29
-6
lines changed
9 files changed +29
-6
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ install: all
41
41
42
42
mkdir -p " $( DESTDIR) $( LOCALEDIR) "
43
43
cp -r po/.build/* " $( DESTDIR) $( LOCALEDIR) /"
44
+
45
+ mkdir -p " $( DESTDIR) /var/cache/needrestart"
44
46
45
47
clean :
46
48
[ ! -f perl/Makefile ] || ( cd perl && $( MAKE) realclean )
Original file line number Diff line number Diff line change @@ -141,6 +141,9 @@ $nrconf{override_cont} = {
141
141
# Disable interpreter scanners.
142
142
#$nrconf{interpscan} = 0;
143
143
144
+ # Use a persistent cache file of perl scanning results
145
+ #$nrconf{perlcache} = "/var/cache/needrestart/perl_scandeps_cache";
146
+
144
147
# Ignore script files matching these regexs:
145
148
$nrconf{blacklist_interp} = [
146
149
# ignore temporary files
Original file line number Diff line number Diff line change @@ -155,6 +155,7 @@ our %nrconf = (
155
155
override_cont => {},
156
156
skip_mapfiles => -1,
157
157
interpscan => 1,
158
+ perlcache => undef ,
158
159
kernelhints => 1,
159
160
kernelfilter => qr ( .) ,
160
161
ucodehints => 1,
@@ -241,6 +242,12 @@ $opt_t = $nrconf{tolerance} unless(defined($opt_t));
241
242
$nrconf {defno }++ if ($opt_n );
242
243
$opt_b ++ if ($opt_p );
243
244
245
+ needrestart_interp_configure({
246
+ perl => {
247
+ cache_file => $nrconf {perlcache },
248
+ },
249
+ });
250
+
244
251
# print version in verbose mode
245
252
print STDERR " $LOGPREF needrestart v$NeedRestart::VERSION \n " if ($nrconf {verbosity } > 1);
246
253
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ our @EXPORT = qw(
49
49
50
50
needrestart_ui
51
51
needrestart_ui_list
52
+ needrestart_interp_configure
52
53
needrestart_interp_check
53
54
needrestart_interp_source
54
55
needrestart_cont_check
@@ -135,13 +136,20 @@ sub needrestart_ui_list {
135
136
136
137
137
138
my %Interps ;
139
+ my $InterpConf ;
138
140
my %InterpCache ;
139
141
my $idebug ;
140
142
141
- sub needrestart_interp_register ($) {
143
+ sub needrestart_interp_configure ($) {
144
+ my $conf = shift ;
145
+ $InterpConf = $conf ;
146
+ }
147
+
148
+ sub needrestart_interp_register ($$) {
142
149
my $pkg = shift ;
150
+ my $confkey = shift ;
143
151
144
- $Interps {$pkg } = new $pkg ($idebug );
152
+ $Interps {$pkg } = new $pkg ($idebug , $InterpConf -> { $confkey } );
145
153
}
146
154
147
155
sub needrestart_interp_init ($) {
Original file line number Diff line number Diff line change @@ -30,9 +30,11 @@ use warnings;
30
30
sub new {
31
31
my $class = shift ;
32
32
my $debug = shift ;
33
+ my $conf = shift ;
33
34
34
35
return bless {
35
36
debug => $debug ,
37
+ conf => $conf ,
36
38
}, $class ;
37
39
}
38
40
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ use NeedRestart::Utils;
33
33
34
34
my $LOGPREF = ' [Java]' ;
35
35
36
- needrestart_interp_register(__PACKAGE__ );
36
+ needrestart_interp_register(__PACKAGE__ , " java " );
37
37
38
38
sub isa {
39
39
my $self = shift ;
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ use Module::ScanDeps;
36
36
37
37
my $LOGPREF = ' [Perl]' ;
38
38
39
- needrestart_interp_register(__PACKAGE__ );
39
+ needrestart_interp_register(__PACKAGE__ , " perl " );
40
40
41
41
sub isa {
42
42
my $self = shift ;
@@ -178,6 +178,7 @@ sub files {
178
178
$href = scan_deps(
179
179
files => [$src ],
180
180
recurse => 1,
181
+ cache_file => $self -> {conf }-> {cache_file },
181
182
);
182
183
}
183
184
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ use NeedRestart::Utils;
35
35
36
36
my $LOGPREF = ' [Python]' ;
37
37
38
- needrestart_interp_register(__PACKAGE__ );
38
+ needrestart_interp_register(__PACKAGE__ , " python " );
39
39
40
40
sub isa {
41
41
my $self = shift ;
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ use NeedRestart::Utils;
35
35
36
36
my $LOGPREF = ' [Ruby]' ;
37
37
38
- needrestart_interp_register(__PACKAGE__ );
38
+ needrestart_interp_register(__PACKAGE__ , " ruby " );
39
39
40
40
sub isa {
41
41
my $self = shift ;
You can’t perform that action at this time.
0 commit comments