tizen-distro: improve layerhook for meta-tizen
authorPatrick Ohly <patrick.ohly@intel.com>
Fri, 9 Jan 2015 12:31:09 +0000 (04:31 -0800)
committerPatrick Ohly <patrick.ohly@intel.com>
Fri, 9 Jan 2015 16:10:33 +0000 (08:10 -0800)
Not all commits in meta-tizen have a Signed-of-by tag. If missing,
just append the rev number at the end of the commit message.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
conf/combo-layerhook-meta-tizen.sh

index 6c4a0bb..e868aaa 100755 (executable)
@@ -16,4 +16,8 @@ reponame=$3
 # prefix.
 sed -i -e "s#Subject: \[PATCH\] \(.*\)#Subject: \[PATCH\] meta-tizen: \1#" $patchfile
 
-sed -i -e "0,/^Signed-off-by:/s#\(^Signed-off-by:.*\)#\(From meta-tizen rev: $rev\)\n\n\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
+else
+    sed -i -e "0,/^---$/s#^---\$#\(From meta-tizen rev: $rev\)\n---#" $patchfile
+fi