aboutsummaryrefslogtreecommitdiffstats
path: root/dumpdistribconf
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-09-29 15:51:26 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-09-29 15:51:26 +0000
commit3ee1bace629019b992f3bc6f844e15d3da59b7b8 (patch)
treeb7ce9d4bf7ce97604d133d0a6386e36d8a33fbec /dumpdistribconf
parentc74ee1a3a61ea0a0f5eb1be78740f8a4a96115f5 (diff)
downloadrpmtools-3ee1bace629019b992f3bc6f844e15d3da59b7b8.tar
rpmtools-3ee1bace629019b992f3bc6f844e15d3da59b7b8.tar.gz
rpmtools-3ee1bace629019b992f3bc6f844e15d3da59b7b8.tar.bz2
rpmtools-3ee1bace629019b992f3bc6f844e15d3da59b7b8.tar.xz
rpmtools-3ee1bace629019b992f3bc6f844e15d3da59b7b8.zip
Use Distribconf::Build, or else it will go boom
Diffstat (limited to 'dumpdistribconf')
-rwxr-xr-xdumpdistribconf34
1 files changed, 15 insertions, 19 deletions
diff --git a/dumpdistribconf b/dumpdistribconf
index 7652adc..5ea82b2 100755
--- a/dumpdistribconf
+++ b/dumpdistribconf
@@ -4,10 +4,10 @@
use strict;
use Getopt::Long;
-use Distribconf;
+use Distribconf::Build;
sub usage {
- print STDERR <<EOF
+ print STDERR <<EOF;
$0 -h|-m [options] path1 [path2 ...]
Dump Mandriva Linux distrib configuration.
@@ -15,34 +15,30 @@ Dump Mandriva Linux distrib configuration.
-m output an media.cfg file
-d write the directly into the dedicated location
EOF
-;
+ exit 1;
};
-my ($out, $outputtype) = (\*STDOUT);
-
+my ($out, $outputtype) = (\*STDOUT, 'm');
GetOptions(
- 'h' => sub { $outputtype = 'h' },
- 'm' => sub { $outputtype = 'm' },
- 'd' => sub { $out = undef; },
+ h => sub { $outputtype = 'h' },
+ m => sub { $outputtype = 'm' },
+ d => sub { undef $out },
);
-defined($outputtype) && @ARGV or do {
- usage;
- exit 1;
-};
+@ARGV or usage;
foreach (@ARGV) {
- print STDERR "$_\n";
- my $d = Distribconf->new($_);
+ print "Using root $_...\n";
+ my $d = Distribconf::Build->new($_);
$d->load and do {
- warn "Can't load configuration from $_\n";
- next;
+ warn "Can't load configuration from $_\n";
+ next;
};
if ($outputtype eq 'h') {
- $d->write_hdlists($out) or warn "Can't write hdlists file\n";
+ $d->write_hdlists($out) or warn "Can't write hdlists file\n";
} else {
- $d->write_mediacfg($out) or warn "Can't write media.cfg file\n";
+ $d->write_mediacfg($out) or warn "Can't write media.cfg file\n";
}
}
-
+__END__