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
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
Show 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
...
@@ -13,12 +13,13 @@ load_mod spec rpm git etersoft
if
[
"
$1
"
=
"-h"
]
;
then
if
[
"
$1
"
=
"-h"
]
;
then
echog
"rpmlog - update changelog"
echog
"rpmlog - update changelog"
echog
"Usage: rpmlog [-r|-s] [SPEC] [TAG]"
echog
"Usage: rpmlog [-r|-s] [
-l|-t] [
SPEC] [TAG]"
echog
"Options:"
echog
"Options:"
# echog " -v - increment version"
# echog " -v - increment version"
echog
" -r - increment release"
echog
" -r - increment release"
echog
" -s - increment subrelease"
echog
" -s - increment subrelease"
echog
" -l - add changelog from git log (since last release tag or TAG)"
echog
" -l - add changelog from git log (since last release tag or TAG)"
echog
" -t - test run (without change files and repo)"
exit
0
exit
0
fi
fi
...
@@ -36,6 +37,12 @@ if [ "$1" = "-l" ] ; then
...
@@ -36,6 +37,12 @@ if [ "$1" = "-l" ] ; then
shift
shift
fi
fi
TESTRUN
=
if
[
"
$1
"
=
"-t"
]
;
then
TESTRUN
=
$1
shift
fi
if
[
-n
"
${
1
/*.spec/
}
"
]
||
[
-z
"
$1
"
]
;
then
if
[
-n
"
${
1
/*.spec/
}
"
]
||
[
-z
"
$1
"
]
;
then
SPECNAME
=
$(
get_gear_spec
)
SPECNAME
=
$(
get_gear_spec
)
echo
"Using autodetected spec
$SPECNAME
..."
echo
"Using autodetected spec
$SPECNAME
..."
...
@@ -54,7 +61,7 @@ if [ ! -r "$SPECNAME" ] ; then
...
@@ -54,7 +61,7 @@ if [ ! -r "$SPECNAME" ] ; then
fatal
"Spec
$SPECNAME
does not found"
fatal
"Spec
$SPECNAME
does not found"
fi
fi
[
-n
"
$CHANGELOGUPDATE
"
]
||
fatal
"Run with -l param"
[
-n
"
$CHANGELOGUPDATE
$TESTRUN
"
]
||
fatal
"Run with -l param"
if
[
-z
"
$FROMTAG
"
]
;
then
if
[
-z
"
$FROMTAG
"
]
;
then
build_rpms_name
$SPECNAME
build_rpms_name
$SPECNAME
...
@@ -62,9 +69,14 @@ if [ -z "$FROMTAG" ] ; then
...
@@ -62,9 +69,14 @@ if [ -z "$FROMTAG" ] ; then
fi
fi
# TODO: найти параметр для упрощения истории. пока - sort?
# 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"
[
-n
"
$CHANGELOG
"
]
||
fatal
"git log was failed"
if
[
-n
"
$TESTRUN
"
]
;
then
INCREMENTMODE
=
""
fi
# increment release
# increment release
if
[
"
$INCREMENTMODE
"
=
"-r"
]
;
then
if
[
"
$INCREMENTMODE
"
=
"-r"
]
;
then
inc_release
$SPECNAME
inc_release
$SPECNAME
...
@@ -76,6 +88,10 @@ NEWREV=$(get_version $SPECNAME)-$(get_release $SPECNAME)
...
@@ -76,6 +88,10 @@ NEWREV=$(get_version $SPECNAME)-$(get_release $SPECNAME)
echo
"Add changelog to
$NEWREV
:"
echo
"Add changelog to
$NEWREV
:"
echo
"
$CHANGELOG
"
echo
"
$CHANGELOG
"
if
[
-n
"
$TESTRUN
"
]
;
then
exit
fi
add_changelog_helper
"
$CHANGELOG
"
$SPECNAME
add_changelog_helper
"
$CHANGELOG
"
$SPECNAME
git_commit_ignore_nothing
$SPECNAME
-m
"new build
$NEWREV
(with rpmlog script)"
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