aboutsummaryrefslogtreecommitdiffstats
path: root/dumpdistribconf
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-09-29 16:08:09 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-09-29 16:08:09 +0000
commitc6887372e72ba7c1c7afda798a2f4ad83b901676 (patch)
treedc14ada0e384d37c9111c5a1d693982bbd13b69d /dumpdistribconf
parent3ee1bace629019b992f3bc6f844e15d3da59b7b8 (diff)
downloadrpmtools-c6887372e72ba7c1c7afda798a2f4ad83b901676.tar
rpmtools-c6887372e72ba7c1c7afda798a2f4ad83b901676.tar.gz
rpmtools-c6887372e72ba7c1c7afda798a2f4ad83b901676.tar.bz2
rpmtools-c6887372e72ba7c1c7afda798a2f4ad83b901676.tar.xz
rpmtools-c6887372e72ba7c1c7afda798a2f4ad83b901676.zip
Use Pod::Usage
Diffstat (limited to 'dumpdistribconf')
-rwxr-xr-xdumpdistribconf55
1 files changed, 43 insertions, 12 deletions
diff --git a/dumpdistribconf b/dumpdistribconf
index 5ea82b2..fcb6e57 100755
--- a/dumpdistribconf
+++ b/dumpdistribconf
@@ -1,28 +1,24 @@
#!/usr/bin/perl
-# $Id$
+(our $VERSION) = q$Id$ =~ /(\d+\.\d+)/;
use strict;
use Getopt::Long;
use Distribconf::Build;
+use Pod::Usage;
-sub usage {
- print STDERR <<EOF;
-$0 -h|-m [options] path1 [path2 ...]
-Dump Mandriva Linux distrib configuration.
-
--h output an hdlists file
--m output an media.cfg file
--d write the directly into the dedicated location
-EOF
- exit 1;
-};
+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;
@@ -42,3 +38,38 @@ foreach (@ARGV) {
}
__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<media.cfg> (or an F<hdlists> 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<hdlists> file.
+
+=item B<-m>
+
+Dump a F<media.cfg> file (default)
+
+=item B<-d>
+
+Instead of writing to the standard output, write to a file placed in the
+standard location (e.g. F<< <root>/media/media_info/media.cfg >>).
+
+=back
+
+=cut