#!/usr/local/bin/perl -w

use Bootstrap;

my $repository_data_ver = '$Id: repository-data.pl,v 1.2 2001/08/29 21:16:07 sbi Exp $';

my %st = ('LOCAL_RPMS'   => '$rpm_rpm_dir',
          'RPMBUILD'     => '$rpm_command',
          'EXTENSION'    => '$rpm_extension',
          'SOURCES_LIST' => '$sources_list');

if ($#ARGV == -1) {
    print guess_repository."\n";
} elsif ($#ARGV == 1) {
    set_repository $ARGV[0];
    if (defined($st{$ARGV[1]})) {
        print eval($st{$ARGV[1]})."\n";
    } else {
        print STDERR "Unknown key: $ARGV[1]\n";
        exit 1;
    }
} else {
    print <<__EOTEXT__;
Usage: $0 [ repository { LOCAL_RPMS | RPMBUILD | EXTENSION 
  | SOURCES_LIST } ]

  Without any arguments, repository-data print the likely repository
used.  Otherwise it prints the value of argument 2 for the specified
repository.
__EOTEXT__
    exit 1;
}
