aboutsummaryrefslogtreecommitdiff
blob: 41f420b5088346dcdfcf4418a02cc9acd9dcd775 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash

. /etc/init.d/functions.sh
base="${1}"
version="${2}"
portdir="$(portageq envvar PORTDIR)/dev-qt/"
overlay="$(portageq get_repo_path / qt)"
RED=$'\033[31;01m'
GREEN=$'\e[32;01m'
moto(){
	echo """
		##############################################
		# Tool for bumping qt packages using portage #
		# packages as base. Version 0.0.1            #
		# Usefull for bumping qt releases e.g. 4.5.1 #
		# -> 4.5.2 on overlay.                       #
		# Markos Chandras <hwoarang@gentoo.org>      #
		# qt overlay                                 #
		##############################################
	"""
}

usage(){
	echo """
		##################### USAGE #####################
		# E.g						#
		# ./bump-qt-overlay 4.5.1 4.5.2 will copy 4.5.1 #
		# packages from portage and bump them to 4.5.2  #
		# on qt overlay                                 #
		#################################################
	"""
}
if [[ ${1} == -h ]];then
	moto
	usage
	exit 3
fi

if [[ $# != 2 ]]; then
	eerror "Incorrect number of parameters"
	usage
	eerror "Exiting..."
	exit 2
fi


pushd ${overlay}
for pkg in qt qt-assistant qt-core qt-dbus qt-demo qt-gui qt-opengl qt-phonon qt-qt3support qt-script qt-sql qt-svg qt-test qt-webkit qt-xmlpatterns; do
	qtpkg=$(find ${portdir} -type f -name "${pkg}-${base}*"|tail -1)
	cp ${qtpkg} ${pkg}/${pkg}-${version}.ebuild
	cd ${pkg}
	git add .
	echangelog "Version bump to ${version}"
	repoman manifest
	cd ..
done
einfo "Packages are ready but I advice you to review them first. ${GREEN}Commit[C]${NORMAL}/${RED}Review[R]${NORMAL}" && read choice
if [[ "${choice}" == "C" ]]; then
	git commit -a -m "dev-qt/qt*:bump to ${version}"
	git pull --rebase
	git push
elif [[ "${choice}" == "R" ]]; then
	einfo "Script ended for further review"
else
	eerror "No valid choice"
	exit 1
fi
exit 0