>From 72404319d1a00d83d1e08e10f0a16d441278dfbf Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sun, 21 Nov 2010 11:24:50 +0100 Subject: [PATCH 1/2] tasktool fixes. --- ChangeLog | 6 ++++++ tasktool | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4de0bab..547536d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-11-21 Ralf Wildenhues + + Tasktool operations. + * tasktool (tt_add_changelog_entry): Use portable sed features + only. Avoid changing more than the first matching entry. + 2010-11-20 Jose E. Marchesi Tasktool operations. diff --git a/tasktool b/tasktool index 643eb5a..98ec76a 100755 --- a/tasktool +++ b/tasktool @@ -449,7 +449,14 @@ tt_add_changelog_entry () if grep -E '^ ' ChangeLog | head -1 | \ grep "Tasktool operations." > /dev/null 2>&1 then - cat ${tt_changelog} | sed -e "s/\(\t\* $1: .*\)/\1\n\t$2/" > ${tt_changelog}.tmp + sed -e "/^ \* $1: /{ + a\\ +\ $2 + :loop + n + b loop + } +" < ${tt_changelog} > ${tt_changelog}.tmp mv ${tt_changelog}.tmp ${tt_changelog} else entry="`date +%Y-%m-%d` `tt_user_full_name` <`tt_user_email`> -- 1.7.3.rc2