Patchwork [2/2] scripts/combo-layer: fix overzealous regex in default hook script

login
register
mail settings
Submitter Paul Eggleton
Date Aug. 23, 2011, 10:32 p.m.
Message ID <d353e993939f7c5d678633841c0460f27a3e8042.1314138692.git.paul.eggleton@linux.intel.com>
Download mbox | patch
Permalink /patch/10463/
State New, archived
Headers show

Comments

Paul Eggleton - Aug. 23, 2011, 10:32 p.m.
combo-layer's hook scripts are intended to modify patches as they pass
through; the default one adds a prefix with the component name and
a line with the component repo revision before the Signed-off-by;
however the script was also unintentionally modifying the contents of
patches *within* the patches passing through it, which resulted in
unexpected failures when the combo-layer script attempted to use
"git am" to apply them.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/combo-layer-hook-default.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Otavio Salvador - Aug. 24, 2011, 12:36 p.m.
Acked-by: Otavio Salvador <otavio@ossystems.com.br>

On Tue, Aug 23, 2011 at 19:32, Paul Eggleton
<paul.eggleton@linux.intel.com> wrote:
> combo-layer's hook scripts are intended to modify patches as they pass
> through; the default one adds a prefix with the component name and
> a line with the component repo revision before the Signed-off-by;
> however the script was also unintentionally modifying the contents of
> patches *within* the patches passing through it, which resulted in
> unexpected failures when the combo-layer script attempted to use
> "git am" to apply them.
>
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
>  scripts/combo-layer-hook-default.sh |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/combo-layer-hook-default.sh b/scripts/combo-layer-hook-default.sh
> index f03c4fa..e535d5f 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 "0,/Signed-off-by:/s#\(Signed-off-by:.*\)#\($reponame rev: $rev\)\n\n\1#" $patchfile
> +sed -i -e "s#^Subject: \[PATCH\] \(.*\)#Subject: \[PATCH\] $reponame: \1#" $patchfile
> +sed -i -e "0,/^Signed-off-by:/s#\(Signed-off-by:.*\)#\($reponame rev: $rev\)\n\n\1#" $patchfile
> --
> 1.7.4.1
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>

Patch

diff --git a/scripts/combo-layer-hook-default.sh b/scripts/combo-layer-hook-default.sh
index f03c4fa..e535d5f 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 "0,/Signed-off-by:/s#\(Signed-off-by:.*\)#\($reponame rev: $rev\)\n\n\1#" $patchfile
+sed -i -e "s#^Subject: \[PATCH\] \(.*\)#Subject: \[PATCH\] $reponame: \1#" $patchfile
+sed -i -e "0,/^Signed-off-by:/s#\(Signed-off-by:.*\)#\($reponame rev: $rev\)\n\n\1#" $patchfile