[jhbuild] Revert "build/buildone: Always run autogen, remove alwaysautogen config option"



commit 936f1b6cbcf3ab0022f59c683419c0b535564f3d
Author: Craig Keogh <cskeogh adam com au>
Date:   Fri Sep 28 21:42:17 2012 +0930

    Revert "build/buildone: Always run autogen, remove alwaysautogen config option"
    
    This reverts commit 96182ea661cc65c42afe6b11972230e6c1ffbb55.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=683416
    
    Conflicts:
    	doc/C/index.docbook
    	jhbuild/commands/base.py
    	jhbuild/config.py
    	jhbuild/modtypes/autotools.py
    	jhbuild/modtypes/waf.py

 doc/C/index.docbook           |   43 +++++++++++++++++++++++++++++++---------
 jhbuild/commands/autobuild.py |    4 +-
 jhbuild/commands/base.py      |    8 +++---
 jhbuild/commands/bot.py       |    1 +
 jhbuild/commands/tinderbox.py |    4 +-
 jhbuild/config.py             |   39 ++++++++++++++++++++-----------------
 jhbuild/defaults.jhbuildrc    |    1 +
 jhbuild/frontends/gtkui.py    |    1 +
 jhbuild/modtypes/autotools.py |    3 ++
 jhbuild/modtypes/waf.py       |    6 ++++-
 10 files changed, 73 insertions(+), 37 deletions(-)
---
diff --git a/doc/C/index.docbook b/doc/C/index.docbook
index 20c0b45..b0053fd 100644
--- a/doc/C/index.docbook
+++ b/doc/C/index.docbook
@@ -775,6 +775,15 @@ jhbuildbot_password = 'password'
       <variablelist>
         <varlistentry>
           <term>
+            <option>-a</option>, <option>--autogen</option>
+          </term>
+          <listitem>
+            <simpara>Always run <command>autogen.sh</command> before building
+              modules.</simpara>
+          </listitem>
+        </varlistentry>
+        <varlistentry>
+          <term>
             <option>-c</option>, <option>--clean</option>
           </term>
           <listitem>
@@ -988,6 +997,7 @@ jhbuildbot_password = 'password'
         It is useful for rebuilding one or more modules.</para>
 
       <cmdsynopsis><command>jhbuild buildone</command>
+        <arg>--autogen</arg>
         <arg>--clean</arg>
         <arg>--check</arg>
         <arg>--distcheck</arg>
@@ -1001,11 +1011,11 @@ jhbuildbot_password = 'password'
         <arg choice="plain" rep="repeat">module</arg>
       </cmdsynopsis>
 
-      <para>The <option>--check</option>, <option>--clean</option>,
-        <option>-d</option>, <option>--distcheck</option>,
-        <option>--distclean</option>, <option>--no-network</option>,
-        <option>-D</option>, <option>-x</option> and <option>--nodeps</option>
-        options are processed as per the
+      <para>The <option>--autogen</option>, <option>--check</option>,
+        <option>--clean</option>, <option>-d</option>,
+        <option>--distcheck</option>, <option>--distclean</option>,
+        <option>--no-network</option>, <option>-D</option>, <option>-x</option>
+        and <option>--nodeps</option> options are processed as per the
         <link linkend="command-reference-build"><command>build</command></link>
         command.</para>
 
@@ -1409,6 +1419,7 @@ Optional packages: (JHBuild will build the missing packages)
         similar to Mozilla's Tinderbox, or Debian's Buildd.</para>
 
       <cmdsynopsis><command>jhbuild tinderbox</command>
+        <arg>--autogen</arg>
         <arg>--clean</arg>
         <arg>--distclean</arg>
         <arg>--no-network</arg>
@@ -1423,11 +1434,12 @@ Optional packages: (JHBuild will build the missing packages)
         <arg rep="repeat">module</arg>
       </cmdsynopsis>
 
-      <para>The <option>--clean</option>, <option>--distclean</option>,
-        <option>--no-network</option>, <option>--skip</option>,
-        <option>--start-at</option>, <option>-D</option>, <option>-C</option>,
-        <option>-N</option>, <option>-f</option> and <option>--nodeps</option>
-        options are processed as per the
+      <para>The <option>--autogen</option>, <option>--clean</option>,
+        <option>--distclean</option>, <option>--no-network</option>,
+        <option>--skip</option>, <option>--start-at</option>,
+        <option>-D</option>, <option>-C</option>, <option>-N</option>,
+        <option>-f</option> and <option>--nodeps</option> options are processed
+        as per the
         <link linkend="command-reference-build"><command>build</command></link>
         command.</para>
 
@@ -1534,6 +1546,17 @@ Optional packages: (JHBuild will build the missing packages)
 
       <variablelist>
 <?dbhtml list-presentation="table"?>
