(self)
| 413 | |
| 414 | def autoconfigure(execute_method): |
| 415 | def execute(self): |
| 416 | if not Configure.autoconfig: |
| 417 | return execute_method(self) |
| 418 | env = ConfigSet.ConfigSet() |
| 419 | do_config = False |
| 420 | try: |
| 421 | env.load(os.path.join(Context.top_dir, Options.lockfile)) |
| 422 | except EnvironmentError: |
| 423 | Logs.warn('Configuring the project') |
| 424 | do_config = True |
| 425 | else: |
| 426 | if env.run_dir != Context.run_dir: |
| 427 | do_config = True |
| 428 | else: |
| 429 | h = 0 |
| 430 | for f in env.files: |
| 431 | try: |
| 432 | h = Utils.h_list((h, Utils.readf(f, 'rb'))) |
| 433 | except EnvironmentError: |
| 434 | do_config = True |
| 435 | break |
| 436 | else: |
| 437 | do_config = h != env.hash |
| 438 | if do_config: |
| 439 | cmd = env.config_cmd or 'configure' |
| 440 | if Configure.autoconfig == 'clobber': |
| 441 | tmp = Options.options.__dict__ |
| 442 | launch_dir_tmp = Context.launch_dir |
| 443 | if env.options: |
| 444 | Options.options.__dict__ = env.options |
| 445 | Context.launch_dir = env.launch_dir |
| 446 | try: |
| 447 | run_command(cmd) |
| 448 | finally: |
| 449 | Options.options.__dict__ = tmp |
| 450 | Context.launch_dir = launch_dir_tmp |
| 451 | else: |
| 452 | run_command(cmd) |
| 453 | run_command(self.cmd) |
| 454 | else: |
| 455 | return execute_method(self) |
| 456 | |
| 457 | return execute |
| 458 |
nothing calls this directly
no test coverage detected
searching dependent graphs…