[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 2/2] ts-xen-build: Pass --enable if --disable found in usage, and v.v.



The existing code works in practice if the usage message always lists
the non-default, since the unlisted-in-usage options that would be
supported, but are elided, are in any case the default.

But configure might *compute* its defaults.  In which case it will
list only one of them in the usage message.  If the computed default
is not the same as the usual default (the one implied by listing the
opposite in the usage message) we would wrongly not pass the option.

So grep for both enable and disable.

Signed-off-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
CC: Juergen Gross <jgross@xxxxxxxx>
---
 ts-xen-build | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/ts-xen-build b/ts-xen-build
index d6f6bfacb..c294a51ea 100755
--- a/ts-xen-build
+++ b/ts-xen-build
@@ -142,12 +142,20 @@ END
 }
 
 sub build () {
+    # We want to explicitly enable and disable some things.  But not
+    # all versions of Xen support all configuration options.  We
+    # detect presence of an option by grepping configure.  That finds
+    # them in the usage message.  The usage message has only one of
+    # the two, depending on the usual default.  (Presence of --enable
+    # in the usage output means --disable is supported, and vice
+    # versa.)  So we search for both enable and disable, and if either
+    # is found, we use the one we want.
     my $enable_opts = ''; # shell script to set "enable_opts" shell var
     my $enable_disable = sub {
        my ($subdir, $feat, $enable) = @_;
        my $opt = "--".($enable ? 'enable' : 'disable')."-$feat";
        $enable_opts .= <<END;
-                if grep -q -- $opt \\
+                if egrep -q -- '--disable-$feat|--enable-$feat' \\
                                ${subdir}configure ; then
                    enable_opts="\$enable_opts $opt"
                 fi
-- 
2.20.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.