360 # because of a distutils convert_path() fast-path. Avoid it at |
360 # because of a distutils convert_path() fast-path. Avoid it at |
361 # least on Windows for now, deal with .pydistutils.cfg bugs |
361 # least on Windows for now, deal with .pydistutils.cfg bugs |
362 # when they happen. |
362 # when they happen. |
363 nohome = '' |
363 nohome = '' |
364 cmd = ('%s setup.py %s clean --all' |
364 cmd = ('%s setup.py %s clean --all' |
|
365 ' build --build-base="%s"' |
365 ' install --force --prefix="%s" --install-lib="%s"' |
366 ' install --force --prefix="%s" --install-lib="%s"' |
366 ' --install-scripts="%s" %s >%s 2>&1' |
367 ' --install-scripts="%s" %s >%s 2>&1' |
367 % (sys.executable, pure, INST, PYTHONDIR, BINDIR, nohome, |
368 % (sys.executable, pure, os.path.join(HGTMP, "build"), |
368 installerrs)) |
369 INST, PYTHONDIR, BINDIR, nohome, installerrs)) |
369 vlog("# Running", cmd) |
370 vlog("# Running", cmd) |
370 if os.system(cmd) == 0: |
371 if os.system(cmd) == 0: |
371 if not options.verbose: |
372 if not options.verbose: |
372 os.remove(installerrs) |
373 os.remove(installerrs) |
373 else: |
374 else: |
484 expected.setdefault(pos, []).append(l[2:]) |
485 expected.setdefault(pos, []).append(l[2:]) |
485 else: |
486 else: |
486 # non-command/result - queue up for merged output |
487 # non-command/result - queue up for merged output |
487 after.setdefault(pos, []).append(l) |
488 after.setdefault(pos, []).append(l) |
488 |
489 |
|
490 if script and not script[-1].endswith('\n'): |
|
491 script[-1] = script[-1] + '\n' |
489 script.append('echo %s %s $?\n' % (salt, n + 1)) |
492 script.append('echo %s %s $?\n' % (salt, n + 1)) |
490 |
493 |
491 fd, name = tempfile.mkstemp(suffix='hg-tst') |
494 fd, name = tempfile.mkstemp(suffix='hg-tst') |
492 |
495 |
493 try: |
496 try: |
496 os.close(fd) |
499 os.close(fd) |
497 |
500 |
498 cmd = '/bin/sh "%s"' % name |
501 cmd = '/bin/sh "%s"' % name |
499 vlog("# Running", cmd) |
502 vlog("# Running", cmd) |
500 exitcode, output = run(cmd, options) |
503 exitcode, output = run(cmd, options) |
|
504 # do not merge output if skipped, return hghave message instead |
|
505 if exitcode == SKIPPED_STATUS: |
|
506 return exitcode, output |
501 finally: |
507 finally: |
502 os.remove(name) |
508 os.remove(name) |
503 |
509 |
504 def rematch(el, l): |
510 def rematch(el, l): |
505 try: |
511 try: |