forked from al-caughey/YAMon-v4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uprev.sh
28 lines (21 loc) · 809 Bytes
/
uprev.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
set -o pipefail
d_baseDir=$(cd "$(dirname "$0")" && pwd)
showEcho=1
source "${d_baseDir}/includes/shared.sh"
cver=$(echo "$_version" | cut -d'.' -f3 )
nver="${_version%%$cver}$(($cver+1))"
#update the version number in version.sh
sed -i "s~^_version='$cver'~" "_version='$nver'" "${d_baseDir}/includes/version.sh"
urf(){
local p2f=$1
[ -f "${d_baseDir}/$p2f$nver.sh" ] && cp "${d_baseDir}/$p2f$nver.sh" "${d_baseDir}/$p2f$nver.old"
cp "${d_baseDir}/$p2f$_version.sh" "${d_baseDir}/$p2f$nver.sh"
}
urf 'setup'
IFS=$'\n'
lof=$(find ${d_baseDir} | grep '.sh')
tar -cf "${_path2bu}v$_version-${_ds}.tar.gz" $lof 2>/dev/null
sed -i "s~^# History~# History\n# $_ds: $nver - no changes~g" $lof
sed -i "s~^* History~* History\n > $_ds: $nver\n + ~g" "${d_baseDir}/changes.log"
echo "done"