OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """This module uprevs a given package's ebuild to the next revision.""" | 7 """This module uprevs a given package's ebuild to the next revision.""" |
8 | 8 |
9 | 9 |
10 import fileinput | 10 import fileinput |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 project, subdir = _SimpleRunCommand(cmd).split() | 354 project, subdir = _SimpleRunCommand(cmd).split() |
355 | 355 |
356 # Calculate srcdir. | 356 # Calculate srcdir. |
357 srcroot = gflags.FLAGS.srcroot | 357 srcroot = gflags.FLAGS.srcroot |
358 if self.category == 'chromeos-base': | 358 if self.category == 'chromeos-base': |
359 dir = 'platform' | 359 dir = 'platform' |
360 else: | 360 else: |
361 dir = 'third_party' | 361 dir = 'third_party' |
362 srcdir = os.path.join(srcroot, dir, subdir) | 362 srcdir = os.path.join(srcroot, dir, subdir) |
363 | 363 |
364 # TODO(anush): This hack is only necessary because the kernel ebuild has | |
365 # 'if' statements, so we can't grab the CROS_WORKON_LOCALNAME properly. | |
366 # We should clean up the kernel ebuild and remove this hack. | |
367 if not os.path.isdir(srcdir) and subdir == 'kernel/': | |
368 srcdir = os.path.join(srcroot, 'third_party/kernel/files') | |
369 | |
370 if not os.path.isdir(srcdir): | 364 if not os.path.isdir(srcdir): |
371 Die('Cannot find commit id for %s' % self.ebuild_path) | 365 Die('Cannot find commit id for %s' % self.ebuild_path) |
372 | 366 |
373 # Verify that we're grabbing the commit id from the right project name. | 367 # Verify that we're grabbing the commit id from the right project name. |
374 # NOTE: chromeos-kernel has the wrong project name, so it fails this | 368 # NOTE: chromeos-kernel has the wrong project name, so it fails this |
375 # check. | 369 # check. |
376 # TODO(davidjames): Fix the project name in the chromeos-kernel ebuild. | 370 # TODO(davidjames): Fix the project name in the chromeos-kernel ebuild. |
377 cmd = 'cd %s && git config --get remote.cros.projectname' % srcdir | 371 cmd = 'cd %s && git config --get remote.cros.projectname' % srcdir |
378 actual_project = _SimpleRunCommand(cmd).rstrip() | 372 actual_project = _SimpleRunCommand(cmd).rstrip() |
379 if project not in (actual_project, 'chromeos-kernel'): | 373 if project not in (actual_project, 'chromeos-kernel'): |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 if gflags.FLAGS.drop_file: | 575 if gflags.FLAGS.drop_file: |
582 fh = open(gflags.FLAGS.drop_file, 'w') | 576 fh = open(gflags.FLAGS.drop_file, 'w') |
583 fh.write(' '.join(revved_packages)) | 577 fh.write(' '.join(revved_packages)) |
584 fh.close() | 578 fh.close() |
585 else: | 579 else: |
586 work_branch.Delete() | 580 work_branch.Delete() |
587 | 581 |
588 | 582 |
589 if __name__ == '__main__': | 583 if __name__ == '__main__': |
590 main(sys.argv) | 584 main(sys.argv) |
OLD | NEW |