[Collab-qa-commits] r1085 - udd/doc
neronus-guest at alioth.debian.org
neronus-guest at alioth.debian.org
Tue Aug 12 11:52:08 UTC 2008
Author: neronus-guest
Date: 2008-08-12 11:52:04 +0000 (Tue, 12 Aug 2008)
New Revision: 1085
Modified:
udd/doc/generate_db_schema.pl
Log:
Make sources choosable
Modified: udd/doc/generate_db_schema.pl
===================================================================
--- udd/doc/generate_db_schema.pl 2008-08-12 11:46:42 UTC (rev 1084)
+++ udd/doc/generate_db_schema.pl 2008-08-12 11:52:04 UTC (rev 1085)
@@ -13,18 +13,28 @@
return $string;
}
-if (@ARGV != 1) {
- print STDERR "Usage: $0 <config-file>\n";
+if (@ARGV == 0) {
+ print STDERR "Usage: $0 <config-file> [source 1 [source 2 ...]]\n";
exit 1;
}
my $config = LoadFile($ARGV[0]) or die "Could not load configuration: $!";
-my @sources = grep { !($_ eq 'general') } keys %{$config};
+my @sources = ();
+if (@ARGV == 1) {
+ @sources = grep { !($_ eq 'general') } keys %{$config};
+} else {
+ @sources = @ARGV[1, $#ARGV];
+}
+
my $schema_dir = $config->{general}->{'schema-dir'} or die "schema-dir not specified";
my %schemata = ();
foreach my $source (@sources) {
+ if(not exists $config->{$source}) {
+ print STDERR "No such source: $source\n";
+ exit 1;
+ }
my %src_config = %{$config->{$source}};
foreach my $schema_tag (qw{schema packages-schema sources-schema}) {
if(not exists $src_config{$schema_tag}) {
More information about the Collab-qa-commits
mailing list