leaving sitecustomize.pyc)
Message-ID: <5afd7146.5TWHjjFuWE7zdHkT%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 62f538266514779ee6dd1db2086e28b1c5c7dd3f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=62f53826651477…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu May 17 14:05:43 2018 +0200
6101 FIX Fixed partial uninstall of Check_MK 1.5 versions (leaving sitecustomize.pyc)
The python delivered with Check_MK was not precompiling the
lib/python2.7/sitecustomize.pyc
during packaging. It was then created during runtime on the target system. Since this
file
is not under control of the RPM/DEB packages the file was left on the filesystem after
uninstall. The version was still visible after removal in "omd version" output
until one
removed the /omd/versions/[version] directory.
Change-Id: Ie7eb6e4b68589f598dfd7c654f2de87c7cc8ff15
---
.werks/6101 | 15 +++++++++++++++
omd/packages/python/.gitignore | 1 +
omd/packages/python/Makefile | 11 +++++++++--
3 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/.werks/6101 b/.werks/6101
new file mode 100644
index 0000000..30f2f99
--- /dev/null
+++ b/.werks/6101
@@ -0,0 +1,15 @@
+Title: Fixed partial uninstall of Check_MK 1.5 versions (leaving sitecustomize.pyc)
+Level: 1
+Component: packages
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1526558604
+
+The python delivered with Check_MK was not precompiling the
lib/python2.7/sitecustomize.pyc
+during packaging. It was then created during runtime on the target system. Since this
file
+is not under control of the RPM/DEB packages the file was left on the filesystem after
+uninstall. The version was still visible after removal in "omd version" output
until one
+removed the /omd/versions/[version] directory.
diff --git a/omd/packages/python/.gitignore b/omd/packages/python/.gitignore
index b5d449b..2020b77 100644
--- a/omd/packages/python/.gitignore
+++ b/omd/packages/python/.gitignore
@@ -2,3 +2,4 @@ Python-2.7.1?
bin/
build/
destdir/
+sitecustomize.pyc
diff --git a/omd/packages/python/Makefile b/omd/packages/python/Makefile
index 8e05038..7297e3b 100644
--- a/omd/packages/python/Makefile
+++ b/omd/packages/python/Makefile
@@ -40,6 +40,13 @@ build: bin/gcc bin/g++
# python-modules, ...) during compilation and install targets.
# NOTE: -j1 seems to be necessary when --enable-optimizations is used
PATH="$(abspath bin):$$PATH" ; $(MAKE) -j1 -C $(DIR)
DESTDIR=$(PACKAGE_PYTHON_DESTDIR) install
+ $(MAKE) sitecustomize.pyc
+
+sitecustomize.pyc: sitecustomize.py
+ export PYTHONPATH="$$PYTHONPATH:$(PACKAGE_PYTHON_PYTHONPATH)" ; \
+ export LDFLAGS="$(PACKAGE_PYTHON_LDFLAGS)" ; \
+ export LD_LIBRARY_PATH="$(PACKAGE_PYTHON_LD_LIBRARY_PATH)" ; \
+ $(PACKAGE_PYTHON_EXECUTABLE) -m py_compile sitecustomize.py
# The compiler detection code below is basically what part of AC_PROC_CXX does.
bin/gcc:
@@ -87,12 +94,12 @@ install: bin/gcc bin/g++
$(DESTDIR)$(OMD_ROOT)/bin/pydoc \
$(DESTDIR)$(OMD_ROOT)/bin/python2.7-config \
$(DESTDIR)$(OMD_ROOT)/bin/2to3
- install -m 644 sitecustomize.py $(DESTDIR)$(OMD_ROOT)/lib/python2.7/
+ install -m 644 sitecustomize.py sitecustomize.pyc $(DESTDIR)$(OMD_ROOT)/lib/python2.7/
skel:
clean:
- rm -rf $(DIR) bin build $(PACKAGE_PYTHON_DESTDIR)
+ rm -rf $(DIR) bin build $(PACKAGE_PYTHON_DESTDIR) sitecutomize.pyc
upstream:
git rm Python-*.tgz