The combo-layer hooks for bitbake and meta-tizen patch the Subject
line of patches. This change must be limited to the Subject of
the main patch itself, in particular patches embedded in the patch
must not be changed.
Achieved by limiting the replacement to the lines until the first
Subject in the patch.
Found when importing meta-tizen and diffing against a direct copy
of the final revision.
rev=$2
reponame=$3
-sed -i -e "s#Subject: \[PATCH\] \(.*\)#Subject: \[PATCH\] bitbake: \1#" $patchfile
+sed -i -e "0,/^Subject:/s#Subject: \[PATCH\] \(.*\)#Subject: \[PATCH\] bitbake: \1#" $patchfile
sed -i -e "0,/^Signed-off-by:/s#\(^Signed-off-by:.*\)#\(Bitbake rev: $rev\)\n\n\1#" $patchfile
# it appears in both meta-tizen (as .bbappend file) and other
# components (as .bb file). Therefore always add the "meta-tizen"
# prefix.
-sed -i -e "s#Subject: \[PATCH\] \(.*\)#Subject: \[PATCH\] meta-tizen: \1#" $patchfile
+sed -i -e "0,/^Subject:/s#Subject: \[PATCH\] \(.*\)#Subject: \[PATCH\] meta-tizen: \1#" $patchfile
if grep -q '^Signed-off-by:' $patchfile; then
sed -i -e "0,/^Signed-off-by:/s#\(^Signed-off-by:.*\)#\(From meta-tizen rev: $rev\)\n\n\1#" $patchfile