]> git.donarmstrong.com Git - debbugs.git/commitdiff
add script to dump databases
authorDon Armstrong <don@donarmstrong.com>
Sun, 20 May 2007 10:30:21 +0000 (03:30 -0700)
committerDon Armstrong <don@donarmstrong.com>
Sun, 20 May 2007 10:30:21 +0000 (03:30 -0700)
examples/debian/versions/dump_db.pl [new file with mode: 0755]

diff --git a/examples/debian/versions/dump_db.pl b/examples/debian/versions/dump_db.pl
new file mode 100755 (executable)
index 0000000..e41fd1e
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+use MLDBM qw(DB_File Storable);
+use Data::Dumper;
+use Fcntl;
+
+$MLDBM::DumpMeth=q(portable);
+
+
+my %db;
+
+my $db_name = (shift @ARGV || 'versions.idx');
+
+tie %db, MLDBM => $db_name,O_RDONLY or die "unable to tie $db_name: $!";
+if (@ARGV) {
+     print Dumper([@db{@ARGV}]);
+}
+else {
+     print Dumper(\%db);
+}
+
+
+