Fix discovering of stable candidate with unstable ebuilds.

Also add some more information output when we detect that there
is nothing to do.

Change-Id: Ia3dcf0d3c276e10d3368d6bd508f3a0d72be79cd

BUG=chromium-os:8693
TEST=Ran it with all 3 paramaters and current overlay.

Review URL: http://codereview.chromium.org/5884004
This commit is contained in:
Chris Sosa 2010-12-16 12:36:45 -08:00
parent 7c3fdc13b0
commit f19dea58e9

View File

@ -101,7 +101,7 @@ def _GetLatestRelease(branch=None):
if branch: if branch:
chrome_version_re = re.compile('^%s\.\d+.*' % branch) chrome_version_re = re.compile('^%s\.\d+.*' % branch)
else: else:
chrome_version_re = re.compile('^[0-9]\..*') chrome_version_re = re.compile('^[0-9]+\..*')
for chrome_version in sorted_ls.splitlines(): for chrome_version in sorted_ls.splitlines():
if chrome_version_re.match(chrome_version): if chrome_version_re.match(chrome_version):
current_version = chrome_version current_version = chrome_version
@ -146,6 +146,9 @@ class ChromeEBuild(cros_mark_as_stable.EBuild):
else: else:
return (-1) return (-1)
def __str__(self):
return self.ebuild_path
def FindChromeCandidates(overlay_dir): def FindChromeCandidates(overlay_dir):
"""Return a tuple of chrome's unstable ebuild and stable ebuilds. """Return a tuple of chrome's unstable ebuild and stable ebuilds.
@ -166,7 +169,7 @@ def FindChromeCandidates(overlay_dir):
if not ebuild.chrome_version: if not ebuild.chrome_version:
Warning('Poorly formatted ebuild found at %s' % path) Warning('Poorly formatted ebuild found at %s' % path)
else: else:
if not ebuild.is_stable: if '9999' in ebuild.version:
unstable_ebuilds.append(ebuild) unstable_ebuilds.append(ebuild)
else: else:
stable_ebuilds.append(ebuild) stable_ebuilds.append(ebuild)
@ -272,6 +275,8 @@ def MarkChromeEBuildAsStable(stable_candidate, unstable_ebuild, chrome_rev,
redirect_stderr=True, redirect_stderr=True,
redirect_stdout=True, redirect_stdout=True,
exit_code=True): exit_code=True):
Info('Previous ebuild with same version found and no 9999 changes found.'
' Nothing to do.')
os.unlink(new_ebuild_path) os.unlink(new_ebuild_path)
return None return None