+        <varlistentry id="cfg-alwaysautogen">
+          <term>
+            <varname>alwaysautogen</varname>
+          </term>
+          <listitem>
+            <simpara>A boolean value if set to <constant>True</constant>,
+              always run <command>autogen.sh</command>. This is equivalent to
+              passing <option>--autogen</option> option to JHBuild. Defaults to
+              <constant>False</constant>.</simpara>
+          </listitem>
+        </varlistentry>
         <varlistentry id="cfg-autogenargs">
           <term>
             <varname>autogenargs</varname>
diff --git a/jhbuild/commands/autobuild.py b/jhbuild/commands/autobuild.py
index d800559..a770107 100644
--- a/jhbuild/commands/autobuild.py
+++ b/jhbuild/commands/autobuild.py
@@ -32,8 +32,8 @@ class cmd_autobuild(Command):
     def __init__(self):
         Command.__init__(self, [
             make_option('-a', '--autogen',
-                        action='store_true', dest='_unused', default=False,
-                        help=optparse.SUPPRESS_HELP), # no longer used
+                        action='store_true', dest='autogen', default=False,
+                        help=_('always run autogen.sh')),
             make_option('-c', '--clean',
                         action='store_true', dest='clean', default=False,
                         help=_('run make clean before make')),
diff --git a/jhbuild/commands/base.py b/jhbuild/commands/base.py
index 1909101..28833a0 100644
--- a/jhbuild/commands/base.py
+++ b/jhbuild/commands/base.py
@@ -168,8 +168,8 @@ class cmd_build(BuildCommand):
     def __init__(self):
         Command.__init__(self, [
             make_option('-a', '--autogen',
-                        action='store_true', dest='_unused', default=False,
-                        help=optparse.SUPPRESS_HELP), # no longer used
+                        action='store_true', dest='autogen', default=False,
+                        help=_('always run autogen.sh')),
             make_option('', '--distclean',
                         action='store_true', dest='distclean', default=False,
                         help=_('completely clean source tree')),
@@ -279,8 +279,8 @@ class cmd_buildone(BuildCommand):
     def __init__(self):
         Command.__init__(self, [
             make_option('-a', '--autogen',
-                        action='store_true', dest='_unused', default=False,
-                        help=optparse.SUPPRESS_HELP), # no longer used
+                        action='store_true', dest='autogen', default=False,
+                        help=_('always run autogen.sh')),
             make_option('-c', '--clean',
                         action='store_true', dest='clean', default=False,
                         help=_('run make clean before make')),
diff --git a/jhbuild/commands/bot.py b/jhbuild/commands/bot.py
index 14d5a4e..c394caf 100644
--- a/jhbuild/commands/bot.py
+++ b/jhbuild/commands/bot.py
@@ -163,6 +163,7 @@ class cmd_bot(Command):
                     config.nonetwork = False
                     phases = ['checkout']
                 elif args[0] == 'build':
+                    config.alwaysautogen = True
                     # make check will be run in another step
                     config.makecheck = False
                     config.build_targets = ['install']
diff --git a/jhbuild/commands/tinderbox.py b/jhbuild/commands/tinderbox.py
index 00f5a7b..672ae33 100644
--- a/jhbuild/commands/tinderbox.py
+++ b/jhbuild/commands/tinderbox.py
@@ -34,8 +34,8 @@ class cmd_tinderbox(BuildCommand):
     def __init__(self):
         Command.__init__(self, [
             make_option('-a', '--autogen',
-                        action='store_true', dest='_unused', default=False,
-                        help=optparse.SUPPRESS_HELP), # no longer used
+                        action='store_true', dest='autogen', default=False,
+                        help=_('always run autogen.sh')),
             make_option('', '--distclean',
                         action='store_true', dest='distclean', default=False,
                         help=_('completely clean source tree')),
diff --git a/jhbuild/config.py b/jhbuild/config.py
index 49ee693..0a83c16 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -45,24 +45,25 @@ _known_keys = [ 'moduleset', 'modules', 'skip', 'tags', 'prefix',
                 'installprog', 'repos', 'branches', 'noxvfb', 'xvfbargs',
                 'builddir_pattern', 'module_autogenargs', 'module_makeargs',
                 'interact', 'buildscript', 'nonetwork', 'nobuild',
-                'noinstall', 'makeclean', 'makedistclean', 'makecheck', 'module_makecheck',
-                'use_lib64', 'tinderbox_outputdir', 'sticky_date',
-                'tarballdir', 'pretty_print', 'svn_program', 'makedist',
-                'makedistcheck', 'nonotify', 'notrayicon', 'cvs_program',
-                'checkout_mode', 'copy_dir', 'module_checkout_mode',
-                'build_policy', 'trycheckout', 'min_age',
-                'nopoison', 'module_nopoison', 'forcecheck',
-                'makecheck_advisory', 'quiet_mode', 'progress_bar',
-                'module_extra_env', 'jhbuildbot_master', 'jhbuildbot_slavename',
-                'jhbuildbot_password', 'jhbuildbot_svn_commits_box',
-                'jhbuildbot_slaves_dir', 'jhbuildbot_dir',
-                'jhbuildbot_mastercfg', 'use_local_modulesets',
-                'ignore_suggests', 'modulesets_dir', 'mirror_policy',
-                'module_mirror_policy', 'dvcs_mirror_dir', 'build_targets',
-                'cmakeargs', 'module_cmakeargs', 'print_command_pattern',
-                'static_analyzer', 'module_static_analyzer', 'static_analyzer_template', 'static_analyzer_outputdir',
-                'check_sysdeps',
-                ]
+                'alwaysautogen', 'noinstall', 'makeclean', 'makedistclean',
+                'makecheck', 'module_makecheck', 'use_lib64',
+                'tinderbox_outputdir', 'sticky_date', 'tarballdir',
+                'pretty_print', 'svn_program', 'makedist', 'makedistcheck',
+                'nonotify', 'notrayicon', 'cvs_program', 'checkout_mode',
+                'copy_dir', 'module_checkout_mode', 'build_policy',
+                'trycheckout', 'min_age', 'nopoison', 'module_nopoison',
+                'forcecheck', 'makecheck_advisory', 'quiet_mode',
+                'progress_bar', 'module_extra_env', 'jhbuildbot_master',
+                'jhbuildbot_slavename', 'jhbuildbot_password',
+                'jhbuildbot_svn_commits_box', 'jhbuildbot_slaves_dir',
+                'jhbuildbot_dir', 'jhbuildbot_mastercfg',
+                'use_local_modulesets', 'ignore_suggests', 'modulesets_dir',
+                'mirror_policy', 'module_mirror_policy', 'dvcs_mirror_dir',
+                'build_targets', 'cmakeargs', 'module_cmakeargs',
+                'print_command_pattern', 'static_analyzer',
+                'module_static_analyzer', 'static_analyzer_template',
+                'static_analyzer_outputdir', 'check_sysdeps',
+              ]
 
 env_prepends = {}
 def prependpath(envvar, path):
@@ -618,6 +619,8 @@ class Config:
             options = self.cmdline_options
         else:
             self.cmdline_options = options
+        if hasattr(options, 'autogen') and options.autogen:
+            self.alwaysautogen = True
         if hasattr(options, 'check') and (
                 options.check and not 'check' in self.build_targets):
             self.build_targets.insert(0, 'check')
diff --git a/jhbuild/defaults.jhbuildrc b/jhbuild/defaults.jhbuildrc
index 82bc3bf..aa74a6f 100644
--- a/jhbuild/defaults.jhbuildrc
+++ b/jhbuild/defaults.jhbuildrc
@@ -87,6 +87,7 @@ module_nopoison = {}
 
 # control parts of the build process
 nonetwork     = False  # never touch the network
+alwaysautogen = False  # always call autogen.sh
 nobuild       = False  # don't actually build the packages
 noinstall     = False  # don't install the packages
 makeclean     = False  # run make clean before building
diff --git a/jhbuild/frontends/gtkui.py b/jhbuild/frontends/gtkui.py
index 732922c..62e2878 100644
--- a/jhbuild/frontends/gtkui.py
+++ b/jhbuild/frontends/gtkui.py
@@ -718,6 +718,7 @@ class PreferencesDialog(gtk.Dialog):
 
         for key, label in (
                 ('nonetwork', _('Disable network access')),
+                ('alwaysautogen', _('Always run autogen.sh')),
                 ('nopoison', _('Don\'t poison modules on failure'))):
             checkbutton = gtk.CheckButton(label)
             checkbutton.set_active(getattr(self.app.config, key))
diff --git a/jhbuild/modtypes/autotools.py b/jhbuild/modtypes/autotools.py
index c09fe05..1d8b7c6 100644
--- a/jhbuild/modtypes/autotools.py
+++ b/jhbuild/modtypes/autotools.py
@@ -180,6 +180,9 @@ class AutogenModule(MakeModule, DownloadableModule):
         if self.skip_autogen == 'never':
             return False
 
+        if buildscript.config.alwaysautogen:
+            return False
+
         # if autogen.sh args has changed, re-run configure
         db_entry = buildscript.moduleset.packagedb.get(self.name)
         if db_entry:
diff --git a/jhbuild/modtypes/waf.py b/jhbuild/modtypes/waf.py
index 10c3942..09b2654 100644
--- a/jhbuild/modtypes/waf.py
+++ b/jhbuild/modtypes/waf.py
@@ -64,7 +64,11 @@ class WafModule(Package, DownloadableModule):
                           self.PHASE_INSTALL]:
             return False
 
-        return False
+        # skip if the .lock-wscript file exists and we don't have the
+        # alwaysautogen flag turned on:
+        builddir = self.get_builddir(buildscript)
+        return (os.path.exists(os.path.join(builddir, '.lock-wscript')) and
+                not buildscript.config.alwaysautogen)
 
     def do_configure(self, buildscript):
         builddir = self.get_builddir(buildscript)



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