From 375f5d413b058ec2ef8e5a9ea2059cc2383c613d Mon Sep 17 00:00:00 2001 From: deajan Date: Tue, 14 Mar 2017 22:15:13 +0100 Subject: [PATCH] Updated installer version logic --- dev/common_install.sh | 16 +++++++++++----- dev/merge.sh | 18 +++++++++--------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/dev/common_install.sh b/dev/common_install.sh index 56d9786..f70ed52 100755 --- a/dev/common_install.sh +++ b/dev/common_install.sh @@ -1,14 +1,18 @@ #!/usr/bin/env bash +## Installer script suitable for osync / obackup / pmocr + include #### _OFUNCTIONS_BOOTSTRAP SUBSET #### -PROGRAM=[prgname] -PROGRAM_VERSION=[version] +PROGRAM=osync + +PROGRAM_VERSION=$(grep "PROGRAM_VERSION=" $PROGRAM.sh) +PROGRAM_VERSION=${PROGRAM_VERSION#*=} PROGRAM_BINARY=$PROGRAM".sh" PROGRAM_BATCH=$PROGRAM"-batch.sh" SSH_FILTER="ssh_filter.sh" -SCRIPT_BUILD=2017021002 +SCRIPT_BUILD=2017031401 ## osync / obackup / pmocr / zsnap install script ## Tested on RHEL / CentOS 6 & 7, Fedora 23, Debian 7 & 8, Mint 17 and FreeBSD 8, 10 and 11 @@ -183,8 +187,10 @@ function CopyExampleFiles { function CopyProgram { binFiles=() binFiles[0]="$PROGRAM_BINARY" - binFiles[1]="$PROGRAM_BATCH" - binFiles[2]="$SSH_FILTER" + if [ "$PROGRAM" == "osync" ] || [ "$PROGRAM" == "obackup" ]; then + binFiles[1]="$PROGRAM_BATCH" + binFiles[2]="$SSH_FILTER" + fi local user="" local group="" diff --git a/dev/merge.sh b/dev/merge.sh index e768447..e5b81bf 100755 --- a/dev/merge.sh +++ b/dev/merge.sh @@ -1,15 +1,15 @@ #!/usr/bin/env bash -## MERGE 2017020701 +## MERGE 2017031301 ## Merges ofunctions.sh and n_program.sh into program.sh ## Adds installer function __PREPROCESSOR_Merge { PROGRAM=obackup + VERSION=$(grep "PROGRAM_VERSION=" n_$PROGRAM.sh) VERSION=${VERSION#*=} - __PREPROCESSOR_Constants source "ofunctions.sh" @@ -126,21 +126,21 @@ function __PREPROCESSOR_CleanDebug { } function __PREPROCESSOR_CopyCommons { - sed "s/\[prgname\]/$PROGRAM/g" common_install.sh > ../tmp_install.sh + sed "s/\[prgname\]/$PROGRAM/g" common_install.sh > ../install.sh if [ $? != 0 ]; then QuickLogger "Cannot assemble install." exit 1 fi for subset in "${__PREPROCESSOR_SUBSETS[@]}"; do - __PREPROCESSOR_MergeSubset "$subset" "${subset//SUBSET/SUBSET END}" "ofunctions.sh" "../tmp_install.sh" + __PREPROCESSOR_MergeSubset "$subset" "${subset//SUBSET/SUBSET END}" "ofunctions.sh" "../install.sh" done - sed "s/\[version\]/$VERSION/g" ../tmp_install.sh > ../install.sh - if [ $? != 0 ]; then - QuickLogger "Cannot change install version." - exit 1 - fi + #sed "s/\[version\]/$VERSION/g" ../tmp_install.sh > ../install.sh + #if [ $? != 0 ]; then + # QuickLogger "Cannot change install version." + # exit 1 + #fi if [ -f "common_batch.sh" ]; then sed "s/\[prgname\]/$PROGRAM/g" common_batch.sh > ../$PROGRAM-batch.sh if [ $? != 0 ]; then