blob: 8ab128141e524df390b315c48230f7c3b2410110 [file] [log] [blame]
Aviv Keshetb1238c32013-04-01 11:42:13 -07001# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Mike Frysingerad8c6ca2014-02-03 11:28:45 -05005"""Fast alternative to `emerge-$BOARD autotest-all`
Aviv Keshetb1238c32013-04-01 11:42:13 -07006
Aviv Keshetb1238c32013-04-01 11:42:13 -07007Simple script to be run inside the chroot. Used as a fast approximation of
8emerge-$board autotest-all, by simply rsync'ing changes from trunk to sysroot.
9"""
10
Mike Frysinger383367e2014-09-16 15:06:17 -040011from __future__ import print_function
12
Aviv Keshete7b20192013-04-24 14:05:53 -070013import argparse
Aviv Keshetfe54a8a2013-09-16 15:49:03 -070014import glob
Aviv Keshetb1238c32013-04-01 11:42:13 -070015import os
Aviv Keshet787ffcd2013-04-08 15:14:56 -070016import re
Aviv Keshetb1238c32013-04-01 11:42:13 -070017import sys
Aviv Keshet787ffcd2013-04-08 15:14:56 -070018from collections import namedtuple
19
Don Garrett88b8d782014-05-13 17:30:55 -070020from chromite.cbuildbot import constants
Aviv Keshetb1238c32013-04-01 11:42:13 -070021from chromite.lib import cros_build_lib
Ralph Nathan91874ca2015-03-19 13:29:41 -070022from chromite.lib import cros_logging as logging
Aviv Keshetb1238c32013-04-01 11:42:13 -070023from chromite.lib import git
Aviv Keshet557e6882013-04-25 13:26:09 -070024from chromite.lib import osutils
Alex Deymo075c2292014-09-04 18:31:50 -070025from chromite.lib import portage_util
Aviv Keshetb1238c32013-04-01 11:42:13 -070026
Aviv Keshet940c17f2013-04-11 18:41:42 -070027if cros_build_lib.IsInsideChroot():
28 # Only import portage after we've checked that we're inside the chroot.
29 import portage
30
Mike Frysingere65f3752014-12-08 00:46:39 -050031
Aviv Keshetb1238c32013-04-01 11:42:13 -070032INCLUDE_PATTERNS_FILENAME = 'autotest-quickmerge-includepatterns'
33AUTOTEST_PROJECT_NAME = 'chromiumos/third_party/autotest'
Aviv Keshet5f3cf722013-05-09 17:35:25 -070034AUTOTEST_EBUILD = 'chromeos-base/autotest'
Aviv Keshetfe54a8a2013-09-16 15:49:03 -070035DOWNGRADE_EBUILDS = ['chromeos-base/autotest']
Aviv Keshet787ffcd2013-04-08 15:14:56 -070036
Aviv Keshetc73cfc32013-06-14 16:18:53 -070037IGNORE_SUBDIRS = ['ExternalSource',
38 'logs',
39 'results',
40 'site-packages']
41
Aviv Keshet787ffcd2013-04-08 15:14:56 -070042# Data structure describing a single rsync filesystem change.
43#
44# change_description: An 11 character string, the rsync change description
45# for the particular file.
46# absolute_path: The absolute path of the created or modified file.
47ItemizedChange = namedtuple('ItemizedChange', ['change_description',
48 'absolute_path'])
49
Aviv Keshet787ffcd2013-04-08 15:14:56 -070050# Data structure describing the rsync new/modified files or directories.
51#
52# new_files: A list of ItemizedChange objects for new files.
53# modified_files: A list of ItemizedChange objects for modified files.
54# new_directories: A list of ItemizedChange objects for new directories.
55ItemizedChangeReport = namedtuple('ItemizedChangeReport',
56 ['new_files', 'modified_files',
57 'new_directories'])
58
Mike Frysingere65f3752014-12-08 00:46:39 -050059
Aviv Keshet84bdfc52013-06-04 13:19:38 -070060class PortagePackageAPIError(Exception):
61 """Exception thrown when unable to retrieve a portage package API."""
62
Aviv Keshet787ffcd2013-04-08 15:14:56 -070063
Aviv Keshet75d65962013-04-17 16:15:23 -070064def GetStalePackageNames(change_list, autotest_sysroot):
Aviv Keshete7b20192013-04-24 14:05:53 -070065 """Given a rsync change report, returns the names of stale test packages.
Aviv Keshet75d65962013-04-17 16:15:23 -070066
67 This function pulls out test package names for client-side tests, stored
68 within the client/site_tests directory tree, that had any files added or
69 modified and for whom any existing bzipped test packages may now be stale.
70
Mike Frysinger02e1e072013-11-10 22:11:34 -050071 Args:
Aviv Keshet75d65962013-04-17 16:15:23 -070072 change_list: A list of ItemizedChange objects corresponding to changed
73 or modified files.
74 autotest_sysroot: Absolute path of autotest in the sysroot,
Aviv Keshet474469d2013-07-22 12:54:52 -070075 e.g. '/build/lumpy/usr/local/build/autotest'
Aviv Keshet75d65962013-04-17 16:15:23 -070076
77 Returns:
78 A list of test package names, eg ['factory_Leds', 'login_UserPolicyKeys'].
79 May contain duplicate entries if multiple files within a test directory
80 were modified.
81 """
82 exp = os.path.abspath(autotest_sysroot) + r'/client/site_tests/(.*?)/.*'
83 matches = [re.match(exp, change.absolute_path) for change in change_list]
84 return [match.group(1) for match in matches if match]
85
86
Aviv Keshet787ffcd2013-04-08 15:14:56 -070087def ItemizeChangesFromRsyncOutput(rsync_output, destination_path):
88 """Convert the output of an rsync with `-i` to a ItemizedChangeReport object.
89
Mike Frysinger02e1e072013-11-10 22:11:34 -050090 Args:
Aviv Keshet787ffcd2013-04-08 15:14:56 -070091 rsync_output: String stdout of rsync command that was run with `-i` option.
92 destination_path: String absolute path of the destination directory for the
93 rsync operations. This argument is necessary because
94 rsync's output only gives the relative path of
95 touched/added files.
96
97 Returns:
98 ItemizedChangeReport object giving the absolute paths of files that were
99 created or modified by rsync.
100 """
101 modified_matches = re.findall(r'([.>]f[^+]{9}) (.*)', rsync_output)
102 new_matches = re.findall(r'(>f\+{9}) (.*)', rsync_output)
103 new_symlink_matches = re.findall(r'(cL\+{9}) (.*) -> .*', rsync_output)
104 new_dir_matches = re.findall(r'(cd\+{9}) (.*)', rsync_output)
105
106 absolute_modified = [ItemizedChange(c, os.path.join(destination_path, f))
107 for (c, f) in modified_matches]
108
109 # Note: new symlinks are treated as new files.
110 absolute_new = [ItemizedChange(c, os.path.join(destination_path, f))
111 for (c, f) in new_matches + new_symlink_matches]
112
113 absolute_new_dir = [ItemizedChange(c, os.path.join(destination_path, f))
114 for (c, f) in new_dir_matches]
115
116 return ItemizedChangeReport(new_files=absolute_new,
117 modified_files=absolute_modified,
118 new_directories=absolute_new_dir)
119
120
Aviv Keshete00caeb2013-04-17 14:03:25 -0700121def GetPackageAPI(portage_root, package_cp):
Aviv Keshete7b20192013-04-24 14:05:53 -0700122 """Gets portage API handles for the given package.
Aviv Keshet940c17f2013-04-11 18:41:42 -0700123
Mike Frysinger02e1e072013-11-10 22:11:34 -0500124 Args:
Aviv Keshete00caeb2013-04-17 14:03:25 -0700125 portage_root: Root directory of portage tree. Eg '/' or '/build/lumpy'
Mike Frysingerad8c6ca2014-02-03 11:28:45 -0500126 package_cp: A string similar to 'chromeos-base/autotest-tests'.
Aviv Keshete00caeb2013-04-17 14:03:25 -0700127
128 Returns:
129 Returns (package, vartree) tuple, where
130 package is of type portage.dbapi.vartree.dblink
131 vartree is of type portage.dbapi.vartree.vartree
Aviv Keshet940c17f2013-04-11 18:41:42 -0700132 """
133 if portage_root is None:
Mike Frysingere65f3752014-12-08 00:46:39 -0500134 # pylint: disable=no-member
Aviv Keshete7b20192013-04-24 14:05:53 -0700135 portage_root = portage.root
Aviv Keshet940c17f2013-04-11 18:41:42 -0700136 # Ensure that portage_root ends with trailing slash.
137 portage_root = os.path.join(portage_root, '')
138
Aviv Keshete7b20192013-04-24 14:05:53 -0700139 # Create a vartree object corresponding to portage_root.
Aviv Keshet940c17f2013-04-11 18:41:42 -0700140 trees = portage.create_trees(portage_root, portage_root)
141 vartree = trees[portage_root]['vartree']
142
Aviv Keshete7b20192013-04-24 14:05:53 -0700143 # List the matching installed packages in cpv format.
Aviv Keshet940c17f2013-04-11 18:41:42 -0700144 matching_packages = vartree.dbapi.cp_list(package_cp)
145
146 if not matching_packages:
Aviv Keshet84bdfc52013-06-04 13:19:38 -0700147 raise PortagePackageAPIError('No matching package for %s in portage_root '
148 '%s' % (package_cp, portage_root))
Aviv Keshet940c17f2013-04-11 18:41:42 -0700149
150 if len(matching_packages) > 1:
Aviv Keshet84bdfc52013-06-04 13:19:38 -0700151 raise PortagePackageAPIError('Too many matching packages for %s in '
152 'portage_root %s' % (package_cp,
153 portage_root))
Aviv Keshet940c17f2013-04-11 18:41:42 -0700154
Aviv Keshete7b20192013-04-24 14:05:53 -0700155 # Convert string match to package dblink.
Aviv Keshet940c17f2013-04-11 18:41:42 -0700156 package_cpv = matching_packages[0]
Alex Deymo075c2292014-09-04 18:31:50 -0700157 package_split = portage_util.SplitCPV(package_cpv)
Mike Frysingere65f3752014-12-08 00:46:39 -0500158 # pylint: disable=no-member
Aviv Keshete7b20192013-04-24 14:05:53 -0700159 package = portage.dblink(package_split.category,
Aviv Keshet940c17f2013-04-11 18:41:42 -0700160 package_split.pv, settings=vartree.settings,
161 vartree=vartree)
162
Aviv Keshete00caeb2013-04-17 14:03:25 -0700163 return package, vartree
164
165
166def DowngradePackageVersion(portage_root, package_cp,
167 downgrade_to_version='0'):
Aviv Keshete7b20192013-04-24 14:05:53 -0700168 """Downgrade the specified portage package version.
Aviv Keshete00caeb2013-04-17 14:03:25 -0700169
Mike Frysinger02e1e072013-11-10 22:11:34 -0500170 Args:
Aviv Keshete00caeb2013-04-17 14:03:25 -0700171 portage_root: Root directory of portage tree. Eg '/' or '/build/lumpy'
Mike Frysingerad8c6ca2014-02-03 11:28:45 -0500172 package_cp: A string similar to 'chromeos-base/autotest-tests'.
Aviv Keshete00caeb2013-04-17 14:03:25 -0700173 downgrade_to_version: String version to downgrade to. Default: '0'
174
175 Returns:
Aviv Keshet557e6882013-04-25 13:26:09 -0700176 True on success. False on failure (nonzero return code from `mv` command).
Aviv Keshete00caeb2013-04-17 14:03:25 -0700177 """
Aviv Keshet84bdfc52013-06-04 13:19:38 -0700178 try:
179 package, _ = GetPackageAPI(portage_root, package_cp)
180 except PortagePackageAPIError:
181 # Unable to fetch a corresponding portage package API for this
182 # package_cp (either no such package, or name ambigious and matches).
183 # So, just fail out.
184 return False
Aviv Keshete00caeb2013-04-17 14:03:25 -0700185
186 source_directory = package.dbdir
187 destination_path = os.path.join(
188 package.dbroot, package_cp + '-' + downgrade_to_version)
189 if os.path.abspath(source_directory) == os.path.abspath(destination_path):
Aviv Keshet557e6882013-04-25 13:26:09 -0700190 return True
Aviv Keshete00caeb2013-04-17 14:03:25 -0700191 command = ['mv', source_directory, destination_path]
Aviv Keshet557e6882013-04-25 13:26:09 -0700192 code = cros_build_lib.SudoRunCommand(command, error_code_ok=True).returncode
193 return code == 0
Aviv Keshete00caeb2013-04-17 14:03:25 -0700194
195
Aviv Keshete7b20192013-04-24 14:05:53 -0700196def UpdatePackageContents(change_report, package_cp, portage_root=None):
197 """Add newly created files/directors to package contents.
Aviv Keshete00caeb2013-04-17 14:03:25 -0700198
199 Given an ItemizedChangeReport, add the newly created files and directories
200 to the CONTENTS of an installed portage package, such that these files are
201 considered owned by that package.
202
Mike Frysinger02e1e072013-11-10 22:11:34 -0500203 Args:
Don Garrett25f309a2014-03-19 14:02:12 -0700204 change_report: ItemizedChangeReport object for the changes to be
205 made to the package.
Aviv Keshete00caeb2013-04-17 14:03:25 -0700206 package_cp: A string similar to 'chromeos-base/autotest-tests' giving
207 the package category and name of the package to be altered.
208 portage_root: Portage root path, corresponding to the board that
209 we are working on. Defaults to '/'
210 """
211 package, vartree = GetPackageAPI(portage_root, package_cp)
212
Aviv Keshete7b20192013-04-24 14:05:53 -0700213 # Append new contents to package contents dictionary.
Aviv Keshet940c17f2013-04-11 18:41:42 -0700214 contents = package.getcontents().copy()
215 for _, filename in change_report.new_files:
216 contents.setdefault(filename, (u'obj', '0', '0'))
217 for _, dirname in change_report.new_directories:
Aviv Keshete7b20192013-04-24 14:05:53 -0700218 # Strip trailing slashes if present.
219 contents.setdefault(dirname.rstrip('/'), (u'dir',))
Aviv Keshet940c17f2013-04-11 18:41:42 -0700220
Aviv Keshete7b20192013-04-24 14:05:53 -0700221 # Write new contents dictionary to file.
Aviv Keshet940c17f2013-04-11 18:41:42 -0700222 vartree.dbapi.writeContentsToContentsFile(package, contents)
223
224
Aviv Keshet19276752013-05-16 11:12:23 -0700225def RemoveBzipPackages(autotest_sysroot):
226 """Remove all bzipped test/dep/profiler packages from sysroot autotest.
Aviv Keshet75d65962013-04-17 16:15:23 -0700227
Mike Frysinger02e1e072013-11-10 22:11:34 -0500228 Args:
Aviv Keshet75d65962013-04-17 16:15:23 -0700229 autotest_sysroot: Absolute path of autotest in the sysroot,
Aviv Keshet474469d2013-07-22 12:54:52 -0700230 e.g. '/build/lumpy/usr/local/build/autotest'
Aviv Keshet75d65962013-04-17 16:15:23 -0700231 """
Aviv Keshet19276752013-05-16 11:12:23 -0700232 osutils.RmDir(os.path.join(autotest_sysroot, 'packages'),
Mike Frysingere65f3752014-12-08 00:46:39 -0500233 ignore_missing=True)
Aviv Keshet19276752013-05-16 11:12:23 -0700234 osutils.SafeUnlink(os.path.join(autotest_sysroot, 'packages.checksum'))
Aviv Keshet75d65962013-04-17 16:15:23 -0700235
236
Aviv Keshetb1238c32013-04-01 11:42:13 -0700237def RsyncQuickmerge(source_path, sysroot_autotest_path,
238 include_pattern_file=None, pretend=False,
Aviv Keshet60968ec2013-04-11 18:44:14 -0700239 overwrite=False):
Aviv Keshetb1238c32013-04-01 11:42:13 -0700240 """Run rsync quickmerge command, with specified arguments.
Aviv Keshete7b20192013-04-24 14:05:53 -0700241
Aviv Keshetb1238c32013-04-01 11:42:13 -0700242 Command will take form `rsync -a [options] --exclude=**.pyc
243 --exclude=**.pyo
Don Garrett25f309a2014-03-19 14:02:12 -0700244 [optional --include-from include_pattern_file]
Aviv Keshetb1238c32013-04-01 11:42:13 -0700245 --exclude=* [source_path] [sysroot_autotest_path]`
246
Mike Frysinger02e1e072013-11-10 22:11:34 -0500247 Args:
Don Garrett25f309a2014-03-19 14:02:12 -0700248 source_path: Directory to rsync from.
249 sysroot_autotest_path: Directory to rsync too.
250 include_pattern_file: Optional pattern of files to include in rsync.
Mike Frysingerad8c6ca2014-02-03 11:28:45 -0500251 pretend: True to use the '-n' option to rsync, to perform dry run.
Aviv Keshetb1238c32013-04-01 11:42:13 -0700252 overwrite: True to omit '-u' option, overwrite all files in sysroot,
253 not just older files.
Aviv Keshet557e6882013-04-25 13:26:09 -0700254
255 Returns:
256 The cros_build_lib.CommandResult object resulting from the rsync command.
Aviv Keshetb1238c32013-04-01 11:42:13 -0700257 """
258 command = ['rsync', '-a']
259
Prathmesh Prabhu137266a2014-02-11 20:02:18 -0800260 # For existing files, preserve destination permissions. This ensures that
261 # existing files end up with the file permissions set by the ebuilds.
262 # If this script copies over a file that does not exist in the destination
263 # tree, it will set the least restrictive permissions allowed in the
264 # destination tree. This could happen if the file copied is not installed by
265 # *any* ebuild, or if the ebuild that installs the file was never emerged.
266 command += ['--no-p', '--chmod=ugo=rwX']
267
Aviv Keshetb1238c32013-04-01 11:42:13 -0700268 if pretend:
269 command += ['-n']
270
271 if not overwrite:
272 command += ['-u']
273
Aviv Keshet60968ec2013-04-11 18:44:14 -0700274 command += ['-i']
Aviv Keshetb1238c32013-04-01 11:42:13 -0700275
276 command += ['--exclude=**.pyc']
277 command += ['--exclude=**.pyo']
278
Aviv Keshet787ffcd2013-04-08 15:14:56 -0700279 # Exclude files with a specific substring in their name, because
280 # they create an ambiguous itemized report. (see unit test file for details)
281 command += ['--exclude=** -> *']
282
Aviv Keshetb1238c32013-04-01 11:42:13 -0700283 if include_pattern_file:
284 command += ['--include-from=%s' % include_pattern_file]
285
286 command += ['--exclude=*']
287
288 command += [source_path, sysroot_autotest_path]
289
Aviv Keshet60968ec2013-04-11 18:44:14 -0700290 return cros_build_lib.SudoRunCommand(command, redirect_stdout=True)
Aviv Keshetb1238c32013-04-01 11:42:13 -0700291
292
293def ParseArguments(argv):
294 """Parse command line arguments
295
Mike Frysinger02e1e072013-11-10 22:11:34 -0500296 Returns:
297 parsed arguments.
Aviv Keshetb1238c32013-04-01 11:42:13 -0700298 """
299 parser = argparse.ArgumentParser(description='Perform a fast approximation '
300 'to emerge-$board autotest-all, by '
301 'rsyncing source tree to sysroot.')
302
Aviv Keshet0a366a02013-07-18 10:52:04 -0700303 default_board = cros_build_lib.GetDefaultBoard()
304 parser.add_argument('--board', metavar='BOARD', default=default_board,
305 help='Board to perform quickmerge for. Default: ' +
306 (default_board or 'Not configured.'))
Aviv Keshetb1238c32013-04-01 11:42:13 -0700307 parser.add_argument('--pretend', action='store_true',
308 help='Dry run only, do not modify sysroot autotest.')
309 parser.add_argument('--overwrite', action='store_true',
310 help='Overwrite existing files even if newer.')
Aviv Keshetc73cfc32013-06-14 16:18:53 -0700311 parser.add_argument('--force', action='store_true',
Simran Basi8fc88992015-04-21 17:15:23 -0700312 help=argparse.SUPPRESS)
Aviv Keshete00caeb2013-04-17 14:03:25 -0700313 parser.add_argument('--verbose', action='store_true',
314 help='Print detailed change report.')
Aviv Keshetb1238c32013-04-01 11:42:13 -0700315
Aviv Keshet474469d2013-07-22 12:54:52 -0700316 # Used only if test_that is calling autotest_quickmerge and has detected that
317 # the sysroot autotest path is still in usr/local/autotest (ie the build
318 # pre-dates https://chromium-review.googlesource.com/#/c/62880/ )
319 parser.add_argument('--legacy_path', action='store_true',
320 help=argparse.SUPPRESS)
321
Aviv Keshetb1238c32013-04-01 11:42:13 -0700322 return parser.parse_args(argv)
323
324
325def main(argv):
326 cros_build_lib.AssertInsideChroot()
327
328 args = ParseArguments(argv)
329
Aviv Keshete7b20192013-04-24 14:05:53 -0700330 if os.geteuid() != 0:
Aviv Keshet940c17f2013-04-11 18:41:42 -0700331 try:
332 cros_build_lib.SudoRunCommand([sys.executable] + sys.argv)
333 except cros_build_lib.RunCommandError:
334 return 1
335 return 0
336
Aviv Keshetb1238c32013-04-01 11:42:13 -0700337 if not args.board:
Mike Frysinger383367e2014-09-16 15:06:17 -0400338 print('No board specified. Aborting.')
Aviv Keshetb1238c32013-04-01 11:42:13 -0700339 return 1
340
341 manifest = git.ManifestCheckout.Cached(constants.SOURCE_ROOT)
David Jamese3b06062013-11-09 18:52:02 -0800342 checkout = manifest.FindCheckout(AUTOTEST_PROJECT_NAME)
343 source_path = os.path.join(checkout.GetPath(absolute=True), '')
Aviv Keshetb1238c32013-04-01 11:42:13 -0700344
345 script_path = os.path.dirname(__file__)
346 include_pattern_file = os.path.join(script_path, INCLUDE_PATTERNS_FILENAME)
347
348 # TODO: Determine the following string programatically.
Aviv Keshet940c17f2013-04-11 18:41:42 -0700349 sysroot_path = os.path.join('/build', args.board, '')
Aviv Keshet474469d2013-07-22 12:54:52 -0700350 sysroot_autotest_path = os.path.join(sysroot_path,
351 constants.AUTOTEST_BUILD_PATH, '')
352 if args.legacy_path:
353 sysroot_autotest_path = os.path.join(sysroot_path, 'usr/local/autotest',
354 '')
Aviv Keshetb1238c32013-04-01 11:42:13 -0700355
Aviv Keshet60968ec2013-04-11 18:44:14 -0700356 rsync_output = RsyncQuickmerge(source_path, sysroot_autotest_path,
Aviv Keshete7b20192013-04-24 14:05:53 -0700357 include_pattern_file, args.pretend,
358 args.overwrite)
Aviv Keshetb1238c32013-04-01 11:42:13 -0700359
Aviv Keshete00caeb2013-04-17 14:03:25 -0700360 if args.verbose:
361 logging.info(rsync_output.output)
362
Aviv Keshet60968ec2013-04-11 18:44:14 -0700363 change_report = ItemizeChangesFromRsyncOutput(rsync_output.output,
364 sysroot_autotest_path)
365
Aviv Keshet940c17f2013-04-11 18:41:42 -0700366 if not args.pretend:
Aviv Keshetc73cfc32013-06-14 16:18:53 -0700367 logging.info('Updating portage database.')
Aviv Keshet5f3cf722013-05-09 17:35:25 -0700368 UpdatePackageContents(change_report, AUTOTEST_EBUILD,
Aviv Keshet940c17f2013-04-11 18:41:42 -0700369 sysroot_path)
Aviv Keshetfe54a8a2013-09-16 15:49:03 -0700370 for logfile in glob.glob(os.path.join(sysroot_autotest_path, 'packages',
371 '*.log')):
372 try:
373 # Open file in a try-except block, for atomicity, instead of
374 # doing existence check.
375 with open(logfile, 'r') as f:
376 package_cp = f.readline().strip()
377 DOWNGRADE_EBUILDS.append(package_cp)
378 except IOError:
379 pass
380
Aviv Keshet3cc4e9e2013-04-24 10:47:23 -0700381 for ebuild in DOWNGRADE_EBUILDS:
Aviv Keshet557e6882013-04-25 13:26:09 -0700382 if not DowngradePackageVersion(sysroot_path, ebuild):
Aviv Keshet3cc4e9e2013-04-24 10:47:23 -0700383 logging.warning('Unable to downgrade package %s version number.',
Aviv Keshete7b20192013-04-24 14:05:53 -0700384 ebuild)
Aviv Keshet19276752013-05-16 11:12:23 -0700385 RemoveBzipPackages(sysroot_autotest_path)
Aviv Keshetb1238c32013-04-01 11:42:13 -0700386
Aviv Keshetc73cfc32013-06-14 16:18:53 -0700387 sentinel_filename = os.path.join(sysroot_autotest_path,
388 '.quickmerge_sentinel')
389 cros_build_lib.RunCommand(['touch', sentinel_filename])
390
Aviv Keshet940c17f2013-04-11 18:41:42 -0700391 if args.pretend:
Aviv Keshete00caeb2013-04-17 14:03:25 -0700392 logging.info('The following message is pretend only. No filesystem '
Aviv Keshete7b20192013-04-24 14:05:53 -0700393 'changes made.')
Aviv Keshete00caeb2013-04-17 14:03:25 -0700394 logging.info('Quickmerge complete. Created or modified %s files.',
Aviv Keshete7b20192013-04-24 14:05:53 -0700395 len(change_report.new_files) +
396 len(change_report.modified_files))
Aviv Keshete00caeb2013-04-17 14:03:25 -0700397
398 return 0