aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorj pipkin <j@dawnrazor.net>2013-09-22 08:17:54 -0500
committerj pipkin <j@dawnrazor.net>2013-09-22 08:17:54 -0500
commitfa60e056d8d93a9887adadf2f8c7bbebf9420c08 (patch)
treec775ac8fa5411b29841987d7affe73185d3192f3 /tools
parentf4a17021fc41e818c57772825868ee1d3c34d7c9 (diff)
downloadsbotools-fa60e056d8d93a9887adadf2f8c7bbebf9420c08.tar.xz
updated version in slackbuild/sbotools/sbotools.SlackBuild, created tools/update_versions.sh which should probably be merged with tools/update_man_pages.sh
Diffstat (limited to 'tools')
-rwxr-xr-xtools/update_versions.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/tools/update_versions.sh b/tools/update_versions.sh
new file mode 100755
index 0000000..8271dfd
--- /dev/null
+++ b/tools/update_versions.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+usage_exit() {
+ echo "Usage: $(basename $0) (-g) version"
+ exit 1
+}
+
+if [[ "$1" == "" ]]; then
+ usage_exit
+fi
+
+if [[ "$1" == "-g" ]]; then
+ git=true
+ shift
+fi
+
+if [[ "$1" == "" ]]; then
+ usage_exit
+fi
+
+version="$1"
+
+update="
+ SBO-Lib/lib/SBO/Lib.pm
+ slackbuild/sbotools/sbotools.SlackBuild
+"
+
+old_version=$(grep '^our $VERSION' SBO-Lib/lib/SBO/Lib.pm \
+ | grep -Eo '[0-9]+(\.[0-9]+){0,1}')
+echo $old_version
+
+tmpfile=$(mktemp /tmp/XXXXXXXXXX)
+
+for i in $update; do
+ cat $i | sed "s/$old_version/$version/g" > $tmpfile
+ if [[ "$?" == "0" ]]; then
+ mv $tmpfile $i
+ fi
+done