mirror of
https://github.com/deajan/obackup.git
synced 2025-01-12 23:23:53 +01:00
parent
0aee59e05e
commit
4b888812ff
13
dev/merge.sh
13
dev/merge.sh
@ -1,11 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
## MERGE 2016080601
|
|
||||||
|
|
||||||
## Merges ofunctions.sh and n_program.sh into program.sh
|
## Merges ofunctions.sh and n_program.sh into program.sh
|
||||||
## Adds installer
|
## Adds installer
|
||||||
|
|
||||||
PROGRAM=pmocr
|
PROGRAM=obackup
|
||||||
VERSION=$(grep "PROGRAM_VERSION=" n_$PROGRAM.sh)
|
VERSION=$(grep "PROGRAM_VERSION=" n_$PROGRAM.sh)
|
||||||
VERSION=${VERSION#*=}
|
VERSION=${VERSION#*=}
|
||||||
|
|
||||||
@ -27,9 +25,9 @@ function MergeAll {
|
|||||||
|
|
||||||
function MergeMinimum {
|
function MergeMinimum {
|
||||||
sed -n "/$MINIMUM_FUNCTION_BEGIN/,/$MINIMUM_FUNCTION_END/p" ofunctions.sh > tmp_minimal.sh
|
sed -n "/$MINIMUM_FUNCTION_BEGIN/,/$MINIMUM_FUNCTION_END/p" ofunctions.sh > tmp_minimal.sh
|
||||||
sed "/source \"\.\/ofunctions.sh\"/r tmp_minimal.sh" tmp_$PROGRAM.sh | grep -v 'source "./ofunctions.sh"' | grep -v "$PARANOIA_DEBUG_LINE" > debug_$PROGRAM.sh
|
sed "/source \"\.\/ofunctions.sh\"/r tmp_minimal.sh" tmp_$PROGRAM.sh | grep -v 'source "./ofunctions.sh"' | grep -v "$PARANOIA_DEBUG_LINE" > ../$PROGRAM.sh
|
||||||
rm -f tmp_minimal.sh
|
rm -f tmp_minimal.sh
|
||||||
chmod +x debug_$PROGRAM.sh
|
chmod +x ../$PROGRAM.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -52,9 +50,7 @@ function CleanDebug {
|
|||||||
function CopyCommons {
|
function CopyCommons {
|
||||||
sed "s/\[prgname\]/$PROGRAM/g" common_install.sh > ../tmp_install.sh
|
sed "s/\[prgname\]/$PROGRAM/g" common_install.sh > ../tmp_install.sh
|
||||||
sed "s/\[version\]/$VERSION/g" ../tmp_install.sh > ../install.sh
|
sed "s/\[version\]/$VERSION/g" ../tmp_install.sh > ../install.sh
|
||||||
if [ -f "common_batch.sh" ]; then
|
sed "s/\[prgname\]/$PROGRAM/g" /home/git/common/common_batch.sh > ../$PROGRAM-batch.sh
|
||||||
sed "s/\[prgname\]/$PROGRAM/g" common_batch.sh > ../$PROGRAM-batch.sh
|
|
||||||
fi
|
|
||||||
chmod +x ../install.sh
|
chmod +x ../install.sh
|
||||||
chmod +x ../$PROGRAM-batch.sh
|
chmod +x ../$PROGRAM-batch.sh
|
||||||
rm -f ../tmp_install.sh
|
rm -f ../tmp_install.sh
|
||||||
@ -68,4 +64,3 @@ else
|
|||||||
fi
|
fi
|
||||||
CleanDebug
|
CleanDebug
|
||||||
CopyCommons
|
CopyCommons
|
||||||
rm -f tmp_$PROGRAM.sh
|
|
||||||
|
Loading…
Reference in New Issue
Block a user