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
acc992cd
Commit
acc992cd
authored
Mar 06, 2014
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmlog: add support for changelog message, add quiet mode support
parent
674c1b46
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
rpmlog
bin/rpmlog
+19
-8
spec
share/eterbuild/functions/spec
+4
-1
No files found.
bin/rpmlog
View file @
acc992cd
#!/bin/sh
# 2010, 2012, 2013 (c) Etersoft http://etersoft.ru
# 2010, 2012, 2013
, 2014
(c) Etersoft http://etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru>
# Script for update changelog or increment release
...
...
@@ -7,31 +7,41 @@
# load common functions, compatible with local and installed script
.
`
dirname
$0
`
/../share/eterbuild/functions/common
load_mod spec rpm git etersoft
load_mod spec rpm git etersoft
spec
if
[
"
$1
"
=
"-h"
]
||
[
"
$1
"
=
"--help"
]
;
then
echog
"rpmlog - update version/release and changelog"
echog
"Usage: rpmlog [-
r|-s|-v] [-l|-t
] [SPEC] [fromTAG] [toTAG]"
echog
"Usage: rpmlog [-
q] [-r|-s|-v] [-l|-t] [-e [changelog entry]
] [SPEC] [fromTAG] [toTAG]"
echo
echog
"Options:"
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 increment and 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)"
echo
echog
"Example:"
echog
"
$
rpmlog -v -l - typical build new version"
echog
"
$
rpmlog -r -l HEAD~2 - build new version with last two commit message as changelog"
echog
"
$
rpmlog -r -e - prepare new version build with empty changelog entry"
echog
"
$
rpmlog -v -l - typical build new version"
echog
"
$
rpmlog -r -l HEAD~2 - build new version with last two commit message as changelog"
echog
"
$
rpmlog -r -e - prepare new version build with empty changelog entry"
echog
"
$
rpmlog -r -e 'new build' - prepare new version build with changelog entry 'new build'"
exit
0
fi
is_gear
||
fatal
"rpmlog usable only with gear repo"
# TODO: rewrite option parsing
QUIET
=
if
[
"
$1
"
=
"-q"
]
;
then
QUIET
=
$1
shift
fi
INCREMENTMODE
=
""
if
[
"
$1
"
=
"-r"
]
||
[
"
$1
"
=
"-s"
]
||
[
"
$1
"
=
"-v"
]
;
then
INCREMENTMODE
=
$1
...
...
@@ -48,6 +58,7 @@ CHANGELOGADD=
if
[
"
$1
"
=
"-e"
]
;
then
CHANGELOGADD
=
$1
shift
TEXTMESSAGE
=
"
$@
"
fi
TESTRUN
=
...
...
@@ -91,7 +102,7 @@ if [ -z "$FROMTAG" ] ; then
fi
if
[
-n
"
$CHANGELOGADD
"
]
;
then
CHANGELOG
=
"- "
CHANGELOG
=
"-
$TEXTMESSAGE
"
else
# TODO: найти параметр для упрощения истории. пока - sort?
# Делает первую букву маленькой, убирает точку в конце строки
...
...
share/eterbuild/functions/spec
View file @
acc992cd
...
...
@@ -195,8 +195,11 @@ add_changelog_helper()
[
-z
"
$SPECS
"
]
&&
fatal
"run add_changelog without spec(s)"
add_changelog
-e
"
$DESC
"
$SPECS
R
=
$?
[
-n
"
$QUIET
"
]
&&
return
[
-z
"
$EDITOR
"
]
&&
{
echo
"skip changelog editing without EDITOR var"
;
return
0
;
}
# If changelog sucessfully added
# If changelog sucessfully added, let us to edit
if
[
"
$R
"
=
"0"
]
;
then
local
SPEC
for
SPEC
in
$SPECS
;
do
...
...
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