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
95e6bdcb
Commit
95e6bdcb
authored
Jun 05, 2010
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce rpmlog command for autoupdate changelog from git log
parent
0c05c8bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
0 deletions
+78
-0
rpmlog
bin/rpmlog
+78
-0
No files found.
bin/rpmlog
0 → 100755
View file @
95e6bdcb
#!/bin/sh
# Script for update changelog or increment release
# You can use this script separately in your project with
#. /usr/share/eterbuild/eterbuild
# instead follow loader
# load common functions, compatible with local and installed script
.
`
dirname
$0
`
/../share/eterbuild/functions/common
load_mod spec rpm git etersoft
if
[
"
$1
"
=
"-h"
]
;
then
echog
"rpmlog - update changelog"
echog
"Usage: rpmlog [-r|-s] [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)"
exit
0
fi
is_gear
||
fatal
"rpmlog usable only with gear repo"
INCREMENTMODE
=
""
if
[
"
$1
"
=
"-r"
]
||
[
"
$1
"
=
"-s"
]
;
then
INCREMENTMODE
=
$1
shift
fi
CHANGELOGUPDATE
=
if
[
"
$1
"
=
"-l"
]
;
then
CHANGELOGUPDATE
=
$1
shift
fi
if
[
-n
"
${
1
/*.spec/
}
"
]
||
[
-z
"
$1
"
]
;
then
SPECNAME
=
$(
get_gear_spec
)
echo
"Using autodetected spec
$SPECNAME
..."
else
SPECNAME
=
$1
shift
fi
FROMTAG
=
if
[
-n
"
$1
"
]
;
then
FROMTAG
=
"
$1
"
shift
fi
if
[
!
-r
"
$SPECNAME
"
]
;
then
fatal
"Spec
$SPECNAME
does not found"
fi
[
-n
"
$CHANGELOGUPDATE
"
]
||
fatal
"Run with -l param"
if
[
-z
"
$FROMTAG
"
]
;
then
build_rpms_name
$SPECNAME
FROMTAG
=
"
$VERSION
-
$RELEASE
"
fi
# TODO: найти параметр для упрощения истории. пока - sort?
CHANGELOG
=
"
$(
git log
$FROMTAG
..HEAD
--simplify-merges
--dense
--pretty
=
"- %s"
|
sort
-u
)
"
[
-n
"
$CHANGELOG
"
]
||
fatal
"git log was failed"
# increment release
if
[
"
$INCREMENTMODE
"
=
"-r"
]
;
then
inc_release
$SPECNAME
elif
[
"
$INCREMENTMODE
"
=
"-s"
]
;
then
inc_subrelease
$SPECNAME
fi
add_changelog_helper
"
$CHANGELOG
"
$SPECNAME
NEWREV
=
$(
get_version
$SPECNAME
)
-
$(
get_release
$SPECNAME
)
git_commit_ignore_nothing
$SPECNAME
-m
"update spec to 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