| OLD | NEW |
| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 # match dot files, also glob('.*'). | 98 # match dot files, also glob('.*'). |
| 99 dest_nodes += env.Replicate( | 99 dest_nodes += env.Replicate( |
| 100 target_name, [s.abspath + '/*', s.abspath + '/.*'], | 100 target_name, [s.abspath + '/*', s.abspath + '/.*'], |
| 101 REPLICATE_REPLACE=replace_list) | 101 REPLICATE_REPLACE=replace_list) |
| 102 else: | 102 else: |
| 103 # Apply replacement strings, if any | 103 # Apply replacement strings, if any |
| 104 for r in replace_list: | 104 for r in replace_list: |
| 105 target_name = re.sub(r[0], r[1], target_name) | 105 target_name = re.sub(r[0], r[1], target_name) |
| 106 target = env.File(target_name) | 106 target = env.File(target_name) |
| 107 if (target.has_builder() | 107 if (target.has_builder() |
| 108 and hasattr(target.get_builder(), 'name') |
| 108 and target.get_builder().name == 'InstallBuilder' | 109 and target.get_builder().name == 'InstallBuilder' |
| 109 and target.sources == [s]): | 110 and target.sources == [s]): |
| 110 # Already installed that file, so pass through the destination node | 111 # Already installed that file, so pass through the destination node |
| 112 # TODO(rspangler): Is there a better way to determine if this is a |
| 113 # duplicate install? |
| 111 dest_nodes += [target] | 114 dest_nodes += [target] |
| 112 else: | 115 else: |
| 113 dest_nodes += env.InstallAs(target_name, s) | 116 dest_nodes += env.InstallAs(target_name, s) |
| 114 | 117 |
| 115 # Return list of destination nodes | 118 # Return list of destination nodes |
| 116 return dest_nodes | 119 return dest_nodes |
| 117 | 120 |
| 118 | 121 |
| 119 def generate(env): | 122 def generate(env): |
| 120 # NOTE: SCons requires the use of this name, which fails gpylint. | 123 # NOTE: SCons requires the use of this name, which fails gpylint. |
| 121 """SCons entry point for this tool.""" | 124 """SCons entry point for this tool.""" |
| 122 | 125 |
| 123 env.AddMethod(Replicate) | 126 env.AddMethod(Replicate) |
| OLD | NEW |