equal
deleted
inserted
replaced
1108 class hginstallcompletion(Command): |
1108 class hginstallcompletion(Command): |
1109 description = 'Install shell completion' |
1109 description = 'Install shell completion' |
1110 |
1110 |
1111 def initialize_options(self): |
1111 def initialize_options(self): |
1112 self.install_dir = None |
1112 self.install_dir = None |
|
1113 self.outputs = [] |
1113 |
1114 |
1114 def finalize_options(self): |
1115 def finalize_options(self): |
1115 self.set_undefined_options( |
1116 self.set_undefined_options( |
1116 'install_data', ('install_dir', 'install_dir') |
1117 'install_data', ('install_dir', 'install_dir') |
1117 ) |
1118 ) |
|
1119 |
|
1120 def get_outputs(self): |
|
1121 return self.outputs |
1118 |
1122 |
1119 def run(self): |
1123 def run(self): |
1120 for src, dir_path, dest in ( |
1124 for src, dir_path, dest in ( |
1121 ( |
1125 ( |
1122 'bash_completion', |
1126 'bash_completion', |
1125 ), |
1129 ), |
1126 ('zsh_completion', ('share', 'zsh', 'site-functions'), '_hg'), |
1130 ('zsh_completion', ('share', 'zsh', 'site-functions'), '_hg'), |
1127 ): |
1131 ): |
1128 dir = os.path.join(self.install_dir, *dir_path) |
1132 dir = os.path.join(self.install_dir, *dir_path) |
1129 self.mkpath(dir) |
1133 self.mkpath(dir) |
1130 self.copy_file( |
1134 |
1131 os.path.join('contrib', src), os.path.join(dir, dest) |
1135 dest = os.path.join(dir, dest) |
1132 ) |
1136 self.outputs.append(dest) |
|
1137 self.copy_file(os.path.join('contrib', src), dest) |
1133 |
1138 |
1134 |
1139 |
1135 # virtualenv installs custom distutils/__init__.py and |
1140 # virtualenv installs custom distutils/__init__.py and |
1136 # distutils/distutils.cfg files which essentially proxy back to the |
1141 # distutils/distutils.cfg files which essentially proxy back to the |
1137 # "real" distutils in the main Python install. The presence of this |
1142 # "real" distutils in the main Python install. The presence of this |