diff --git a/linux/keyman-config/debian/rules b/linux/keyman-config/debian/rules index 205d6d56f5..5145e5799d 100755 --- a/linux/keyman-config/debian/rules +++ b/linux/keyman-config/debian/rules @@ -11,7 +11,7 @@ export PYBUILD_INSTALL_ARGS=--install-scripts=/usr/share/keyman-config/ override_dh_auto_build: make man - sed -i -e "s/^__pkgversion__ = \"\"/__pkgversion__ = \"$(DEB_VERSION)\"/g" keyman_config/version.py + sed -i -e "s/^__pkgversion__ = \"[^\"]*\"/__pkgversion__ = \"$(DEB_VERSION)\"/g" keyman_config/version.py && \ make compile-po dh_auto_build $@ diff --git a/linux/keyman-config/keyman_config/__init__.py b/linux/keyman-config/keyman_config/__init__.py index 835d2d1001..71d44308d5 100644 --- a/linux/keyman-config/keyman_config/__init__.py +++ b/linux/keyman-config/keyman_config/__init__.py @@ -13,6 +13,7 @@ from .version import __releaseversion__ from .version import __tier__ from .version import __pkgversion__ from .version import __environment__ +from .version import __uploadsentry__ def _(txt): @@ -39,9 +40,11 @@ else: KeymanDownloadsUrl = 'https://downloads.keyman.com' if 'unittest' in sys.modules.keys(): - print('Not reporting to Sentry') + print('Not reporting to Sentry', file=sys.stderr) elif os.environ.get('KEYMAN_NOSENTRY'): - print('Not reporting to Sentry because KEYMAN_NOSENTRY environment variable set') + print('Not reporting to Sentry because KEYMAN_NOSENTRY environment variable set', file=sys.stderr) +elif not __uploadsentry__: + print('Not reporting to Sentry because UPLOAD_SENTRY is false (%s)' % __environment__, file=sys.stderr) else: try: # Try new sentry-sdk first @@ -51,8 +54,8 @@ else: HaveSentryNewSdk = True sentry_logging = LoggingIntegration( - level=logging.INFO, # Capture info and above as breadcrumbs - event_level=logging.CRITICAL # Send critical errors as events + level=logging.INFO, # Capture info and above as breadcrumbs + event_level=logging.CRITICAL # Send critical errors as events ) SentryUrl = "https://1d0edbf2d0dc411b87119b6e92e2c357@sentry.keyman.com/12" sentry_sdk.init( @@ -87,4 +90,4 @@ else: }) except ImportError: # even raven is not available. This is the case on Ubuntu 16.04. Just ignore. - print(_('Neither sentry-sdk nor raven is available. Not enabling Sentry error reporting.')) + print(_('Neither sentry-sdk nor raven is available. Not enabling Sentry error reporting.'), file=sys.stderr) diff --git a/linux/keyman-config/keyman_config/version.py.in b/linux/keyman-config/keyman_config/version.py.in index 49d5e84b13..8895a648d2 100644 --- a/linux/keyman-config/keyman_config/version.py.in +++ b/linux/keyman-config/keyman_config/version.py.in @@ -9,5 +9,6 @@ __versionwithtag__ = "_VERSIONWITHTAG_" __majorversion__ = "_MAJORVERSION_" __releaseversion__ = "_RELEASEVERSION_" __tier__ = "_TIER_" -__pkgversion__ = "" +__pkgversion__ = "(local)" __environment__ = "_ENVIRONMENT_" +__uploadsentry__ = "_UPLOADSENTRY_" diff --git a/linux/scripts/reconf.sh b/linux/scripts/reconf.sh index 8ea015955d..77e45c404d 100755 --- a/linux/scripts/reconf.sh +++ b/linux/scripts/reconf.sh @@ -67,6 +67,7 @@ for proj in ${extra_projects}; do -e "s/_RELEASEVERSION_/${VERSION_RELEASE}/g" \ -e "s/_TIER_/${TIER}/g" \ -e "s/_ENVIRONMENT_/${VERSION_ENVIRONMENT}/g" \ + -e "s/_UPLOADSENTRY_/${UPLOAD_SENTRY}/g" \ version.py.in > version.py cd ../buildtools && python3 ./build-langtags.py