Module: check_mk
Branch: master
Commit: ce9ddfd792a6fb1fe9559409bf57b7ee78895e00
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ce9ddfd792a6fb…
Author: Alex Zurhake <az(a)mathias-kettner.de>
Date: Fri Oct 26 14:55:42 2018 +0200
CMK-1134: rework re2 Makefile -> enable incremental builds
Change-Id: If4dfa7401b88c2f7f8bbe8a92ff70f3d9faf1dd2
---
omd/packages/re2/Makefile | 30 ++++++++++++++++++++++--------
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/omd/packages/re2/Makefile b/omd/packages/re2/Makefile
index c8401a8..bdd585a 100644
--- a/omd/packages/re2/Makefile
+++ b/omd/packages/re2/Makefile
@@ -3,13 +3,24 @@ include ../../Makefile.omd
# We use a released version from https://github.com/google/re2/, but in
# principle we could use any tag by exporting it manually via:
# ( TAG=2018-02-01; git archive --prefix=re2-$TAG/ --output=re2-$TAG.tar.gz $TAG )
-NAME = re2
-VERSION = 2018-10-01
-DIR = $(NAME)-$(VERSION)
+NAME := re2
+VERSION := 2018-10-01
+DIR := $(NAME)-$(VERSION)
+
+BUILD-HELPER-DIR := .$(NAME)-build-helper
+
+TARXZ := $(shell which tar) xzf
+TOUCH := $(shell which touch)
+MKDIR := $(shell which mkdir) -p
.PHONY: build unpacks install skel clean
-build: unpack
+build: $(BUILD-HELPER-DIR)/build
+
+unpack: $(BUILD-HELPER-DIR)/unpack
+
+
+$(BUILD-HELPER-DIR)/build: $(BUILD-HELPER-DIR)/unpack
# basically what part of AC_PROC_CXX does
@CXX="" ; \
for PROG in g++-8 clang++-7 g++-7 clang++-6.0 clang++-5.0 g++-6 clang++-4.0 g++-5 clang++-3.9 clang++-3.8 clang++-3.7 clang++-3.6 clang++-3.5 g++-4.9 g++ clang++; do \
@@ -28,18 +39,21 @@ build: unpack
# TODO(sp): What should we do about RE2_ON_VALGRIND?
# Massage paths a bit by moving things around.
mv $(PACKAGE_RE2_DESTDIR)/$(OMD_ROOT)/include $(PACKAGE_RE2_DESTDIR)/$(OMD_ROOT)/lib $(PACKAGE_RE2_DESTDIR)
- rm -rf $(PACKAGE_RE2_DESTDIR)/$(OMD_BASE)
+ $(RM) -r $(PACKAGE_RE2_DESTDIR)/$(OMD_BASE)
# To link statically against RE2, we must *only* see the static library at link
# time. It is a bit wasteful to build the dynamic library, too, but RE2's
# Makefile doesn't offer an easy way around that.
$(RM) $(PACKAGE_RE2_DESTDIR)/lib/*.so*
+ $(TOUCH) $@
-unpack:
- tar xzf $(DIR).tar.gz
+$(BUILD-HELPER-DIR)/unpack: $(DIR).tar.gz
+ $(MKDIR) $(BUILD-HELPER-DIR)
+ $(TARXZ) $<
+ $(TOUCH) $@
install:
skel:
clean:
- rm -rf $(DIR) $(PACKAGE_RE2_DESTDIR)
+ $(RM) -r $(DIR) $(PACKAGE_RE2_DESTDIR) $(BUILD-HELPER-DIR)
Module: check_mk
Branch: master
Commit: 302c84ded64fef5d78d2ad99eceba082a27196d2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=302c84ded64fef…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Fri Oct 26 09:55:24 2018 +0200
YAPFed web directory
CMK-1180
Change-Id: Ic0f3688c7406c0445e6abf8958dca32ce3d5c10f
---
web/app/index.wsgi | 39 ++++++++++++++++++---------------------
1 file changed, 18 insertions(+), 21 deletions(-)
diff --git a/web/app/index.wsgi b/web/app/index.wsgi
index c1230e0..33ae521 100644
--- a/web/app/index.wsgi
+++ b/web/app/index.wsgi
@@ -55,11 +55,13 @@ from cmk.gui.exceptions import (
MKAuthException,
MKUnauthenticatedException,
FinalizeRequest,
- HTTPRedirect
+ HTTPRedirect,
)
+
class Application(object):
"""The Check_MK GUI WSGI entry point"""
+
def __init__(self, wsgi_environ, start_response):
self._start_response = start_response
self._request = cmk.gui.http.Request(wsgi_environ)
@@ -80,12 +82,12 @@ class Application(object):
self._process_request()
-
def _process_request(self):
try:
config.initialize()
- with cmk.profile.Profile(enabled=self._profiling_enabled(),
+ with cmk.profile.Profile(
+ enabled=self._profiling_enabled(),
profile_file=os.path.join(cmk.paths.var_dir, "multisite.profile")):
self._handle_request()
@@ -96,8 +98,15 @@ class Application(object):
except FinalizeRequest, e:
html.response.set_status_code(e.status)
- except (MKUserError, MKAuthException, MKUnauthenticatedException, MKConfigError, MKGeneralException,
- livestatus.MKLivestatusNotFoundError, livestatus.MKLivestatusException), e:
+ except (
+ MKUserError,
+ MKAuthException,
+ MKUnauthenticatedException,
+ MKConfigError,
+ MKGeneralException,
+ livestatus.MKLivestatusNotFoundError,
+ livestatus.MKLivestatusException,
+ ), e:
# TODO: Refactor all the special cases handled here to simplify the exception handling
html.unplug_all()
@@ -110,7 +119,7 @@ class Application(object):
title = _("Livestatus problem")
plain_title = _("Livestatus problem")
else:
- title = e.title()
+ title = e.title()
plain_title = e.plain_title()
if self._plain_error():
@@ -121,7 +130,6 @@ class Application(object):
html.show_error(e)
html.footer()
-
# Some exception need to set a specific HTTP status code
if ty == MKUnauthenticatedException:
html.response.set_status_code(cmk.gui.http_status.HTTP_UNAUTHORIZED)
@@ -150,7 +158,6 @@ class Application(object):
logger.exception()
raise
-
def _teardown(self):
"""Final steps that are performed after each handled HTTP request"""
store.release_all_locks()
@@ -159,7 +166,6 @@ class Application(object):
html.finalize()
cmk.gui.globals.html.unset_current()
-
def _handle_request(self):
html.init_modes()
@@ -206,13 +212,11 @@ class Application(object):
self._ensure_general_access()
handler()
-
def _show_exception_info(self, e):
html.write_text("%s" % e)
if config.debug:
html.write_text(traceback.format_exc())
-
def _handle_not_authenticated(self):
if self._fail_silently():
# While api call don't show the login dialog
@@ -223,7 +227,7 @@ class Application(object):
# or "dashboard.py". This results in strange problems.
if html.myfile != 'login':
html.response.http_redirect('%scheck_mk/login.py?_origtarget=%s' %
- (config.url_prefix(), html.urlencode(html.makeuri([]))))
+ (config.url_prefix(), html.urlencode(html.makeuri([]))))
else:
# This either displays the login page or validates the information submitted
# to the login form. After successful login a http redirect to the originally
@@ -232,7 +236,6 @@ class Application(object):
raise FinalizeRequest()
-
def _localize_request(self):
previous_language = cmk.gui.i18n.get_current_language()
user_language = html.get_ascii_input("lang", config.user.language())
@@ -246,29 +249,25 @@ class Application(object):
if cmk.gui.i18n.get_current_language() != previous_language:
modules.load_all_plugins()
-
def _fail_silently(self):
"""Ajax-Functions want no HTML output in case of an error but
just a plain server result code of 500"""
return html.has_var("_ajaxid")
-
def _plain_error(self):
"""Webservice functions may decide to get a normal result code
but a text with an error message in case of an error"""
return html.has_var("_plain_error") or html.myfile == "webapi"
-
def _profiling_enabled(self):
if config.profile == False:
- return False # Not enabled
+ return False # Not enabled
if config.profile == "enable_by_var" and not html.has_var("_profile"):
- return False # Not enabled by HTTP variable
+ return False # Not enabled by HTTP variable
return True
-
# TODO: This is a page handler. It should not be located in generic application
# object. Move it to another place
def _page_not_found(self):
@@ -279,7 +278,6 @@ class Application(object):
html.show_error(_("This page was not found. Sorry."))
html.footer()
-
def _ensure_general_access(self):
if config.user.may("general.use"):
return
@@ -302,7 +300,6 @@ class Application(object):
raise MKAuthException(" ".join(reason))
-
def __iter__(self):
"""Is called by the WSGI server to serve the current page"""
self._start_response(self._response.http_status, self._response.headers)