qmake: Fix order-dependency of *.pro glob search.

The Mojolicious work exposed this bug but it's a bug all the same.  The
way that Perl's glob function works differs based on whether you use it
in a scalar (including boolean) context or whether you use it in a list
context.

I had the parentheses in this test to try to force a list context but
that's apparently not sufficient as I had every fourth Qt module
failing to build due to this glob failing, in my Mojolicious testing.

The revised test successfully forces glob() to use list context, which
means it always returns the same values for a given directory instead of
acting as a non-reentrant iterator.
wilder
Michael Pyne 8 years ago
parent 9d09e47878
commit 698cc6d376
  1. 5
      modules/ksb/Module.pm

@ -352,7 +352,10 @@ sub buildSystem
$buildType = ksb::BuildSystem::KDE4->new($self);
}
if (!$buildType && (glob ("$sourceDir/*.pro"))) {
# We have to assign to an array to force glob to return all results,
# otherwise it acts like a non-reentrant generator whose output depends on
# how many times it's been called...
if (!$buildType && (my @files = glob ("$sourceDir/*.pro"))) {
$buildType = ksb::BuildSystem::QMake->new($self);
}

Loading…
Cancel
Save