dir for .pm is now dnstools. hs12
authorHeiko Schlittermann <hs@schlittermann.de>
Mon, 03 Jan 2011 20:06:55 +0100
branchhs12
changeset 72 d3d2108f07da
parent 71 e25fc893e203
child 73 9c304b77cf02
dir for .pm is now dnstools. Thus we can have dnstools::Config and so on.
Makefile
dnssec-keytool.pl
dnstools/Config.pm
my/Config.pm
update-serial.pl
zone-ls.pl
zone-mk.pl
zone-rm.pl
--- a/Makefile	Mon Jan 03 16:49:56 2011 +0100
+++ b/Makefile	Mon Jan 03 20:06:55 2011 +0100
@@ -1,3 +1,12 @@
+DESTDIR =
+
+prefix = /usr/local
+bindir = ${prefix}/bin
+sbindir = ${prefix}/sbin
+libdir = ${prefix}/lib/dnstools
+sysconfdir = /etc/dnstools
+
+
 ALL = zone-ls zone-mk zone-rm \
       update-serial \
       dnssec-keytool
--- a/dnssec-keytool.pl	Mon Jan 03 16:49:56 2011 +0100
+++ b/dnssec-keytool.pl	Mon Jan 03 20:06:55 2011 +0100
@@ -9,7 +9,7 @@
 use Pod::Usage;
 use File::Basename;
 use if $ENV{DEBUG} => "Smart::Comments";
-use my::Config qw(get_config);
+use dnstools::Config qw(get_config);
 
 my $ME = basename $0;
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dnstools/Config.pm	Mon Jan 03 20:06:55 2011 +0100
@@ -0,0 +1,36 @@
+package dnstools::Config;
+use strict;
+use warnings;
+
+use base "Exporter";
+
+our $VERSION   = 0.0;
+our @EXPORT_OK = qw(get_config);
+
+sub get_config(@) {
+
+    # read configuration
+    my @configs = @_;
+    my %config;
+
+    # the first config FILE
+    my ($_) = grep { -f } @configs;
+    open(my $cf, $_) or die "Can't open $_: $!\n";
+
+    while (<$cf>) {
+        s/#.*//;
+        s/\s//g;
+        next unless length;
+        my ($cname, $ccont) = split(/\s*=\s*/, $_, 2);
+        $config{$cname} = $ccont;
+    }
+
+    # now merge the config hashes
+    foreach my $o (grep { ref eq "HASH" } @configs) {
+        %config =
+          (%config, map { $_ => $o->{$_} } grep { defined $o->{$_} } keys %$o);
+    }
+    return %config;
+}
+
+1;
--- a/my/Config.pm	Mon Jan 03 16:49:56 2011 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-package my::Config;
-use strict;
-use warnings;
-
-use base "Exporter";
-
-our $VERSION   = 0.0;
-our @EXPORT_OK = qw(get_config);
-
-sub get_config(@) {
-
-    # read configuration
-    my @configs = @_;
-    my %config;
-
-    # the first config FILE
-    my ($_) = grep { -f } @configs;
-    open(my $cf, $_) or die "Can't open $_: $!\n";
-
-    while (<$cf>) {
-        s/#.*//;
-        s/\s//g;
-        next unless length;
-        my ($cname, $ccont) = split(/\s*=\s*/, $_, 2);
-        $config{$cname} = $ccont;
-    }
-
-    # now merge the config hashes
-    foreach my $o (grep { ref eq "HASH" } @configs) {
-        %config =
-          (%config, map { $_ => $o->{$_} } grep { defined $o->{$_} } keys %$o);
-    }
-    return %config;
-}
-
-1;
--- a/update-serial.pl	Mon Jan 03 16:49:56 2011 +0100
+++ b/update-serial.pl	Mon Jan 03 20:06:55 2011 +0100
@@ -12,7 +12,7 @@
 use IO::File;
 use POSIX qw(strftime);
 use if $ENV{DEBUG} => "Smart::Comments";
-use my::Config qw(get_config);
+use dnstools::Config qw(get_config);
 
 sub uniq(@);
 sub zones(@);
--- a/zone-ls.pl	Mon Jan 03 16:49:56 2011 +0100
+++ b/zone-ls.pl	Mon Jan 03 20:06:55 2011 +0100
@@ -9,7 +9,7 @@
 use Time::Local;
 use Getopt::Long;
 use if $ENV{DEBUG} => "Smart::Comments";
-use my::Config qw(get_config);
+use dnstools::Config qw(get_config);
 
 my %config;
 my $opt_expiry = undef;
--- a/zone-mk.pl	Mon Jan 03 16:49:56 2011 +0100
+++ b/zone-mk.pl	Mon Jan 03 20:06:55 2011 +0100
@@ -3,7 +3,7 @@
 use warnings;
 use strict;
 use FindBin;
-use my::Config qw(get_config);
+use dnstools::Config qw(get_config);
 
 my %config;
 
--- a/zone-rm.pl	Mon Jan 03 16:49:56 2011 +0100
+++ b/zone-rm.pl	Mon Jan 03 20:06:55 2011 +0100
@@ -4,7 +4,7 @@
 use strict;
 use File::Path;
 use FindBin;
-use my::Config qw(get_config);
+use dnstools::Config qw(get_config);
 
 # liest die Konfiguration ein
 my %config = get_config("$FindBin::Bin/dnstools.conf", "/etc/dnstools.conf");