Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: client/utils/file_path.py

Issue 2037253002: run_isolated.py: install CIPD packages (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@master
Patch Set: fix client fetching Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « client/tests/swarming_test.py ('k') | client/utils/subprocess42.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The LUCI Authors. All rights reserved. 1 # Copyright 2013 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """Provides functions: get_native_path_case(), isabs() and safe_join(). 5 """Provides functions: get_native_path_case(), isabs() and safe_join().
6 6
7 This module assumes that filesystem is not changing while current process 7 This module assumes that filesystem is not changing while current process
8 is running and thus it caches results of functions that depend on FS state. 8 is running and thus it caches results of functions that depend on FS state.
9 """ 9 """
10 10
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 set_read_only(os.path.dirname(filepath), False) 739 set_read_only(os.path.dirname(filepath), False)
740 fs.remove(filepath) 740 fs.remove(filepath)
741 except OSError: 741 except OSError:
742 pass 742 pass
743 743
744 744
745 def link_file(outfile, infile, action): 745 def link_file(outfile, infile, action):
746 """Links a file. The type of link depends on |action|. 746 """Links a file. The type of link depends on |action|.
747 747
748 Returns: 748 Returns:
749 True if the action was caried on, False if fallback was used. 749 True if the action was carried on, False if fallback was used.
750 """ 750 """
751 if action not in (HARDLINK, HARDLINK_WITH_FALLBACK, SYMLINK, COPY): 751 if action not in (HARDLINK, HARDLINK_WITH_FALLBACK, SYMLINK, COPY):
752 raise ValueError('Unknown mapping action %s' % action) 752 raise ValueError('Unknown mapping action %s' % action)
753 if not fs.isfile(infile): 753 if not fs.isfile(infile):
754 raise OSError('%s is missing' % infile) 754 raise OSError('%s is missing' % infile)
755 if fs.isfile(outfile): 755 if fs.isfile(outfile):
756 raise OSError( 756 raise OSError(
757 '%s already exist; insize:%d; outsize:%d' % 757 '%s already exist; insize:%d; outsize:%d' %
758 (outfile, fs.stat(infile).st_size, fs.stat(outfile).st_size)) 758 (outfile, fs.stat(infile).st_size, fs.stat(outfile).st_size))
759 759
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 errors = [] 1025 errors = []
1026 fs.rmtree(root, onerror=lambda *args: errors.append(args)) 1026 fs.rmtree(root, onerror=lambda *args: errors.append(args))
1027 if errors: 1027 if errors:
1028 # There's no hope. 1028 # There's no hope.
1029 sys.stderr.write( 1029 sys.stderr.write(
1030 'Failed to delete %s. The following files remain:\n' % root) 1030 'Failed to delete %s. The following files remain:\n' % root)
1031 for _, path, _ in errors: 1031 for _, path, _ in errors:
1032 sys.stderr.write('- %s\n' % path) 1032 sys.stderr.write('- %s\n' % path)
1033 raise errors[0][2][0], errors[0][2][1], errors[0][2][2] 1033 raise errors[0][2][0], errors[0][2][1], errors[0][2][2]
1034 return False 1034 return False
OLDNEW
« no previous file with comments | « client/tests/swarming_test.py ('k') | client/utils/subprocess42.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698