#!/usr/bin/perl (our $VERSION) = q$Id$ =~ /(\d+\.\d+)/; use strict; use Getopt::Long; use Distribconf::Build; use Pod::Usage; sub usage () { pod2usage({ -verbose => 1 }); exit 0; } my ($out, $outputtype) = (\*STDOUT, 'm'); GetOptions( h => sub { $outputtype = 'h' }, m => sub { $outputtype = 'm' }, d => sub { undef $out }, 'v|version' => sub { warn "$0 version $VERSION\n"; exit 0 }, 'h|help' => \&usage, ); @ARGV or usage; foreach (@ARGV) { print "Using root $_...\n"; my $d = Distribconf::Build->new($_); $d->load and do { warn "Can't load configuration from $_\n"; next; }; if ($outputtype eq 'h') { $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"; } } __END__ =head1 NAME dumpdistribconf - dumps a media.cfg from a distribution tree =head1 SYNOPSIS dumpdistribconf [-h|-m] [-d] path [path...] =head1 DESCRIPTION This will dump a F (or an F file if B<-h> is specified) from a Mandriva Linux distribution tree. By default it's dumped to the standard output. =head1 OPTIONS =over 4 =item B<-h> Dump an F file. =item B<-m> Dump a F file (default) =item B<-d> Instead of writing to the standard output, write to a file placed in the standard location (e.g. F<< /media/media_info/media.cfg >>). =back =cut