From: Patrick Ohly Date: Fri, 13 Mar 2015 11:51:54 +0000 (+0100) Subject: combo-layer-hook-default.sh: avoid duplicating prefix X-Git-Tag: 2015-4~139 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=03be3d350425783a5938a7e4c0b858cda634b71d;p=openembedded-core.git combo-layer-hook-default.sh: avoid duplicating prefix The existing patch might already have the desired prefix, perhaps even multiple times (due to some previous import error). Ensure that after the replace, the prefix is present exactly once. Signed-off-by: Patrick Ohly Signed-off-by: Ross Burton --- diff --git a/scripts/combo-layer-hook-default.sh b/scripts/combo-layer-hook-default.sh index 8b148aca07..9dd5aedb00 100755 --- a/scripts/combo-layer-hook-default.sh +++ b/scripts/combo-layer-hook-default.sh @@ -9,5 +9,5 @@ patchfile=$1 rev=$2 reponame=$3 -sed -i -e "s#^Subject: \[PATCH\] \(.*\)#Subject: \[PATCH\] $reponame: \1#" $patchfile +sed -i -e "s#^Subject: \[PATCH\] \($reponame: \)*\(.*\)#Subject: \[PATCH\] $reponame: \2#" $patchfile sed -i -e "0,/^Signed-off-by:/s#\(^Signed-off-by:.*\)#\($reponame rev: $rev\)\n\n\1#" $patchfile