From ec2fa4eb1a2ecf21599c8011a0e6519a3145bbbd Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Mon, 11 Nov 2013 15:06:46 +0100 Subject: [PATCH] MT#4585 - added "--no-db-sync" option that skips sync-db/sync-constants --- functions/main | 1 + sbin/ngcpcfg | 3 ++- scripts/commit | 15 +++++++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/functions/main b/functions/main index 54e123bf..fa19d16e 100644 --- a/functions/main +++ b/functions/main @@ -97,6 +97,7 @@ export LC_ALL=C # make sure it's available in all helper scripts [ -n "${DEBUG:-}" ] && export DEBUG +[ -n "${NO_DB_SYNC:-}" ] && export NO_DB_SYNC # export for access via build_config etc export CONFIG_POOL diff --git a/sbin/ngcpcfg b/sbin/ngcpcfg index c61e34d4..616e29dd 100755 --- a/sbin/ngcpcfg +++ b/sbin/ngcpcfg @@ -131,7 +131,8 @@ case ${1:-} in decrypt) shift ; decrypt "$*" ;; diff) shift ; diff "$*" ;; init-mgmt) shift ; init-mgmt "$*" ;; - --debug) export DEBUG=1 ; shift ; $0 $* ;; + --debug) export DEBUG=1 ; shift ; $0 $* ;; + --no-db-sync) export NO_DB_SYNC=1 ; shift ; $0 $* ;; -h|--help|help) usage ; exit 0;; -v|--version|version) version ; exit 0;; *) usage 1; exit 1;; diff --git a/scripts/commit b/scripts/commit index d389efa6..aa6affe9 100755 --- a/scripts/commit +++ b/scripts/commit @@ -17,8 +17,11 @@ HELPER="${HELPER:-/usr/share/ngcp-ngcpcfg/helper/}" cd "$NGCPCTL_MAIN" -"${HELPER}/sync-db" "$NGCPCTL_CONFIG" "$CONSTANTS_CONFIG" || true - +if [ -z "${NO_DB_SYNC:-}" ] ; then + "${HELPER}/sync-db" "$NGCPCTL_CONFIG" "$CONSTANTS_CONFIG" || true +else + log_debug "no-db-sync: skipping 'sync-db'" +fi if ! git config user.name >/dev/null ; then log_debug 'git config user.name ngcp-config' @@ -58,7 +61,11 @@ fi log_debug "/usr/share/ngcp-ngcpcfg/scripts/etckeeper" /usr/share/ngcp-ngcpcfg/scripts/etckeeper >/dev/null -log_info "Synchronizing data from ${CONSTANTS_CONFIG}" -ngcp-sync-constants >/dev/null +if [ -z "${NO_DB_SYNC:-}" ] ; then + log_info "Synchronizing data from ${CONSTANTS_CONFIG}" + ngcp-sync-constants >/dev/null +else + log_debug "no-db-sync: skipping 'ngcp-sync-constants'" +fi ## END OF FILE #################################################################