Commit 8e4311ca authored by Adam Groszer's avatar Adam Groszer

probably fixed dev.py on windows

parent 777d4bab
...@@ -106,6 +106,7 @@ if subprocess.call( ...@@ -106,6 +106,7 @@ if subprocess.call(
pkg_resources.working_set.add_entry('src') pkg_resources.working_set.add_entry('src')
import zc.buildout.easy_install import zc.buildout.easy_install
#from dbgp.client import brk; brk('127.0.0.1')
zc.buildout.easy_install.scripts( zc.buildout.easy_install.scripts(
['zc.buildout'], pkg_resources.working_set , sys.executable, 'bin') ['zc.buildout'], pkg_resources.working_set , sys.executable, 'bin')
......
...@@ -1059,19 +1059,21 @@ def _distutils_script(path, dest, script_content, initialization, rsetup): ...@@ -1059,19 +1059,21 @@ def _distutils_script(path, dest, script_content, initialization, rsetup):
def _create_script(contents, dest): def _create_script(contents, dest):
generated = [] generated = []
script = dest script = dest
if is_win32:
dest += '-script.py'
changed = not (os.path.exists(dest) and open(dest).read() == contents) changed = not (os.path.exists(dest) and open(dest).read() == contents)
if is_win32: if is_win32:
# generate exe file and give the script a magic name: # generate exe file and give the script a magic name:
exe = script+'.exe' #from dbgp.client import brk; brk('127.0.0.1')
new_data = pkg_resources.resource_string('distribute', 'cli.exe') win32_exe = os.path.splitext(dest)[0]
if not os.path.exists(exe) or (open(exe, 'rb').read() != new_data): if win32_exe.endswith('-script'):
win32_exe = win32_exe[:-7]
win32_exe = win32_exe + '.exe'
new_data = pkg_resources.resource_string('setuptools', 'cli.exe')
if not os.path.exists(win32_exe) or (open(win32_exe, 'rb').read() != new_data):
# Only write it if it's different. # Only write it if it's different.
open(exe, 'wb').write(new_data) open(win32_exe, 'wb').write(new_data)
generated.append(exe) generated.append(win32_exe)
if changed: if changed:
open(dest, 'w').write(contents) open(dest, 'w').write(contents)
...@@ -1139,7 +1141,7 @@ def _pyscript(path, dest, rsetup): ...@@ -1139,7 +1141,7 @@ def _pyscript(path, dest, rsetup):
# generate exe file and give the script a magic name: # generate exe file and give the script a magic name:
exe = script + '.exe' exe = script + '.exe'
open(exe, 'wb').write( open(exe, 'wb').write(
pkg_resources.resource_string('distribute', 'cli.exe') pkg_resources.resource_string('setuptools', 'cli.exe')
) )
generated.append(exe) generated.append(exe)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment