# HG changeset patch # User Heiko Schlittermann # Date 1252274602 -7200 # Node ID e8f1315b1617a893ab073d64f1a3412cf7d2deb1 # Parent 35f3da8216bdfc2c39dc03ccdb300256cb73ab5c# Parent 3a86e78a18b107670494755276cb347052c7d69a merge:3a86e78a18b1 diff -r 35f3da8216bd -r e8f1315b1617 .perltidyrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.perltidyrc Mon Sep 07 00:03:22 2009 +0200 @@ -0,0 +1,1 @@ +--paren-tightness=2 diff -r 35f3da8216bd -r e8f1315b1617 Makefile --- a/Makefile Sun Sep 06 23:52:30 2009 +0200 +++ b/Makefile Mon Sep 07 00:03:22 2009 +0200 @@ -4,24 +4,37 @@ bin_SCRIPTS = log +.PHONY: all check install clean -all: $(bin_SCRIPTS) + +all: check $(bin_SCRIPTS) install: all - install -d $(DESTDIR)/$(sysconfdir) - test -f $(DESTDIR)/$(sysconfdir)/config.pm \ - || install -m644 config.pm $(DESTDIR)/$(sysconfdir)/config.pm - install -d $(bindir) - install -m755 $(bin_SCRIPTS) $(DESTDIR)/$(bindir)/ + install -d -m 0755 $(DESTDIR)/$(sysconfdir) + tools/chkconfig $(DESTDIR)/$(sysconfigdir)/config.pm \ + && install -m 644 config.pm $(DESTDIR)/$(sysconfdir)/config.pm + tools/signconfig $(DESTDIR)/$(sysconfigdir)/config.pm + install -d -m 0755 $(bindir) + install -m 0755 $(bin_SCRIPTS) $(DESTDIR)/$(bindir)/ - install -d $(DESTDIR)/usr/share/perl5/Logbuch - install -m644 Logbuch/HG.pm $(DESTDIR)/usr/share/perl5/Logbuch/ + install -d -m 0755 $(DESTDIR)/usr/share/perl5/Logbuch + install -m 0644 Logbuch/HG.pm $(DESTDIR)/usr/share/perl5/Logbuch/ cd $(DESTDIR)/$(bindir) && ln -sf log logbuch clean: -rm -f $(bin_SCRIPTS) +check: + @-rm -f .e + @cat modules | while read; do \ + perl -M$$REPLY -e 'print " $$'"$$REPLY"'::VERSION\n"' &>/dev/null \ + && continue; \ + echo "MISSING perl library: \"$$REPLY\""; \ + touch .e; \ + done + @rm .e 2>/dev/null && false || true + %: %.pl perl -c $< cp -f $< $@ diff -r 35f3da8216bd -r e8f1315b1617 log.pl diff -r 35f3da8216bd -r e8f1315b1617 modules diff -r 35f3da8216bd -r e8f1315b1617 tools/chkconfig --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/chkconfig Mon Sep 07 00:03:22 2009 +0200 @@ -0,0 +1,42 @@ +#! /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); +} diff -r 35f3da8216bd -r e8f1315b1617 tools/signconfig --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/signconfig Mon Sep 07 00:03:22 2009 +0200 @@ -0,0 +1,1 @@ +chkconfig \ No newline at end of file