summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-10-20 20:44:32 +0200
committerStephan Bergmann <sbergman@redhat.com>2011-10-20 23:04:12 +0200
commitfecde94354a46463d346a1a78962f39a5a6f9eb8 (patch)
treed4b264e4460e5cda8ee6c144bed952bfc560c258
parentcf33eb5fb423bcf67d7cc335e2d8ec8066702648 (diff)
Undo basis/brand split: moved Python from basis to brand.
The Windows-only code in pyuno/zipcore/python.cxx may still need fixing.
-rw-r--r--pyuno/source/loader/makefile.mk4
-rw-r--r--pyuno/source/loader/pyuno_loader.cxx2
-rw-r--r--pyuno/zipcore/python.cxx70
-rw-r--r--pyuno/zipcore/python.sh12
-rw-r--r--scp2/source/python/file_python.scp33
-rw-r--r--scp2/source/python/module_python.scp2
-rw-r--r--scp2/source/python/module_python_mailmerge.scp4
-rw-r--r--scp2/source/python/profileitem_python.scp2
8 files changed, 54 insertions, 75 deletions
diff --git a/pyuno/source/loader/makefile.mk b/pyuno/source/loader/makefile.mk
index 3f7a33ced13d..15c58d66aa40 100644
--- a/pyuno/source/loader/makefile.mk
+++ b/pyuno/source/loader/makefile.mk
@@ -90,5 +90,5 @@ ALLTAR : $(MISC)/pythonloader.component
$(MISC)/pythonloader.component .ERRREMOVE : \
$(SOLARENV)/bin/createcomponent.xslt pythonloader.component
$(XSLTPROC) --nonet --stringparam uri \
- 'vnd.sun.star.expand:$$OOO_BASE_DIR/program/$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt pythonloader.component
+ 'vnd.sun.star.expand:$$BRAND_BASE_DIR/program/$(SHL1TARGETN:f)' \
+ -o $@ $(SOLARENV)/bin/createcomponent.xslt pythonloader.component
diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx
index f1dcf06218ef..9e93e1961c3f 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -181,7 +181,7 @@ Reference< XInterface > CreateInstance( const Reference< XComponentContext > & c
{
OUString pythonPath;
OUString pythonHome;
- OUString path( RTL_CONSTASCII_USTRINGPARAM( "$OOO_BASE_DIR/program/" SAL_CONFIGFILE("pythonloader.uno" )));
+ OUString path( RTL_CONSTASCII_USTRINGPARAM( "$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("pythonloader.uno" )));
rtl::Bootstrap::expandMacros(path); //TODO: detect failure
rtl::Bootstrap bootstrap(path);
diff --git a/pyuno/zipcore/python.cxx b/pyuno/zipcore/python.cxx
index 68991de1ff26..775a0b738f58 100644
--- a/pyuno/zipcore/python.cxx
+++ b/pyuno/zipcore/python.cxx
@@ -103,31 +103,20 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
wchar_t * bootstrapEnd = tools::buildPath(
bootstrap + MY_LENGTH(L"vnd.sun.star.pathname:"), path, pathEnd,
MY_STRING(L"fundamental.ini"));
- if (bootstrapEnd == NULL ||
- (tools::buildPath(path, path, pathEnd, MY_STRING(L"..\\basis-link"))
- == NULL))
- {
- exit(EXIT_FAILURE);
- }
- pathEnd = tools::resolveLink(path);
- wchar_t path1[MAX_PATH];
- wchar_t * path1End = tools::buildPath(
- path1, path, pathEnd, MY_STRING(L"\\program"));
- if (path1End == NULL) {
+ if (bootstrapEnd == NULL) {
exit(EXIT_FAILURE);
}
wchar_t pythonpath2[MAX_PATH];
wchar_t * pythonpath2End = tools::buildPath(
pythonpath2, path, pathEnd,
- MY_STRING(L"\\program\\python-core-" MY_PYVERSION L"\\lib"));
+ MY_STRING(L"\\python-core-" MY_PYVERSION L"\\lib"));
if (pythonpath2End == NULL) {
exit(EXIT_FAILURE);
}
wchar_t pythonpath3[MAX_PATH];
wchar_t * pythonpath3End = tools::buildPath(
pythonpath3, path, pathEnd,
- MY_STRING(
- L"\\program\\python-core-" MY_PYVERSION L"\\lib\\site-packages"));
+ MY_STRING(L"\\python-core-" MY_PYVERSION L"\\lib\\site-packages"));
if (pythonpath3End == NULL) {
exit(EXIT_FAILURE);
}
@@ -135,22 +124,14 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
wchar_t pythonpath4[MAX_PATH];
wchar_t * pythonpath4End = tools::buildPath(
pythonpath4, path, pathEnd,
- MY_STRING(L"\\program\\python-core-" MY_PYVERSION L"\\lib\\lib-dynload"));
+ MY_STRING(L"\\python-core-" MY_PYVERSION L"\\lib\\lib-dynload"));
if (pythonpath4End == NULL) {
exit(EXIT_FAILURE);
}
- wchar_t pythonpath5[MAX_PATH];
- wchar_t * pythonpath5End = tools::buildPath(
- pythonpath5, path, pathEnd,
- MY_STRING(L"\\program\\python-core-" MY_PYVERSION L"\\lib\\lib-dynload"));
- if (pythonpath5End == NULL) {
- exit(EXIT_FAILURE);
- }
#endif
wchar_t pythonhome[MAX_PATH];
wchar_t * pythonhomeEnd = tools::buildPath(
- pythonhome, path, pathEnd,
- MY_STRING(L"\\program\\python-core-" MY_PYVERSION));
+ pythonhome, path, pathEnd, MY_STRING(L"\\python-core-" MY_PYVERSION));
if (pythonhomeEnd == NULL) {
exit(EXIT_FAILURE);
}
@@ -158,25 +139,34 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
wchar_t * pythonexeEnd = tools::buildPath(
pythonexe, path, pathEnd,
#ifdef __MINGW32__
- MY_STRING(
- L"\\program\\python-core-" MY_PYVERSION L"\\bin\\python.bin"));
+ MY_STRING(L"\\python-core-" MY_PYVERSION L"\\bin\\python.bin"));
#else
- MY_STRING(
- L"\\program\\python-core-" MY_PYVERSION L"\\bin\\python.exe"));
+ MY_STRING(L"\\python-core-" MY_PYVERSION L"\\bin\\python.exe"));
#endif
if (pythonexeEnd == NULL) {
exit(EXIT_FAILURE);
}
- if (tools::buildPath(path, path, pathEnd, MY_STRING(L"\\ure-link")) == NULL)
+ wchar_t urepath[MAX_PATH];
+ if (tools::buildPath(urepath, path, pathEnd, MY_STRING(L"..\\basis-link"))
+ == NULL)
+ {
+ exit(EXIT_FAILURE);
+ }
+ wchar_t * urepathEnd = urepathEnd = tools::resolveLink(urepath);
+ if (urepathEnd == NULL ||
+ (tools::buildPath(
+ urepath, urepath, urepathEnd, MY_STRING(L"\\ure-link"))
+ == NULL))
{
exit(EXIT_FAILURE);
}
- pathEnd = tools::resolveLink(path);
- if (pathEnd == NULL) {
+ urepathEnd = tools::resolveLink(urepath);
+ if (urepathEnd == NULL) {
exit(EXIT_FAILURE);
}
- pathEnd = tools::buildPath(path, path, pathEnd, MY_STRING(L"\\bin"));
- if (pathEnd == NULL) {
+ urepathEnd = tools::buildPath(
+ urepath, urepath, urepathEnd, MY_STRING(L"\\bin"));
+ if (urepathEnd == NULL) {
exit(EXIT_FAILURE);
}
std::size_t clSize = MY_LENGTH(L"\"") + 4 * (pythonexeEnd - pythonexe) +
@@ -226,9 +216,9 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
}
}
wchar_t * value = new wchar_t[
- (pathEnd - path) + MY_LENGTH(L";") + (path1End - path1) +
+ (urepathEnd - urepath) + MY_LENGTH(L";") + (pathEnd - path) +
(n == 0 ? 0 : MY_LENGTH(L";") + (n - 1)) + 1]; //TODO: overflow
- wsprintfW(value, L"%s;%s%s%s", path, path1, n == 0 ? L"" : L";", orig);
+ wsprintfW(value, L"%s;%s%s%s", urepath, path, n == 0 ? L"" : L";", orig);
if (!SetEnvironmentVariableW(L"PATH", value)) {
exit(EXIT_FAILURE);
}
@@ -252,22 +242,20 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
}
#ifdef __MINGW32__
value = new wchar_t[
- (path1End - path1) + MY_LENGTH(L";") + (pythonpath2End - pythonpath2) +
+ (pathEnd - path) + MY_LENGTH(L";") + (pythonpath2End - pythonpath2) +
MY_LENGTH(L";") + (pythonpath4End - pythonpath4) +
- MY_LENGTH(L";") + (pythonpath5End - pythonpath5) +
MY_LENGTH(L";") + (pythonpath3End - pythonpath3) +
(n == 0 ? 0 : MY_LENGTH(L";") + (n - 1)) + 1]; //TODO: overflow
wsprintfW(
- value, L"%s;%s;%s;%s;%s%s%s", path1, pythonpath2, pythonpath4,
- pythonpath5, pythonpath3,
+ value, L"%s;%s;%s;%s%s%s", path, pythonpath2, pythonpath4, pythonpath3,
n == 0 ? L"" : L";", orig);
#else
value = new wchar_t[
- (path1End - path1) + MY_LENGTH(L";") + (pythonpath2End - pythonpath2) +
+ (pathEnd - path) + MY_LENGTH(L";") + (pythonpath2End - pythonpath2) +
MY_LENGTH(L";") + (pythonpath3End - pythonpath3) +
(n == 0 ? 0 : MY_LENGTH(L";") + (n - 1)) + 1]; //TODO: overflow
wsprintfW(
- value, L"%s;%s;%s%s%s", path1, pythonpath2, pythonpath3,
+ value, L"%s;%s;%s%s%s", path, pythonpath2, pythonpath3,
n == 0 ? L"" : L";", orig);
#endif
if (!SetEnvironmentVariableW(L"PYTHONPATH", value)) {
diff --git a/pyuno/zipcore/python.sh b/pyuno/zipcore/python.sh
index e32f1370a0d0..c6c2f4a3d749 100644
--- a/pyuno/zipcore/python.sh
+++ b/pyuno/zipcore/python.sh
@@ -44,7 +44,7 @@ PATH=$sd_prog${PATH+:$PATH}
export PATH
# Set %%OOO_LIBRARY_PATH_VAR%% so that "import pyuno" finds libpyuno.so:
-%%OOO_LIBRARY_PATH_VAR%%=$sd_prog/../basis-link/program:$sd_prog/../basis-link/ure-link/lib${%%OOO_LIBRARY_PATH_VAR%%:+:$%%OOO_LIBRARY_PATH_VAR%%}
+%%OOO_LIBRARY_PATH_VAR%%=$sd_prog:$sd_prog/../basis-link/ure-link/lib${%%OOO_LIBRARY_PATH_VAR%%:+:$%%OOO_LIBRARY_PATH_VAR%%}
export %%OOO_LIBRARY_PATH_VAR%%
# Set UNO_PATH so that "officehelper.bootstrap()" can find soffice executable:
@@ -57,19 +57,19 @@ export UNO_PATH
export URE_BOOTSTRAP
NONMACSECTION
-PYTHONPATH=$sd_prog/../basis-link/program:$sd_prog/../basis-link/program/python-core-%%PYVERSION%%/lib:$sd_prog/../basis-link/program/python-core-%%PYVERSION%%/lib/lib-dynload:$sd_prog/../basis-link/program/python-core-%%PYVERSION%%/lib/lib-tk:$sd_prog/../basis-link/program/python-core-%%PYVERSION%%/lib/site-packages${PYTHONPATH+:$PYTHONPATH}
+PYTHONPATH=$sd_prog:$sd_prog/python-core-%%PYVERSION%%/lib:$sd_prog/python-core-%%PYVERSION%%/lib/lib-dynload:$sd_prog/python-core-%%PYVERSION%%/lib/lib-tk:$sd_prog/python-core-%%PYVERSION%%/lib/site-packages${PYTHONPATH+:$PYTHONPATH}
export PYTHONPATH
-PYTHONHOME=$sd_prog/../basis-link/program/python-core-%%PYVERSION%%
+PYTHONHOME=$sd_prog/python-core-%%PYVERSION%%
export PYTHONHOME
# execute binary
-exec "$sd_prog/../basis-link/program/python.bin" "$@"
+exec "$sd_prog/python.bin" "$@"
MACSECTION
-PYTHONHOME=$sd_prog/../basis-link/program/OOoPython.framework
+PYTHONHOME=$sd_prog/OOoPython.framework
export PYTHONHOME
pybasislibdir=$PYTHONHOME/Versions/%%PYVERSION%%/lib/python%%PYVERSION%%
-PYTHONPATH=$sd_prog/../basis-link/program:$pybasislibdir:$pybasislibdir/lib-dynload:$pybasislibdir/lib-tk:$pybasislibdir/site-packages${PYTHONPATH+:$PYTHONPATH}
+PYTHONPATH=$sd_prog:$pybasislibdir:$pybasislibdir/lib-dynload:$pybasislibdir/lib-tk:$pybasislibdir/site-packages${PYTHONPATH+:$PYTHONPATH}
export PYTHONPATH
# execute binary
diff --git a/scp2/source/python/file_python.scp b/scp2/source/python/file_python.scp
index cfef220e2703..be8cbe239f11 100644
--- a/scp2/source/python/file_python.scp
+++ b/scp2/source/python/file_python.scp
@@ -36,13 +36,13 @@ File gid_File_Lib_Pyuno
#else
Name = "pyuno.pyd";
#endif
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
Styles = (PACKED);
End
File gid_File_Lib_Pythonloader
TXT_FILE_BODY;
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
#ifdef UNX
Name = STRING(CONCAT2(pythonloader.uno,UNXSUFFIX));
#else
@@ -53,28 +53,28 @@ End
File gid_File_Py_Unohelper
TXT_FILE_BODY;
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
Name = "unohelper.py";
Styles = (PACKED);
End
File gid_File_Py_Officehelper
TXT_FILE_BODY;
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
Name = "officehelper.py";
Styles = (PACKED);
End
File gid_File_Py_Uno
TXT_FILE_BODY;
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
Name = "uno.py";
Styles = (PACKED);
End
File gid_File_Py_Pythonloader
TXT_FILE_BODY;
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
Name = "pythonloader.py";
Styles = (PACKED);
End
@@ -82,7 +82,7 @@ End
#ifndef SYSTEM_PYTHON
File gid_File_Py_Python_Core
TXT_FILE_BODY;
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
#ifdef MACOSX
Name = "OOoPython.framework.zip";
Styles = (ARCHIVE,USE_INTERNAL_RIGHTS);
@@ -96,7 +96,7 @@ End
#ifndef MACOSX
File gid_File_Py_Python_Bin
BIN_FILE_BODY;
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
Name = "python.bin";
Styles = (PACKED);
End
@@ -126,14 +126,14 @@ End
#ifndef MACOSX
File gid_File_Lib_Python_So
TXT_FILE_BODY;
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
Name = STRING(PY_FULL_DLL_NAME);
Styles = (PACKED);
End
#ifdef UNX
Shortcut gid_Shortcut_Lib_Python_So
FileID = gid_File_Lib_Python_So;
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
Name = STRING(CONCAT3(libpython,PYMAJMIN,UNXSUFFIX));
Styles = (NETWORK,RELATIVE);
End
@@ -141,7 +141,7 @@ End
#else //MACOSX
//directory entries solely to be able to create the symlinks
Directory gid_Dir_PythonFramework
- ParentID = gid_Dir_Program;
+ ParentID = gid_Brand_Dir_Program;
HostName = "OOoPython.framework";
End
@@ -287,15 +287,6 @@ Unixlink gid_Unixlink_Python_libpython
Styles = ();
End
#endif //MACOSX
-
-#ifdef WNT
-File gid_File_Lib_Python_So_Brand // Fix for system-python-problem on windows
- TXT_FILE_BODY;
- Dir = gid_Brand_Dir_Program;
- Name = STRING(PY_FULL_DLL_NAME);
- Styles = (PACKED);
-End
-#endif
#endif
#ifdef UNX
@@ -308,7 +299,7 @@ File gid_File_Pyuno
#else
Name = "pyuno.so";
#endif
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
Styles = (PACKED);
End
diff --git a/scp2/source/python/module_python.scp b/scp2/source/python/module_python.scp
index eef393917432..d80bc1663a76 100644
--- a/scp2/source/python/module_python.scp
+++ b/scp2/source/python/module_python.scp
@@ -34,7 +34,7 @@ Module gid_Module_Optional_Pyuno
MOD_NAME_DESC ( MODULE_OPTIONAL_PYTHON );
ParentID = gid_Module_Optional;
Sortkey = "750";
- Files = (gid_File_Pyuno,gid_File_Lib_Pyuno,gid_File_Lib_Pythonloader,gid_File_Py_Unohelper,gid_File_Py_Officehelper,gid_File_Py_Uno,gid_File_Py_Pythonloader,gid_File_Py_Python_Core,gid_File_Py_Python_Bin,gid_File_Lib_Python_So,gid_Shortcut_Lib_Python_So,gid_File_Lib_Python_So_Brand,gid_File_Scripts_Python,gid_File_Share_Registry_Pyuno_Xcd);
+ Files = (gid_File_Pyuno,gid_File_Lib_Pyuno,gid_File_Lib_Pythonloader,gid_File_Py_Unohelper,gid_File_Py_Officehelper,gid_File_Py_Uno,gid_File_Py_Pythonloader,gid_File_Py_Python_Core,gid_File_Py_Python_Bin,gid_File_Lib_Python_So,gid_Shortcut_Lib_Python_So,gid_File_Scripts_Python,gid_File_Share_Registry_Pyuno_Xcd);
Minimal = NO;
Default = YES;
Styles = ( );
diff --git a/scp2/source/python/module_python_mailmerge.scp b/scp2/source/python/module_python_mailmerge.scp
index 53ed507acd08..222e33f83812 100644
--- a/scp2/source/python/module_python_mailmerge.scp
+++ b/scp2/source/python/module_python_mailmerge.scp
@@ -31,13 +31,13 @@
#ifndef DISABLE_PYUNO
File gid_File_Pymailmerge
TXT_FILE_BODY;
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
Name = "mailmerge.py";
Styles = (PACKED);
End
File gid_File_Pymailmerge_msgbox
TXT_FILE_BODY;
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
Name = "msgbox.py";
Styles = (PACKED);
End
diff --git a/scp2/source/python/profileitem_python.scp b/scp2/source/python/profileitem_python.scp
index e0ceceead612..46d515cd85a5 100644
--- a/scp2/source/python/profileitem_python.scp
+++ b/scp2/source/python/profileitem_python.scp
@@ -36,7 +36,7 @@ Profile gid_Profile_Pythonloader_Uno_Ini
#else
Name = "pythonloader.uno.ini";
#endif
- Dir = gid_Dir_Program;
+ Dir = gid_Brand_Dir_Program;
Styles = (NETWORK);
End