Skip to content

Commit

Permalink
- submit also queryconfig, fixes package build
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Jan 7, 2014
1 parent b80fdf6 commit 8883068
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions queryconfig
@@ -0,0 +1,47 @@
#!/usr/bin/perl -w

BEGIN {
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}

use strict;

use Build;

my ($dist, $archs, $configdir, $debug);

while (@ARGV) {
if ($ARGV[0] eq '--dist') {
shift @ARGV;
$dist = shift @ARGV;
next;
}
if ($ARGV[0] eq '--archpath') {
shift @ARGV;
$archs = shift @ARGV;
next;
}
if ($ARGV[0] eq '--configdir') {
shift @ARGV;
$configdir = shift @ARGV;
next;
}
last;
}

my $cf = Build::read_config_dist($dist, $archs, $configdir);
die("Unable to read config\n") unless $cf;

my $type = shift @ARGV;
if ($type eq 'buildflags') {
my $argument = shift @ARGV;
die("Specify which buildflag to query\n") unless $argument;

my $result = $cf->{"buildflags:$argument"};
print "$result\n" if defined $result;
} else {
die("unsupported query type: $type\n");
}

exit(0);

0 comments on commit 8883068

Please sign in to comment.