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

Side by Side Diff: site_scons/site_tools/windows_hard_link.py

Issue 13134: Pulling in hammer changes. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years 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 | Annotate | Revision Log
« no previous file with comments | « site_scons/site_tools/target_platform_windows.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python2.4 1 #!/usr/bin/python2.4
2 # Copyright 2008, Google Inc. 2 # Copyright 2008, Google Inc.
3 # All rights reserved. 3 # All rights reserved.
4 # 4 #
5 # Redistribution and use in source and binary forms, with or without 5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are 6 # modification, are permitted provided that the following conditions are
7 # met: 7 # met:
8 # 8 #
9 # * Redistributions of source code must retain the above copyright 9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer. 10 # notice, this list of conditions and the following disclaimer.
(...skipping 22 matching lines...) Expand all
33 This module is a SCons tool which should be include in the topmost windows 33 This module is a SCons tool which should be include in the topmost windows
34 environment. It is usually included by the target_platform_windows tool. 34 environment. It is usually included by the target_platform_windows tool.
35 """ 35 """
36 36
37 37
38 import os 38 import os
39 import stat 39 import stat
40 import sys 40 import sys
41 import SCons 41 import SCons
42 42
43 if sys.platform in ('win32', 'cygwin'): 43 if sys.platform == 'win32':
44 # Only attempt to load pywin32 on Windows systems 44 # Only attempt to load pywin32 on Windows systems
45 try: 45 try:
46 import win32file 46 import win32file
47 except ImportError: 47 except ImportError:
48 print ('Warning: Unable to load win32file module; using copy instead of' 48 print ('Warning: Unable to load win32file module; using copy instead of'
49 ' hard linking for env.Install(). Is pywin32 present?') 49 ' hard linking for env.Install(). Is pywin32 present?')
50 50
51 #------------------------------------------------------------------------------ 51 #------------------------------------------------------------------------------
52 # Python 2.4 and 2.5's os module doesn't support os.link on Windows, even 52 # Python 2.4 and 2.5's os module doesn't support os.link on Windows, even
53 # though Windows does have hard-link capability on NTFS filesystems. So by 53 # though Windows does have hard-link capability on NTFS filesystems. So by
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 100
101 def generate(env): 101 def generate(env):
102 # NOTE: SCons requires the use of this name, which fails gpylint. 102 # NOTE: SCons requires the use of this name, which fails gpylint.
103 """SCons entry point for this tool.""" 103 """SCons entry point for this tool."""
104 env = env # Silence gpylint 104 env = env # Silence gpylint
105 105
106 # Patch in our hard link function, if we were able to load pywin32 106 # Patch in our hard link function, if we were able to load pywin32
107 if 'win32file' in globals(): 107 if 'win32file' in globals():
108 SCons.Node.FS._hardlink_func = _HardLink 108 SCons.Node.FS._hardlink_func = _HardLink
OLDNEW
« no previous file with comments | « site_scons/site_tools/target_platform_windows.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698