aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoragronholm <none@none>2009-10-20 01:37:01 +0300
committeragronholm <none@none>2009-10-20 01:37:01 +0300
commite6e0e5add9321df50c5da9ee2f1650740024c8ed (patch)
tree43b3edb487a977df31cc2236469960ed277ee60d
parent748696a763c3b57aff3b4f39c4461c5a6b7ef4ee (diff)
downloadexternal_python_setuptools-e6e0e5add9321df50c5da9ee2f1650740024c8ed.tar.gz
external_python_setuptools-e6e0e5add9321df50c5da9ee2f1650740024c8ed.tar.bz2
external_python_setuptools-e6e0e5add9321df50c5da9ee2f1650740024c8ed.zip
Reversing patch for 64-bit Windows script launcher, applied PJE's simpler solution instead
--HG-- branch : distribute extra : rebase_source : 320927dbc962a262853cae7d8b3734794bb9f21d
-rwxr-xr-xlauncher.c25
-rwxr-xr-xsetup.py30
-rw-r--r--setuptools/cli-32.exebin65536 -> 0 bytes
-rw-r--r--setuptools/cli-64.exebin74240 -> 0 bytes
-rw-r--r--setuptools/cli.exebin0 -> 7168 bytes
-rwxr-xr-xsetuptools/command/easy_install.py5
-rw-r--r--setuptools/gui-32.exebin65536 -> 0 bytes
-rw-r--r--setuptools/gui-64.exebin74240 -> 0 bytes
-rw-r--r--setuptools/gui.exebin0 -> 7168 bytes
9 files changed, 11 insertions, 49 deletions
diff --git a/launcher.c b/launcher.c
index 0dca2e16..201219cc 100755
--- a/launcher.c
+++ b/launcher.c
@@ -25,9 +25,8 @@
#include <stdlib.h>
#include <stdio.h>
-#include <process.h>
+#include <unistd.h>
#include <fcntl.h>
-#include "tchar.h"
#include "windows.h"
int fail(char *format, char *data) {
@@ -82,17 +81,18 @@ char *quoted(char *data) {
char *loadable_exe(char *exename) {
- HINSTANCE hPython; /* DLL handle for python executable */
+ /* HINSTANCE hPython; DLL handle for python executable */
char *result;
- hPython = LoadLibraryEx(exename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
- if (!hPython) return NULL;
+ /* hPython = LoadLibraryEx(exename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ if (!hPython) return NULL; */
/* Return the absolute filename for spawnv */
result = calloc(MAX_PATH, sizeof(char));
- if (result) GetModuleFileName(hPython, result, MAX_PATH);
+ strncpy(result, exename, MAX_PATH);
+ /*if (result) GetModuleFileName(hPython, result, MAX_PATH);
- FreeLibrary(hPython);
+ FreeLibrary(hPython); */
return result;
}
@@ -237,18 +237,11 @@ int run(int argc, char **argv, int is_gui) {
}
/* We *do* need to wait for a CLI to finish, so use spawn */
- return _spawnv(_P_WAIT, ptr, (const char * const *)(newargs));
+ return spawnv(P_WAIT, ptr, (const char * const *)(newargs));
}
-/*
+
int WINAPI WinMain(HINSTANCE hI, HINSTANCE hP, LPSTR lpCmd, int nShow) {
return run(__argc, __argv, GUI);
}
-*/
-
-int _tmain(int argc, _TCHAR* argv[])
-{
- return run(argc, argv, GUI);
-}
-
diff --git a/setup.py b/setup.py
index da59d365..8065235a 100755
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,6 @@
"""Distutils setup file, used to install or test 'setuptools'"""
import sys
import os
-import platform
src_root = None
if sys.version_info >= (3,):
@@ -40,36 +39,8 @@ SETUP_COMMANDS = d['__all__']
VERSION = "0.6.6"
from setuptools import setup, find_packages
-from setuptools.command.build_py import build_py as _build_py
scripts = []
-# specific command that is used to generate windows .exe files
-class build_py(_build_py):
- def build_package_data(self):
- """Copy data files into build directory"""
- lastdir = None
- is_64 = platform.architecture()[0] == '64bit'
-
- for package, src_dir, build_dir, filenames in self.data_files:
- for filename in filenames:
- target = os.path.join(build_dir, filename)
- self.mkpath(os.path.dirname(target))
- srcfile = os.path.join(src_dir, filename)
- outf, copied = self.copy_file(srcfile, target)
-
- # creating cli.exe and gui.exe
- if filename in ('gui-32.exe', 'cli-32.exe') and not is_64:
- exe_target = os.path.join(build_dir, filename.replace('-32.exe', '.exe'))
- self.copy_file(srcfile, exe_target)
-
- if filename in ('gui-64.exe', 'cli-64.exe') and is_64:
- exe_target = os.path.join(build_dir, filename.replace('-64.exe', '.exe'))
- self.copy_file(srcfile, exe_target)
-
- srcfile = os.path.abspath(srcfile)
- if copied and srcfile in self.distribution.convert_2to3_doctests:
- self.__doctests_2to3.append(outf)
-
# if we are installing Distribute using "python setup.py install"
# we need to get setuptools out of the way
def _easy_install_marker():
@@ -176,7 +147,6 @@ dist = setup(
Topic :: System :: Systems Administration
Topic :: Utilities""".splitlines() if f.strip()],
scripts = scripts,
- cmdclass = {'build_py': build_py}
)
if _being_installed():
diff --git a/setuptools/cli-32.exe b/setuptools/cli-32.exe
deleted file mode 100644
index dd63bbfc..00000000
--- a/setuptools/cli-32.exe
+++ /dev/null
Binary files differ
diff --git a/setuptools/cli-64.exe b/setuptools/cli-64.exe
deleted file mode 100644
index cc7ced50..00000000
--- a/setuptools/cli-64.exe
+++ /dev/null
Binary files differ
diff --git a/setuptools/cli.exe b/setuptools/cli.exe
new file mode 100644
index 00000000..8906ff77
--- /dev/null
+++ b/setuptools/cli.exe
Binary files differ
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 4b03e185..195139c7 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1603,14 +1603,13 @@ def get_script_args(dist, executable=sys_executable, wininst=False):
")\n"
) % locals()
if sys.platform=='win32' or wininst:
- word_size = [32, 64]['amd64' in sys.version.lower()]
# On Windows/wininst, add a .py extension and an .exe launcher
if group=='gui_scripts':
- ext, launcher = '-script.pyw', 'gui-%d.exe' % word_size
+ ext, launcher = '-script.pyw', 'gui.exe'
old = ['.pyw']
new_header = re.sub('(?i)python.exe','pythonw.exe',header)
else:
- ext, launcher = '-script.py', 'cli-%d.exe' % word_size
+ ext, launcher = '-script.py', 'cli.exe'
old = ['.py','.pyc','.pyo']
new_header = re.sub('(?i)pythonw.exe','python.exe',header)
diff --git a/setuptools/gui-32.exe b/setuptools/gui-32.exe
deleted file mode 100644
index 71838207..00000000
--- a/setuptools/gui-32.exe
+++ /dev/null
Binary files differ
diff --git a/setuptools/gui-64.exe b/setuptools/gui-64.exe
deleted file mode 100644
index 7fbfb889..00000000
--- a/setuptools/gui-64.exe
+++ /dev/null
Binary files differ
diff --git a/setuptools/gui.exe b/setuptools/gui.exe
new file mode 100644
index 00000000..474838d5
--- /dev/null
+++ b/setuptools/gui.exe
Binary files differ