diff -r 86504771a173 -r 3a18d3cd6ae6 tools/chkconfig --- a/tools/chkconfig Fri Apr 28 09:28:28 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -#! /usr/bin/perl -use strict; -use warnings; -use File::Temp; - -my $pattern = "# sha1:"; - -die "need exactly one filename" if not @ARGV == 1; - -if ($0 =~ /chk/) { - local $" = ""; - exit 0 if not -e $ARGV[0]; - my @file = <>; - - my $expected = ""; - $expected = pop @file if $file[-1] =~ /^$pattern/; - - my $tmp = new File::Temp; - open(SHA1, "|sha1sum >" . $tmp->filename); - print SHA1 @file; - close(SHA1); - seek($tmp, 0, 0); - - my $current = $pattern . <$tmp>; - - exit 0 if $current eq $expected; - exit 1; -} - -if ($0 =~ /sig/) { - local $" = ""; - open(FILE, "+<$ARGV[0]") or die "Can't open $ARGV[0]: $!\n"; - my @file = ; - pop @file if $file[-1] =~ /^$pattern/; - seek(FILE, 0, 0); - print FILE @file, $pattern; - truncate(FILE, tell FILE); - close FILE; - open(SHA1, "|sha1sum >>$ARGV[0]"); - print SHA1 @file; - close(SHA1); -}