Skip to content

Commit

Permalink
remove getoptflags helper, use queryconfig instead
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Mar 24, 2014
1 parent 799bfe1 commit 45e93d4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 51 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ install:
getbinaryid \
killchroot \
queryconfig \
getoptflags \
common_functions \
init_buildsystem \
substitutedeps \
Expand Down
2 changes: 1 addition & 1 deletion build-recipe-spec
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ recipe_prepare_spec() {
test $BUILD_USER = abuild && cp -p $BUILD_ROOT/root/.rpmmacros $BUILD_ROOT/home/abuild/.rpmmacros

# extract optflags from configuration
getoptflags --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" ${BUILD_DEBUG:+--debug} > $BUILD_ROOT/root/.rpmrc
queryconfig --dist "$BUILD_DIST" --configdir "$CONFIG_DIR" --archpath "$BUILD_ARCH" optflags ${BUILD_DEBUG:+debug} > $BUILD_ROOT/root/.rpmrc
test $BUILD_USER = abuild && cp -p $BUILD_ROOT/root/.rpmrc $BUILD_ROOT/home/abuild/.rpmrc

if test -z "$ABUILD_TARGET"; then
Expand Down
47 changes: 0 additions & 47 deletions getoptflags

This file was deleted.

11 changes: 9 additions & 2 deletions queryconfig
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,19 @@ die("Unable to read config\n") unless $cf;

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

my $result = $cf->{"buildflags:$argument"};
print "$result\n" if defined $result;
} elsif ($type eq 'target' || $type eq 'binarytype' || $type eq 'rawmacros') {
my $cf = Build::read_config_dist($dist, $archs, $configdir);
print "$cf->{$type}\n" if $cf->{$type};
} elsif ($type eq 'optflags') {
exit(0) unless $cf->{'optflags'};
my $all = $cf->{'optflags'}->{'*'};
$all = defined($all) && $all ne '' ? " $all" : '';
$all .= " -g" if $argument && $argument eq 'debug';
for (sort keys %{$cf->{'optflags'}}) {
next if $_ eq '*';
print "optflags: $_ $cf->{'optflags'}->{$_}$all\n";
}
} else {
die("unsupported query type: $type\n");
}
Expand Down

0 comments on commit 45e93d4

Please sign in to comment.