[jhbuild] change trycheckout to try autogen.sh before forcing a checkout
- From: Frederic Peters <fpeters src gnome org>
- To: svn-commits-list gnome org
- Subject: [jhbuild] change trycheckout to try autogen.sh before forcing a checkout
- Date: Wed, 6 May 2009 14:20:48 -0400 (EDT)
commit d7969abf8c27579510313dc07f974ffaf26780b2
Author: Frederic Peters <fpeters 0d be>
Date: Wed May 6 20:17:21 2009 +0200
change trycheckout to try autogen.sh before forcing a checkout
The trycheckout option is used in both terminal and tinderbox
frontends, typically for non-attended installations, in case of
failure it will now first fallback to trying ./autogen.sh, and in
case of a second failure go back to forcing a checkout, wiping the
original directory. (GNOME #581547)
---
doc/C/jhbuild.xml | 9 +++++----
jhbuild/frontends/terminal.py | 17 ++++++++++++-----
jhbuild/frontends/tinderbox.py | 17 ++++++++++++-----
3 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/doc/C/jhbuild.xml b/doc/C/jhbuild.xml
index b47be96..0855696 100644
--- a/doc/C/jhbuild.xml
+++ b/doc/C/jhbuild.xml
@@ -1687,10 +1687,11 @@ libgnomecanvas is missing branch definition for gnome-2-20
<term><varname>trycheckout</varname></term>
<listitem>
<simpara>A boolean option which if set to
- <constant>True</constant>, causes JHBuild to try checking
- out a newer version of a module from version control and
- running <command>autogen.sh</command>, if the module fails
- to build. This option is equivalent to passing
+ <constant>True</constant>, causes JHBuild to automatically
+ try to solve failures by 1) running <command>autogen.sh</command>
+ again, and 2) checking out a newer version of a module from version
+ control (then running <command>autogen.sh</command>.
+ This option is equivalent to passing
<option>--try-checkout</option>.</simpara>
</listitem>
</varlistentry>
diff --git a/jhbuild/frontends/terminal.py b/jhbuild/frontends/terminal.py
index cfd4a4b..8cfa266 100644
--- a/jhbuild/frontends/terminal.py
+++ b/jhbuild/frontends/terminal.py
@@ -74,7 +74,7 @@ phase_map = {
}
class TerminalBuildScript(buildscript.BuildScript):
- triedcheckout = False
+ triedcheckout = None
is_end_of_build = False
def __init__(self, config, module_list):
@@ -260,10 +260,17 @@ class TerminalBuildScript(buildscript.BuildScript):
self.notify.notify(summary = summary, body = error_message,
icon = 'dialog-error', expire = 20)
- if self.config.trycheckout and (not self.triedcheckout) and altstates.count('force_checkout'):
- self.triedcheckout = True
- return 'force_checkout'
- self.triedcheckout = False
+ if self.config.trycheckout:
+ if self.triedcheckout is None and \
+ state not in ('checkout', 'configure'):
+ self.triedcheckout = 'configure'
+ self.message(_('automatically retrying configure'))
+ return 'configure'
+ elif self.triedcheckout == 'configure':
+ self.triedcheckout = 'done'
+ self.message(_('automatically forcing a fresh checkout'))
+ return 'force_checkout'
+ self.triedcheckout = None
if not self.config.interact:
return 'fail'
diff --git a/jhbuild/frontends/tinderbox.py b/jhbuild/frontends/tinderbox.py
index 5e8d062..67e1a59 100644
--- a/jhbuild/frontends/tinderbox.py
+++ b/jhbuild/frontends/tinderbox.py
@@ -156,7 +156,7 @@ def escape(string):
class TinderboxBuildScript(buildscript.BuildScript):
help_url = 'http://live.gnome.org/JhbuildIssues/'
- triedcheckout = False
+ triedcheckout = None
def __init__(self, config, module_list):
buildscript.BuildScript.__init__(self, config, module_list)
@@ -342,10 +342,17 @@ class TinderboxBuildScript(buildscript.BuildScript):
'''handle error during build'''
self.message('error during stage %s of %s: %s' % (state, module.name,
error))
- if self.config.trycheckout and (not self.triedcheckout):
- self.triedcheckout = True
- return 'force_checkout'
- self.triedcheckout = False
+ if self.config.trycheckout:
+ if self.triedcheckout is None and \
+ state not in ('checkout', 'configure'):
+ self.triedcheckout = 'configure'
+ self.message(_('automatically retrying configure'))
+ return 'configure'
+ elif self.triedcheckout == 'configure':
+ self.triedcheckout = 'done'
+ self.message(_('automatically forcing a fresh checkout'))
+ return 'force_checkout'
+ self.triedcheckout = None
if self.modulefp:
self.modulefp.write('<div class="note">The Gnome Live! website may'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]