Gentoo Archives: gentoo-commits

From: Mike Frysinger <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gentoolkit:gentoolkit-dev commit in: src/ebump/
Date: Thu, 31 Jan 2013 05:20:27
Message-Id: 1359609576.ca8a7416caf76e03ca27371e520bf5d6356ccc2d.vapier@gentoo
1 commit: ca8a7416caf76e03ca27371e520bf5d6356ccc2d
2 Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 31 05:19:36 2013 +0000
4 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 31 05:19:36 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=ca8a7416
7
8 ebump: fix POSIX shell code
9
10 "==" -> "="
11 "$[...]" -> "$((...))"
12
13 URL: https://bugs.gentoo.org/445144
14 Reported-by: Richard Yao <ryao <AT> gentoo.org>
15 Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
16
17 ---
18 src/ebump/ebump | 30 +++++++++++++++---------------
19 1 files changed, 15 insertions(+), 15 deletions(-)
20
21 diff --git a/src/ebump/ebump b/src/ebump/ebump
22 index 3592beb..47ffd86 100755
23 --- a/src/ebump/ebump
24 +++ b/src/ebump/ebump
25 @@ -89,7 +89,7 @@ splitname() {
26 ;;
27 name)
28 name=$(echo ${2} | sed -r "s/(.*)-[0-9].*/\1/")
29 - if [ ${name} == ${2} ] ; then
30 + if [ ${name} = ${2} ] ; then
31 if [ $(echo ${2} | grep "^[0-9].*") ] ; then
32 # The filename starts with a version number, thus it has no
33 # name
34 @@ -104,14 +104,14 @@ splitname() {
35 ;;
36 revision)
37 rev=$(echo ${2} | sed -r "s/.*-r([0-9][0-9]*)/\1/")
38 - if [ ${rev} == ${2} ] ; then
39 + if [ ${rev} = ${2} ] ; then
40 rev=0
41 fi
42 echo ${rev}
43 ;;
44 vernorev)
45 ver=$(echo ${2} | sed -r "s/.*-([0-9].*)-r[0-9]+/\1/")
46 - if [ ${ver} == ${2} ] ; then
47 + if [ ${ver} = ${2} ] ; then
48 ver=$(echo ${2} | sed -r "s/.*-([0-9].*)/\1/")
49 fi
50 echo ${ver}
51 @@ -157,13 +157,13 @@ process_ebuild() {
52 local PV=$(splitname version ${PF})
53 local rev=$(splitname revision ${PF})
54 local PV_norev=$(splitname vernorev ${PF})
55 - local newPF=${PN}-${PV_norev}-r$[rev+1]
56 + local newPF=${PN}-${PV_norev}-r$((rev+1))
57
58 # echo $PF / $PN / $PV / $rev / $PV_norev / $newPF
59
60 einfo "Bumped ${PF}.ebuild to ${newPF}.ebuild"
61
62 - if [ "${vcs}" == "svn" ]; then
63 + if [ "${vcs}" = "svn" ]; then
64 svn cp ${PF}.ebuild ${newPF}.ebuild
65 else
66 cp ${PF}.ebuild ${newPF}.ebuild
67 @@ -179,7 +179,7 @@ process_ebuild() {
68 #
69 # (Optional) Bump relevant files in files/
70 #
71 - if [ "${opt_bump_auxfiles}" == "y" ] ; then
72 + if [ "${opt_bump_auxfiles}" = "y" ] ; then
73 # Gather list of auxiliary files in files/ that has a versioned
74 # filename, where the version matches our current version.
75 local bumplist=""
76 @@ -205,9 +205,9 @@ process_ebuild() {
77 # Special case for when we have no name part; filename
78 # is just a version number
79 if [ -z "${PN}" ] ; then
80 - newbn=${PV_norev}-r$[rev+1]
81 + newbn=${PV_norev}-r$((rev+1))
82 else
83 - newbn=${PN}-${PV_norev}-r$[rev+1]
84 + newbn=${PN}-${PV_norev}-r$((rev+1))
85 fi
86
87 if [ -d ${dn}/${bn} ] ; then
88 @@ -236,7 +236,7 @@ process_ebuild() {
89 #
90 # (Optional) Add VCS entry for all new files
91 #
92 - if [ "${opt_add_vcs}" == "y" ] ; then
93 + if [ "${opt_add_vcs}" = "y" ] ; then
94 # for x in ${addfiles} ; do
95 # if [ -d ${x} ] ; then
96 # find ${x} -exec ${vcs} add {} ';'
97 @@ -253,19 +253,19 @@ process_ebuild() {
98 # (Optional) Delete previous entry
99 #
100 # Could we use 'rm' instead of remove for all vcs?
101 - if [ "${opt_delete_old}" == "y" ] ; then
102 + if [ "${opt_delete_old}" = "y" ] ; then
103 # for x in ${delfiles} ; do
104 -# if [ "${vcs}" == "cvs" ]; then
105 +# if [ "${vcs}" = "cvs" ]; then
106 # ${vcs} remove -f ${x}
107 -# elif [ "${vcs}" == "git" ]; then
108 +# elif [ "${vcs}" = "git" ]; then
109 # ${vcs} rm ${x}
110 # else
111 # ${vcs} remove ${x}
112 # fi
113 # done
114 - if [ "${vcs}" == "cvs" ]; then
115 + if [ "${vcs}" = "cvs" ]; then
116 $vcs remove -f $delfiles
117 - elif [ "${vcs}" == "git" ]; then
118 + elif [ "${vcs}" = "git" ]; then
119 $vcs rm $delfiles
120 else
121 $vcs remove $delfiles
122 @@ -276,7 +276,7 @@ process_ebuild() {
123 #
124 # (Optional) Add ChangeLog entry
125 #
126 - if [ "${opt_add_changelog}" == "y" ] && [ "${opt_add_vcs}" == "y" ]; then
127 + if [ "${opt_add_changelog}" = "y" ] && [ "${opt_add_vcs}" = "y" ]; then
128 # FIXME: remove this warning in 2-3 releases
129 if [ -n "${AUTHORNAME}" ] || [ -n "${AUTHOREMAIL}" ]; then
130 echo "Warning: AUTHORNAME and AUTHOREMAIL is deprecated!" >&2