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
02adfdd7
You need to sign in or sign up before continuing.
Commit
02adfdd7
authored
Jun 11, 2010
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpmlog: add test run mode, fix changelog format
parent
56ef0780
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
rpmlog
bin/rpmlog
+19
-3
No files found.
bin/rpmlog
View file @
02adfdd7
...
...
@@ -13,12 +13,13 @@ load_mod spec rpm git etersoft
if
[
"
$1
"
=
"-h"
]
;
then
echog
"rpmlog - update changelog"
echog
"Usage: rpmlog [-r|-s] [SPEC] [TAG]"
echog
"Usage: rpmlog [-r|-s] [
-l|-t] [
SPEC] [TAG]"
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
" -t - test run (without change files and repo)"
exit
0
fi
...
...
@@ -36,6 +37,12 @@ if [ "$1" = "-l" ] ; then
shift
fi
TESTRUN
=
if
[
"
$1
"
=
"-t"
]
;
then
TESTRUN
=
$1
shift
fi
if
[
-n
"
${
1
/*.spec/
}
"
]
||
[
-z
"
$1
"
]
;
then
SPECNAME
=
$(
get_gear_spec
)
echo
"Using autodetected spec
$SPECNAME
..."
...
...
@@ -54,7 +61,7 @@ if [ ! -r "$SPECNAME" ] ; then
fatal
"Spec
$SPECNAME
does not found"
fi
[
-n
"
$CHANGELOGUPDATE
"
]
||
fatal
"Run with -l param"
[
-n
"
$CHANGELOGUPDATE
$TESTRUN
"
]
||
fatal
"Run with -l param"
if
[
-z
"
$FROMTAG
"
]
;
then
build_rpms_name
$SPECNAME
...
...
@@ -62,9 +69,14 @@ if [ -z "$FROMTAG" ] ; then
fi
# TODO: найти параметр для упрощения истории. пока - sort?
CHANGELOG
=
"
$(
git log
$FROMTAG
..HEAD
--simplify-merges
--dense
--pretty
=
"- %s"
|
sort
-u
)
"
# Делает первую букву маленькой, убирает точку в конце строки
CHANGELOG
=
"
$(
git log
$FROMTAG
..HEAD
--simplify-merges
--dense
--pretty
=
"- %s"
|
sort
-u
|
sed
-e
"s|
\.\$
||g"
|
sed
-e
"s|-
\(
[A-Z]
\)
|-
\l\1
|g"
)
"
[
-n
"
$CHANGELOG
"
]
||
fatal
"git log was failed"
if
[
-n
"
$TESTRUN
"
]
;
then
INCREMENTMODE
=
""
fi
# increment release
if
[
"
$INCREMENTMODE
"
=
"-r"
]
;
then
inc_release
$SPECNAME
...
...
@@ -76,6 +88,10 @@ NEWREV=$(get_version $SPECNAME)-$(get_release $SPECNAME)
echo
"Add changelog to
$NEWREV
:"
echo
"
$CHANGELOG
"
if
[
-n
"
$TESTRUN
"
]
;
then
exit
fi
add_changelog_helper
"
$CHANGELOG
"
$SPECNAME
git_commit_ignore_nothing
$SPECNAME
-m
"new build
$NEWREV
(with rpmlog script)"
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