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

case $1 in

	c)

	echo "Updating Configure"

	_svnver=$(svn info | grep Revision | gawk '{print $2}')

	svnver=$(($_svnver+1))

	sed -e "s/rev.*)/rev$svnver)/g" -i configure

	;;

	*)

	echo "Bumping Version from $1 to $2"

	for file in bs-ng-doc/index.html bs-ng-doc/chapter00.html bs-ng-doc/chapter01.html \
		bs-ng-doc/chapter02.html bs-ng-doc/chapter03.html bs-ng-doc/chapter04.html \
		bs-ng-doc/chapter05.html bs-ng-doc/chapter06.html bs-ng-doc/chapter07.html \
		bs-ng-doc/chapter08.html bs-ng-doc/chapter09.html configure \
		support/bs-ng-parse-echo support/bs-ng-profiler support/fdnl \
		support/proccount support/showload support/showmem support/showsize \
		support/showtty support/showuptime support/truncpwd system/nx-rc.in \
		system/themes/bracket-rc system/themes/dash-rc system/themes/fallback-rc \
		system/themes/poweruser-rc system/themes/clock-ad-rc system/themes/dirks-rc \
		system/themes/sepa_ng-rc system/themes/clock-rc \
		system/themes/dot_prompt-rc system/themes/job-rc system/themes/separator-rc \
		system/themes/custom-rc system/themes/elite-rc system/themes/minimal-rc \
		system/themes/vector-rc system/misc/alias-rc system/misc/options-rc \
		system/misc/shopt-rc system/misc/color-rc system/misc/man-rc \
		system/misc/random-rc mkrelease translate-prepare translate-finish \
		mostlike.terminfo mostlikebold.terminfo python-gtk/bashstyle.in system/themes/quirk-rc \
		support/showbatteryload support/showcpuload support/showspace \
		system/misc/readline-rc system/themes/sputnik-rc system/misc/vim-rc system/misc/nano-rc \
		support/showip system/misc/completion-rc support/man2pdf support/sysinfo support/bswitch.in; do
		sed -e "s/NG $1/NG $2/g" -i $file;
	done

	sed -e "s/$1/$2/g" -i glade-xml/bashstyle7.glade

	sed -e "s/v$1/v$2/g" -i configure

	_svnver=$(svn info | grep Revision | gawk '{print $2}')

	svnver=$(($_svnver+1))

	sed -e "s/rev.*)/rev$svnver)/g" -i configure

	;;

esac
