# HG changeset patch # User heiko # Date 1154501776 0 # Node ID 29674fb1ef8ada73ec773681a7a8ae8f65a3f6d4 # Parent a69ac45de2f00f2a7d5ecda368d301f8fa8a9044 Option-Handling ist nun etwas anders. diff -r a69ac45de2f0 -r 29674fb1ef8a debian/changelog --- a/debian/changelog Tue Aug 01 12:25:50 2006 +0000 +++ b/debian/changelog Wed Aug 02 06:56:16 2006 +0000 @@ -1,3 +1,15 @@ +logbuch (0.18-1) stable; urgency=low + + * new upstream (options changed for apt) + + -- Heiko Schlittermann Tue, 01 Aug 2006 09:36:13 +0200 + +logbuch (0.17-2) stable; urgency=low + + * nochmal + + -- Heiko Schlittermann Tue, 01 Aug 2006 09:36:13 +0200 + logbuch (0.17-1) stable; urgency=low * --help geht jetzt besser diff -r a69ac45de2f0 -r 29674fb1ef8a log.pl --- a/log.pl Tue Aug 01 12:25:50 2006 +0000 +++ b/log.pl Wed Aug 02 06:56:16 2006 +0000 @@ -6,12 +6,12 @@ --[no]db insert into log database [$opt_db] --[no]mail send mails to @config::mailto [$opt_mail] --message=s message - - if the message looks like a file name (e.g.: - ./text or /tmp/text, the message is read - from this file) - - if message is 'upgrade:' or - 'dist-upgrade:', the file is parsed as apt - output + - if the message starts with '@' it's considered + to be a message FILE. + - message can be: apt[:text]@ - this will + start special file processing (assuming output + from apt, with text (default: APT: upgrade) going + to the first line) # use strict; @@ -72,17 +72,15 @@ "type=s" => \$opt_apt, ) or die eval "\"$USAGE\""; - if ($opt_message =~ /^\.?\// and -f $opt_message) { - @ARGV = ($opt_message); + if ($opt_message =~ /^@(.*)/) { + @ARGV = $1; $opt_message = join "", <>; } elsif ($opt_message eq "-") { $opt_message = join "", ; - } elsif ($opt_message =~ /^((?:dist-)?upgrade):(.*)/) { + } elsif ($opt_message =~ /^apt(?::(.*))?\@(\S+)/) { open(I, $2) or die "Can't open $2: $!\n"; - $opt_message = "$1\n" - . join "", grep /^(?:\d|Inst|Conf|Remv)/, ; - - die $opt_message; + $opt_message = ($1 ? "APT: $1\n" : "APT: upgrade\n") + . join "", map { /^(?:\d|Inst|Conf|Remv)/ ? "- $_" : () } ; } if ($opt_message =~ /\n/) {