Commit 104248ed authored by Vitaly Lipatov's avatar Vitaly Lipatov

rewrite add_changelog_helper

parent ab4ce390
...@@ -149,18 +149,21 @@ add_changelog_helper() ...@@ -149,18 +149,21 @@ add_changelog_helper()
{ {
# don't work sometime? # don't work sometime?
# TODO: fix with $@, single arg? # TODO: fix with $@, single arg?
local DESC SPEC local DESC="$1"
shift
local SPECS="$*"
if ! tty -s && [ -z "$DESC" ] ; then if ! tty -s && [ -z "$DESC" ] ; then
echo "skip changelog fixing without tty" echo "skip changelog fixing without tty"
return 1 return 1
fi fi
add_changelog -e "$@" [ -z "$DESC$SPEC" ] && fatal "run add_changelog with incorrect args"
add_changelog -e "$DESC" $SPECS
R=$? R=$?
[ -z "$EDITOR" ] && { echo "skip changelog editing without EDITOR var"; return 1 ; } [ -z "$EDITOR" ] && { echo "skip changelog editing without EDITOR var"; return 1 ; }
# If changelog sucessfully added # If changelog sucessfully added
if [ "$R" = "0" ]; then if [ "$R" = "0" ]; then
shift local SPEC
for SPEC in "$@" ; do for SPEC in $SPECS ; do
N=`grep -n '^%changelog' $SPEC | head -n 1 | sed s!:.*!!g` N=`grep -n '^%changelog' $SPEC | head -n 1 | sed s!:.*!!g`
# +1 -- comment with date and packager name # +1 -- comment with date and packager name
# +2 -- place for edit comments # +2 -- place for edit comments
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment