#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG 7.8				#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
# Copyright 2007 - 2009 Christopher Bratusek		#
#							#
#########################################################

case $1 in

	*)

		echo "Bumping Version from $1 to $2"
		for file in documentation/index.html documentation/chapter00.html documentation/chapter01.html \
			documentation/chapter02.html documentation/chapter03.html documentation/chapter04.html \
			documentation/chapter05.html documentation/chapter06.html documentation/chapter07.html \
			documentation/chapter08.html documentation/chapter09.html configure \
			scripts/bs-ng-echo scripts/bs-ng-profiler scripts/countfiles \
			scripts/countprocesses scripts/showload scripts/showmem scripts/showsize \
			scripts/showtty scripts/showuptime scripts/truncpwd rc/nx-rc.in \
			rc/themes/bracket-rc rc/themes/dash-rc rc/themes/fallback-rc \
			rc/themes/poweruser-rc rc/themes/clock-ad-rc rc/themes/dirks-rc \
			rc/themes/sepa_ng-rc rc/themes/clock-rc rc/functions/ls \
			rc/themes/dot_prompt-rc rc/themes/job-rc rc/themes/separator-rc \
			rc/themes/custom-rc rc/themes/elite-rc rc/themes/minimal-rc rc/functions/xchown \
			rc/themes/vector-rc rc/misc/alias-rc rc/misc/options-rc rc/functions/xcp \
			rc/misc/shopt-rc rc/misc/color-rc rc/misc/man-rc rc/functions/xunalias \
			rc/misc/random-rc mkrelease terminfo/mostlike.terminfo rc/functions/git \
			terminfo/bold.terminfo code/bashstyle.in rc/themes/quirk-rc rc/functions/xconv\
			scripts/showbatteryload scripts/showcpuload scripts/showspace \
			rc/misc/readline-rc rc/themes/sputnik-rc rc/misc/vim-rc rc/misc/nano-rc \
			scripts/showip rc/misc/completion-rc scripts/man2pdf scripts/systeminfos \
			scripts/rcgenerator terminfo/nebula.terminfo rc/functions/debug rc/functions/xdel \
			rc/functions/check_opt rc/functions/gconf rc/misc/ls-rc rc/functions/xmv; do
				sed -e "s/NG $1/NG $2/g" -i $file;
		done
		sed -e "s/$1/$2/g" -i data/bashstyle7.glade
		sed -e "s/$1/$2/g" -i debian/changelog
		sed -e "s/v$1/v$2/g" -i configure
		sed -e "s/VERSION=$1/VERSON=$2" -i configure
		_svnver=$(svn info | grep Revision | gawk '{print $2}')
		svnver=$(($_svnver+1))
		sed -e "s/rev.*)/rev$svnver)/g" -i configure

	;;

esac
