~ubuntu-branches/debian/sid/init-system-helpers/sid

« back to all changes in this revision

Viewing changes to script/deb-systemd-helper

  • Committer: Package Import Robot
  • Author(s): Michael Stapelberg
  • Date: 2014-11-17 20:47:58 UTC
  • Revision ID: package-import@ubuntu.com-20141117204758-tufhc5mjpsmj8u7x
Tags: 1.22
Depend on perl-base instead of perl (Closes: #757891)

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
use warnings;
85
85
use File::Path qw(make_path); # in core since Perl 5.001
86
86
use File::Basename; # in core since Perl 5
87
 
use File::Find; # in core since Perl 5
88
87
use File::Temp qw(tempfile); # in core since Perl 5.6.1
89
88
use Text::ParseWords qw(shellwords); # in core since Perl 5
90
89
use Getopt::Long; # in core since Perl 5
91
 
use Data::Dumper;
 
90
# Make Data::Dumper::Dumper available if present (not present on systems that
 
91
# only have perl-base, not perl).
 
92
eval { require Data::Dumper; } or *Data::Dumper::Dumper = sub { "no Data::Dumper" };
92
93
 
93
94
my $quiet = 0;
94
95
my $enabled_state_dir = '/var/lib/systemd/deb-systemd-helper-enabled';
260
261
    my @links = get_link_closure($scriptname, $service_path);
261
262
 
262
263
    debug "Old state file contents: " .
263
 
        Dumper([ state_file_entries($dsh_state) ]);
 
264
        Data::Dumper::Dumper([ state_file_entries($dsh_state) ]);
264
265
 
265
266
    make_path(dirname($dsh_state));
266
267
    my ($outfh, $tmpname) = tempfile('.stateXXXXX',
278
279
        error("Unable to move $tmpname to $dsh_state");
279
280
 
280
281
    debug "New state file contents: " .
281
 
        Dumper([ state_file_entries($dsh_state) ]);
 
282
        Data::Dumper::Dumper([ state_file_entries($dsh_state) ]);
282
283
}
283
284
 
284
285
sub was_enabled {
285
286
    my ($scriptname) = @_;
286
287
 
287
288
    my @entries = state_file_entries(dsh_state_path($scriptname));
288
 
    debug "Contents: " . Dumper(\@entries);
 
289
    debug "Contents: " . Data::Dumper::Dumper(\@entries);
289
290
 
290
291
    for my $link (@entries) {
291
292
        if (! -l $link) {
308
309
 
309
310
    my $dsh_state = dsh_state_path($service_path);
310
311
    my @entries = state_file_entries($dsh_state);
311
 
    debug "Contents: " . Dumper(\@entries);
 
312
    debug "Contents: " . Data::Dumper::Dumper(\@entries);
312
313
 
313
314
    if (is_purge()) {
314
315
        unlink($dsh_state) if -e $dsh_state;