From f19dea58e9b12aa927c27a216f7f4631554c6b56 Mon Sep 17 00:00:00 2001 From: Chris Sosa Date: Thu, 16 Dec 2010 12:36:45 -0800 Subject: [PATCH] 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 --- bin/cros_mark_chrome_as_stable.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/cros_mark_chrome_as_stable.py b/bin/cros_mark_chrome_as_stable.py index 23655500f9..d7a75605e6 100755 --- a/bin/cros_mark_chrome_as_stable.py +++ b/bin/cros_mark_chrome_as_stable.py @@ -101,7 +101,7 @@ def _GetLatestRelease(branch=None): if branch: chrome_version_re = re.compile('^%s\.\d+.*' % branch) else: - chrome_version_re = re.compile('^[0-9]\..*') + chrome_version_re = re.compile('^[0-9]+\..*') for chrome_version in sorted_ls.splitlines(): if chrome_version_re.match(chrome_version): current_version = chrome_version @@ -146,6 +146,9 @@ class ChromeEBuild(cros_mark_as_stable.EBuild): else: return (-1) + def __str__(self): + return self.ebuild_path + def FindChromeCandidates(overlay_dir): """Return a tuple of chrome's unstable ebuild and stable ebuilds. @@ -166,7 +169,7 @@ def FindChromeCandidates(overlay_dir): if not ebuild.chrome_version: Warning('Poorly formatted ebuild found at %s' % path) else: - if not ebuild.is_stable: + if '9999' in ebuild.version: unstable_ebuilds.append(ebuild) else: stable_ebuilds.append(ebuild) @@ -272,6 +275,8 @@ def MarkChromeEBuildAsStable(stable_candidate, unstable_ebuild, chrome_rev, redirect_stderr=True, redirect_stdout=True, exit_code=True): + Info('Previous ebuild with same version found and no 9999 changes found.' + ' Nothing to do.') os.unlink(new_ebuild_path) return None