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
3956c4ed
Commit
3956c4ed
authored
Jun 23, 2018
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmlog: add -n to force version, -a for auto increment version/release
parent
265e8e5f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
5 deletions
+28
-5
rpmlog
bin/rpmlog
+28
-5
No files found.
bin/rpmlog
View file @
3956c4ed
#!/bin/sh
# 2010, 2012, 2013, 2014 (c) Etersoft http://etersoft.ru
# 2010, 2012, 2013, 2014
, 2018
(c) Etersoft http://etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Script for update changelog or increment release
...
...
@@ -11,18 +11,20 @@ load_mod spec rpm git etersoft spec
if
[
"
$1
"
=
"-h"
]
||
[
"
$1
"
=
"--help"
]
;
then
echog
"rpmlog - update version/release and changelog"
echog
"Usage: rpmlog [-q] [-r|-s|-v] [-l|-t] [-e [changelog entry]] [SPEC] [fromTAG] [toTAG]"
echog
"Usage: rpmlog [-q] [-
a|-
r|-s|-v] [-l|-t] [-e [changelog entry]] [SPEC] [fromTAG] [toTAG]"
echo
echog
"Options:"
echog
" -a increment version if code is changed or increment release if spec changed only"
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)"
echog
" -e
increment and
add (empty) changelog entry"
echog
" -e add (empty) changelog entry"
echo
echog
"Ext. options:"
echog
" -t test run (without change files and repo)"
echog
" -q quiet mode (do not ask anything)"
echog
" -n VERSION set version and reset release"
echo
echog
"Example:"
echog
"
$
rpmlog -v -l - typical build new version"
...
...
@@ -43,11 +45,18 @@ if [ "$1" = "-q" ] ; then
fi
INCREMENTMODE
=
""
if
[
"
$1
"
=
"-r"
]
||
[
"
$1
"
=
"-s"
]
||
[
"
$1
"
=
"-v"
]
;
then
if
[
"
$1
"
=
"-r"
]
||
[
"
$1
"
=
"-s"
]
||
[
"
$1
"
=
"-v"
]
||
[
"
$1
"
=
"-a"
]
;
then
INCREMENTMODE
=
$1
shift
fi
if
[
"
$1
"
=
"-n"
]
;
then
INCREMENTMODE
=
$1
shift
FORCEVERSION
=
$1
shift
fi
CHANGELOGUPDATE
=
if
[
"
$1
"
=
"-l"
]
;
then
CHANGELOGUPDATE
=
$1
...
...
@@ -121,17 +130,31 @@ if [ -n "$TESTRUN" ] ; then
INCREMENTMODE
=
""
fi
if
[
"
$INCREMENTMODE
"
=
"-a"
]
;
then
# print all files from commit exclude spec/rules
RELLINE
=
$(
git log
--name-status
--pretty
=
oneline
$FROMTAG
..
$TOTAG
|
grep
"^[MAD]"
|
grep
-v
".gear/rules"
|
grep
-v
"
$(
basename
"
$SPECNAME
"
)
"
)
if
[
-z
"
$RELLINE
"
]
;
then
INCREMENTMODE
=
"-r"
else
INCREMENTMODE
=
"-v"
fi
fi
# increment release
case
"
$INCREMENTMODE
"
in
"-r"
)
inc_release
$SPECNAME
;;
"-n"
)
set_version
$SPECNAME
$FORCEVERSION
reset_release
$SPECNAME
;;
"-s"
)
inc_subrelease
$SPECNAME
;;
"-v"
)
set_release
$SPECNAME
inc_version
$SPECNAME
reset_release
$SPECNAME
;;
*
)
;;
...
...
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