# HG changeset patch # User Sebastian Fiedler # Date 1507804334 -7200 # Node ID 1898ce7c3fd35b7f906d72d67e488d4a9a3324e6 # Parent 86504771a1730dc731c3a78e9db29132ae55a3d1 Add Postgresql support. diff -r 86504771a173 -r 1898ce7c3fd3 Makefile --- a/Makefile Fri Apr 28 09:28:28 2017 +0200 +++ b/Makefile Thu Oct 12 12:32:14 2017 +0200 @@ -19,6 +19,7 @@ install -d -m 0755 $(DESTDIR)/usr/share/perl5/Logbuch install -m 0644 Logbuch/HG.pm $(DESTDIR)/usr/share/perl5/Logbuch/ + dh_installdocs clean: -rm -f $(bin_SCRIPTS) diff -r 86504771a173 -r 1898ce7c3fd3 config.pm --- a/config.pm Fri Apr 28 09:28:28 2017 +0200 +++ b/config.pm Thu Oct 12 12:32:14 2017 +0200 @@ -8,6 +8,14 @@ # @notify_dirs = qw(/etc); +# DB config $db = 1; -1; +# for MySQL use +# DBI:mysql:logbuch:localhost +# for Postgres (socket connection) use +# DBI:Pg:dbname=logbuch;port=5432 +$dbDSN = ""; +$dbUser = "logbuch"; +$dbPass = "changeit"; + diff -r 86504771a173 -r 1898ce7c3fd3 debian/changelog --- a/debian/changelog Fri Apr 28 09:28:28 2017 +0200 +++ b/debian/changelog Thu Oct 12 12:32:14 2017 +0200 @@ -1,3 +1,10 @@ +logbuch (0.49+num2) stable oldstable; urgency=medium + + * Non-maintainer upload. + * Support for Postgres. + + -- Sebastian Fiedler Thu, 12 Oct 2017 12:17:26 +0200 + logbuch (0.49+nmu1) stable oldstable; urgency=medium * Non-maintainer upload. diff -r 86504771a173 -r 1898ce7c3fd3 debian/docs --- a/debian/docs Fri Apr 28 09:28:28 2017 +0200 +++ b/debian/docs Thu Oct 12 12:32:14 2017 +0200 @@ -0,0 +1,1 @@ +docs/* \ No newline at end of file diff -r 86504771a173 -r 1898ce7c3fd3 log.pl --- a/log.pl Fri Apr 28 09:28:28 2017 +0200 +++ b/log.pl Thu Oct 12 12:32:14 2017 +0200 @@ -56,9 +56,9 @@ my $ME = basename $0; -my $DSN = "DBI:mysql:logbuch:pu.schlittermann.de"; -my $USER = "logbuch"; -my $PW = "HIDDEN"; +my $DSN = $config::dbDSN; +my $USER = $config::dbUser; +my $PW = $config::dbPass; my $EDITOR = $ENV{VISUAL} || $ENV{EDITOR} || "vim"; my $MAGIC = "#--- all changes below are ignored ---#\n"; @@ -252,7 +252,7 @@ if ($opt_db and $Dbh) { my $sth = $Dbh->prepare(" - INSERT INTO log (host, date, user, mailto, text) + INSERT INTO log (host, date, \"user\", mailto, text) VALUES(?, now(), ?, ?, ?)"); $sth->execute(full_hostname(), $user, $mailto, $text); print STDERR "Database entry inserted\n";