Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-build-utils
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
korinf
etersoft-build-utils
Commits
eefa7a9e
Commit
eefa7a9e
authored
Jul 27, 2010
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmlog: add support for -v (increment version)
introduce inc_release
parent
643adfeb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
rpmlog
bin/rpmlog
+5
-3
spec
share/eterbuild/functions/spec
+11
-0
increment_release.sh
tests/increment_release.sh
+11
-0
No files found.
bin/rpmlog
View file @
eefa7a9e
...
...
@@ -11,9 +11,9 @@ load_mod spec rpm git etersoft
if
[
"
$1
"
=
"-h"
]
||
[
"
$1
"
=
"--help"
]
;
then
echog
"rpmlog - update changelog"
echog
"Usage: rpmlog [-r|-s] [-l|-t] [SPEC] [TAG]"
echog
"Usage: rpmlog [-r|-s
|-v
] [-l|-t] [SPEC] [TAG]"
echog
"Options:"
#
echog " -v - increment version"
echog
" -v - increment version"
echog
" -r - increment release"
echog
" -s - increment subrelease"
echog
" -l - add changelog from git log (since last release tag or TAG)"
...
...
@@ -24,7 +24,7 @@ fi
is_gear
||
fatal
"rpmlog usable only with gear repo"
INCREMENTMODE
=
""
if
[
"
$1
"
=
"-r"
]
||
[
"
$1
"
=
"-s"
]
;
then
if
[
"
$1
"
=
"-r"
]
||
[
"
$1
"
=
"-s"
]
||
[
"
$1
"
=
"-v"
]
;
then
INCREMENTMODE
=
$1
shift
fi
...
...
@@ -82,6 +82,8 @@ if [ "$INCREMENTMODE" = "-r" ] ; then
inc_release
$SPECNAME
elif
[
"
$INCREMENTMODE
"
=
"-s"
]
;
then
inc_subrelease
$SPECNAME
elif
[
"
$INCREMENTMODE
"
=
"-v"
]
;
then
inc_version
$SPECNAME
fi
NEWREV
=
$(
get_version
$SPECNAME
)
-
$(
get_release
$SPECNAME
)
...
...
share/eterbuild/functions/spec
View file @
eefa7a9e
...
...
@@ -127,6 +127,17 @@ set_version()
fi
}
inc_version
()
{
local
VER
=
$(
get_version
"
$1
"
)
# fixme: more general and use in other functions (see increment_release test)
local
MAJOR
=
`
echo
"
$VER
"
|
sed
-e
"s|
\.
[0-9]*
$|
|"
`
local
MINOR
=
`
echo
"
$VER
"
|
sed
-e
"s|.*
\.
||"
`
[
"
$MINOR
"
=
"
$VER
"
]
&&
MINOR
=
"0"
VER
=
"
${
MAJOR
}
.
$((
$MINOR
+
1
))
"
set_version
"
$1
"
$VER
}
# decrement release with workaround about non textual release
decrement_release
()
{
...
...
tests/increment_release.sh
View file @
eefa7a9e
...
...
@@ -15,11 +15,20 @@ get_release()
echo
$TESTREL
}
get_version
()
{
echo
$TESTVER
}
set_release
()
{
echo
"
$2
"
}
set_version
()
{
echo
"
$2
"
}
TESTREL
=
alt5
...
...
@@ -39,3 +48,5 @@ check inc_release "alt6" `inc_release ""`
TESTREL
=
alt6.2
check inc_release
"alt7"
`
inc_release
""
`
TESTVER
=
1.5.7
check inc_version
"1.5.8"
`
inc_version
""
`
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment