All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [RFC PATCH]apply-patches.sh: big update (new directory and archive management)
@ 2012-02-06  1:47 ludovic.desroches at atmel.com
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 1/6] apply-patches.sh: check if there are rejects before applying patches ludovic.desroches at atmel.com
                   ` (5 more replies)
  0 siblings, 6 replies; 24+ messages in thread
From: ludovic.desroches at atmel.com @ 2012-02-06  1:47 UTC (permalink / raw)
  To: buildroot

Hello,

A new update for apply-patches.sh script trying to apply Arnout advices.

This is not a final version, I have some minor changes I want to add and I
have more tests/builds to do.

I mainly want to know if I take the good way!

Regards

Ludovic

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 1/6] apply-patches.sh: check if there are rejects before applying patches
  2012-02-06  1:47 [Buildroot] [RFC PATCH]apply-patches.sh: big update (new directory and archive management) ludovic.desroches at atmel.com
@ 2012-02-06  1:47 ` ludovic.desroches at atmel.com
  2012-02-10 21:43   ` Arnout Vandecappelle
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 2/6] apply-patches.sh: rename targetdir to builddir ludovic.desroches at atmel.com
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 24+ messages in thread
From: ludovic.desroches at atmel.com @ 2012-02-06  1:47 UTC (permalink / raw)
  To: buildroot

From: Ludovic Desroches <ludovic.desroches@atmel.com>

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 support/scripts/apply-patches.sh |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index 1aef47e..1ad7d1f 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -19,6 +19,12 @@ if [ ! -d "${patchdir}" ] ; then
     echo "Aborting.  '${patchdir}' is not a directory."
     exit 1
 fi
+
+# Check for rejects because if there are some, even if patches are well
+# applied, at the end it will complain about rejects into targetdir.
+if [ "`find ${targetdir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
+	echo "There are remaining reject files into ${targetdir}, please delete them."
+fi
     
 for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do 
     apply="patch -g0 -p1 -E -d"
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 2/6] apply-patches.sh: rename targetdir to builddir
  2012-02-06  1:47 [Buildroot] [RFC PATCH]apply-patches.sh: big update (new directory and archive management) ludovic.desroches at atmel.com
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 1/6] apply-patches.sh: check if there are rejects before applying patches ludovic.desroches at atmel.com
@ 2012-02-06  1:47 ` ludovic.desroches at atmel.com
  2012-02-10 21:45   ` Arnout Vandecappelle
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 3/6] apply-patches.sh: cleanup ludovic.desroches at atmel.com
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 24+ messages in thread
From: ludovic.desroches at atmel.com @ 2012-02-06  1:47 UTC (permalink / raw)
  To: buildroot

From: Ludovic Desroches <ludovic.desroches@atmel.com>

targetdir is not the output/target directory as it can suggest.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 support/scripts/apply-patches.sh |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index 1ad7d1f..2667d04 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -6,13 +6,13 @@
 # (c) 2002 Erik Andersen <andersen@codepoet.org>
 
 # Set directories from arguments, or use defaults.
-targetdir=${1-.}
+builddir=${1-.}
 patchdir=${2-../kernel-patches}
 shift 2
 patchpattern=${@-*}
 
-if [ ! -d "${targetdir}" ] ; then
-    echo "Aborting.  '${targetdir}' is not a directory."
+if [ ! -d "${builddir}" ] ; then
+    echo "Aborting.  '${builddir}' is not a directory."
     exit 1
 fi
 if [ ! -d "${patchdir}" ] ; then
@@ -21,9 +21,9 @@ if [ ! -d "${patchdir}" ] ; then
 fi
 
 # Check for rejects because if there are some, even if patches are well
-# applied, at the end it will complain about rejects into targetdir.
-if [ "`find ${targetdir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
-	echo "There are remaining reject files into ${targetdir}, please delete them."
+# applied, at the end it will complain about rejects into builddir.
+if [ "`find ${builddir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
+	echo "There are remaining reject files into ${builddir}, please delete them."
 fi
     
 for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do 
@@ -54,8 +54,8 @@ for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do
     esac fi
     echo ""
     echo "Applying ${i} using ${type}: " 
-	echo ${i} | cat >> ${targetdir}/.applied_patches_list
-    ${uncomp} ${patchdir}/${i} ${uncomp_parm} | ${apply} ${targetdir} 
+	echo ${i} | cat >> ${builddir}/.applied_patches_list
+    ${uncomp} ${patchdir}/${i} ${uncomp_parm} | ${apply} ${builddir}
     if [ $? != 0 ] ; then
         echo "Patch failed!  Please fix $i!"
 	exit 1
@@ -63,10 +63,10 @@ for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do
 done
 
 # Check for rejects...
-if [ "`find $targetdir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
+if [ "`find $builddir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
     echo "Aborting.  Reject files found."
     exit 1
 fi
 
 # Remove backup files
-find $targetdir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;
+find $builddir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 3/6] apply-patches.sh: cleanup
  2012-02-06  1:47 [Buildroot] [RFC PATCH]apply-patches.sh: big update (new directory and archive management) ludovic.desroches at atmel.com
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 1/6] apply-patches.sh: check if there are rejects before applying patches ludovic.desroches at atmel.com
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 2/6] apply-patches.sh: rename targetdir to builddir ludovic.desroches at atmel.com
@ 2012-02-06  1:47 ` ludovic.desroches at atmel.com
  2012-02-10 21:45   ` Arnout Vandecappelle
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 4/6] apply-patches.sh: directories are considered as a collection of patches ludovic.desroches at atmel.com
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 24+ messages in thread
From: ludovic.desroches at atmel.com @ 2012-02-06  1:47 UTC (permalink / raw)
  To: buildroot

From: Ludovic Desroches <ludovic.desroches@atmel.com>

Add quoting and remove redundant command.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 support/scripts/apply-patches.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index 2667d04..2eab05d 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -54,8 +54,8 @@ for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do
     esac fi
     echo ""
     echo "Applying ${i} using ${type}: " 
-	echo ${i} | cat >> ${builddir}/.applied_patches_list
-    ${uncomp} ${patchdir}/${i} ${uncomp_parm} | ${apply} ${builddir}
+	echo ${i} >> ${builddir}/.applied_patches_list
+    ${uncomp} "${patchdir}/${i}" ${uncomp_parm} | ${apply} "${builddir}"
     if [ $? != 0 ] ; then
         echo "Patch failed!  Please fix $i!"
 	exit 1
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 4/6] apply-patches.sh: directories are considered as a collection of patches
  2012-02-06  1:47 [Buildroot] [RFC PATCH]apply-patches.sh: big update (new directory and archive management) ludovic.desroches at atmel.com
                   ` (2 preceding siblings ...)
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 3/6] apply-patches.sh: cleanup ludovic.desroches at atmel.com
@ 2012-02-06  1:47 ` ludovic.desroches at atmel.com
  2012-02-10 22:40   ` Arnout Vandecappelle
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 5/6] apply-patches.sh: add recursivity when scanning patchdir ludovic.desroches at atmel.com
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 6/6] apply-patches.sh: change archive management ludovic.desroches at atmel.com
  5 siblings, 1 reply; 24+ messages in thread
From: ludovic.desroches at atmel.com @ 2012-02-06  1:47 UTC (permalink / raw)
  To: buildroot

From: Ludovic Desroches <ludovic.desroches@atmel.com>

Behaviour of directories is changed: it is no more considered as an overlay,
but rather a collection of patches. Subdirectories are not supported.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 support/scripts/apply-patches.sh |   63 ++++++++++++++++++++-----------------
 1 files changed, 34 insertions(+), 29 deletions(-)

diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index 2eab05d..1fc93f6 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -11,30 +11,10 @@ patchdir=${2-../kernel-patches}
 shift 2
 patchpattern=${@-*}
 
-if [ ! -d "${builddir}" ] ; then
-    echo "Aborting.  '${builddir}' is not a directory."
-    exit 1
-fi
-if [ ! -d "${patchdir}" ] ; then
-    echo "Aborting.  '${patchdir}' is not a directory."
-    exit 1
-fi
-
-# Check for rejects because if there are some, even if patches are well
-# applied, at the end it will complain about rejects into builddir.
-if [ "`find ${builddir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
-	echo "There are remaining reject files into ${builddir}, please delete them."
-fi
-    
-for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do 
-    apply="patch -g0 -p1 -E -d"
-    uncomp_parm=""
-    if [ -d "${patchdir}/$i" ] ; then
-	type="directory overlay"
-	uncomp="tar cf - --exclude=.svn --no-anchored -C"
-	uncomp_parm="."
-	apply="tar xvf - -C"
-    else case "$i" in
+function apply_patch {
+    path=$1
+    patch=$2
+    case "$patch" in
 	*.gz)
 	type="gzip"; uncomp="gunzip -dc"; ;; 
 	*.bz)
@@ -51,15 +31,40 @@ for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do
 	type="tar"; uncomp="cat"; apply="tar xvf - -C"; ;; 
 	*)
 	type="plaintext"; uncomp="cat"; ;; 
-    esac fi
+    esac
     echo ""
-    echo "Applying ${i} using ${type}: " 
-	echo ${i} >> ${builddir}/.applied_patches_list
-    ${uncomp} "${patchdir}/${i}" ${uncomp_parm} | ${apply} "${builddir}"
+    echo "Applying $patch using ${type}: "
+	echo ${1} >> ${builddir}/.applied_patches_list
+    ${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}"
     if [ $? != 0 ] ; then
-        echo "Patch failed!  Please fix $i!"
+        echo "Patch failed!  Please fix $patch!"
 	exit 1
     fi
+}
+
+if [ ! -d "${builddir}" ] ; then
+    echo "Aborting.  '${builddir}' is not a directory."
+    exit 1
+fi
+if [ ! -d "${patchdir}" ] ; then
+    echo "Aborting.  '${patchdir}' is not a directory."
+    exit 1
+fi
+
+# Check for rejects because if there are some, even if patches are well
+# applied, at the end it will complain about rejects into builddir.
+if [ "`find ${builddir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
+	echo "There are remaining reject files into ${builddir}, please delete them."
+fi
+
+for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do
+    if [ -d "${patchdir}/$i" ] ; then
+        for p in `ls -d "$i"` ; do
+	    apply_patch "${patchdir}/${i}" "$p" || exit 1
+	done
+    else
+        apply_patch "$patchdir" "$i" || exit 1
+    fi
 done
 
 # Check for rejects...
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 5/6] apply-patches.sh: add recursivity when scanning patchdir
  2012-02-06  1:47 [Buildroot] [RFC PATCH]apply-patches.sh: big update (new directory and archive management) ludovic.desroches at atmel.com
                   ` (3 preceding siblings ...)
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 4/6] apply-patches.sh: directories are considered as a collection of patches ludovic.desroches at atmel.com
@ 2012-02-06  1:47 ` ludovic.desroches at atmel.com
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 6/6] apply-patches.sh: change archive management ludovic.desroches at atmel.com
  5 siblings, 0 replies; 24+ messages in thread
From: ludovic.desroches at atmel.com @ 2012-02-06  1:47 UTC (permalink / raw)
  To: buildroot

From: Ludovic Desroches <ludovic.desroches@atmel.com>

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 support/scripts/apply-patches.sh |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index 1fc93f6..3a73ab9 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -42,6 +42,20 @@ function apply_patch {
     fi
 }
 
+function scan_patchdir {
+    path=$1
+    shift 1
+    patches=${@-*}
+
+    for i in `cd $path; ls -d $patches 2> /dev/null` ; do
+        if [ -d "${path}/$i" ] ; then
+	    scan_patchdir "${path}/$i"
+        else
+            apply_patch "$path" "$i" || exit 1
+        fi
+    done
+}
+
 if [ ! -d "${builddir}" ] ; then
     echo "Aborting.  '${builddir}' is not a directory."
     exit 1
@@ -57,15 +71,7 @@ if [ "`find ${builddir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; th
 	echo "There are remaining reject files into ${builddir}, please delete them."
 fi
 
-for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do
-    if [ -d "${patchdir}/$i" ] ; then
-        for p in `ls -d "$i"` ; do
-	    apply_patch "${patchdir}/${i}" "$p" || exit 1
-	done
-    else
-        apply_patch "$patchdir" "$i" || exit 1
-    fi
-done
+scan_patchdir $patchdir $patchpattern
 
 # Check for rejects...
 if [ "`find $builddir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 6/6] apply-patches.sh: change archive management
  2012-02-06  1:47 [Buildroot] [RFC PATCH]apply-patches.sh: big update (new directory and archive management) ludovic.desroches at atmel.com
                   ` (4 preceding siblings ...)
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 5/6] apply-patches.sh: add recursivity when scanning patchdir ludovic.desroches at atmel.com
@ 2012-02-06  1:47 ` ludovic.desroches at atmel.com
  2012-02-10 22:48   ` Arnout Vandecappelle
  5 siblings, 1 reply; 24+ messages in thread
From: ludovic.desroches at atmel.com @ 2012-02-06  1:47 UTC (permalink / raw)
  To: buildroot

From: Ludovic Desroches <ludovic.desroches@atmel.com>

The way archives were managed was incorrect because the uncompressed archives
were sent directly to patch command. It means that alphabetical patch orderwas
not respected.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 support/scripts/apply-patches.sh |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index 3a73ab9..9c2fbb3 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -25,10 +25,6 @@ function apply_patch {
 	type="zip"; uncomp="unzip -d"; ;; 
 	*.Z)
 	type="compress"; uncomp="uncompress -c"; ;; 
-	*.tgz)
-	type="tar gzip"; uncomp="gunzip -dc"; apply="tar xvf - -C"; ;; 
-	*.tar)
-	type="tar"; uncomp="cat"; apply="tar xvf - -C"; ;; 
 	*)
 	type="plaintext"; uncomp="cat"; ;; 
     esac
@@ -50,6 +46,17 @@ function scan_patchdir {
     for i in `cd $path; ls -d $patches 2> /dev/null` ; do
         if [ -d "${path}/$i" ] ; then
 	    scan_patchdir "${path}/$i"
+	elif echo "$i" | grep -q -E "tar\.bz$|tbz$|tar.\bz2$|tbz2$|tar\.gz$|tgz$" ; then
+            unpackedarchivedir="$builddir/.patches-$(basename $i)-unpacked"
+	    rm -rf "$unpackedarchivedir" 2> /dev/null
+	    mkdir "$unpackedarchivedir"
+	    if echo "$i" | grep "tar\.bz$|tbz$|tar\.bz2$|.tbz2$" ; then
+	        tar_options="-xjf"
+	    else
+	        tar_options="-xzf"
+	    fi
+	    tar -C "$unpackedarchivedir" --strip-components=1 $tar_options "${path}/$i"
+	    scan_patchdir "$unpackedarchivedir"
         else
             apply_patch "$path" "$i" || exit 1
         fi
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 1/6] apply-patches.sh: check if there are rejects before applying patches
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 1/6] apply-patches.sh: check if there are rejects before applying patches ludovic.desroches at atmel.com
@ 2012-02-10 21:43   ` Arnout Vandecappelle
  2012-02-15 16:55     ` Ludovic Desroches
  0 siblings, 1 reply; 24+ messages in thread
From: Arnout Vandecappelle @ 2012-02-10 21:43 UTC (permalink / raw)
  To: buildroot

On Monday 06 February 2012 02:47:14 ludovic.desroches at atmel.com wrote:
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
>  support/scripts/apply-patches.sh |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
> index 1aef47e..1ad7d1f 100755
> --- a/support/scripts/apply-patches.sh
> +++ b/support/scripts/apply-patches.sh
> @@ -19,6 +19,12 @@ if [ ! -d "${patchdir}" ] ; then
>      echo "Aborting.  '${patchdir}' is not a directory."
>      exit 1
>  fi
> +
> +# Check for rejects because if there are some, even if patches are well
> +# applied, at the end it will complain about rejects into targetdir.
> +if [ "`find ${targetdir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
> +	echo "There are remaining reject files into ${targetdir}, please delete them."

 'into' should be 'in'.

 Personally, I would just delete them instead of issuing a warning.  If you
don't then the script should at least exit at this point, otherwise you'll
still get the complaint at the end.

 Regards,
 Arnout

> +fi
>      
>  for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do 
>      apply="patch -g0 -p1 -E -d"
> 

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120210/4c10e19c/attachment-0001.html>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 2/6] apply-patches.sh: rename targetdir to builddir
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 2/6] apply-patches.sh: rename targetdir to builddir ludovic.desroches at atmel.com
@ 2012-02-10 21:45   ` Arnout Vandecappelle
  0 siblings, 0 replies; 24+ messages in thread
From: Arnout Vandecappelle @ 2012-02-10 21:45 UTC (permalink / raw)
  To: buildroot

On Monday 06 February 2012 02:47:15 ludovic.desroches at atmel.com wrote:
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
> targetdir is not the output/target directory as it can suggest.
> 
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120210/970c48db/attachment.html>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 3/6] apply-patches.sh: cleanup
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 3/6] apply-patches.sh: cleanup ludovic.desroches at atmel.com
@ 2012-02-10 21:45   ` Arnout Vandecappelle
  0 siblings, 0 replies; 24+ messages in thread
From: Arnout Vandecappelle @ 2012-02-10 21:45 UTC (permalink / raw)
  To: buildroot

On Monday 06 February 2012 02:47:16 ludovic.desroches at atmel.com wrote:
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
> Add quoting and remove redundant command.
> 
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120210/3d331b84/attachment.html>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 4/6] apply-patches.sh: directories are considered as a collection of patches
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 4/6] apply-patches.sh: directories are considered as a collection of patches ludovic.desroches at atmel.com
@ 2012-02-10 22:40   ` Arnout Vandecappelle
  2012-02-15 16:51     ` Ludovic Desroches
  0 siblings, 1 reply; 24+ messages in thread
From: Arnout Vandecappelle @ 2012-02-10 22:40 UTC (permalink / raw)
  To: buildroot

On Monday 06 February 2012 02:47:17 ludovic.desroches at atmel.com wrote:
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
> Behaviour of directories is changed: it is no more considered as an overlay,
> but rather a collection of patches. Subdirectories are not supported.

 Actually, I think the directory feature could be removed completely.  It's
not used anywhere at the moment and I don't see why anyone would want to use it.

> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> ---
>  support/scripts/apply-patches.sh |   63 ++++++++++++++++++++-----------------
>  1 files changed, 34 insertions(+), 29 deletions(-)
> 
> diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
> index 2eab05d..1fc93f6 100755
> --- a/support/scripts/apply-patches.sh
> +++ b/support/scripts/apply-patches.sh
> @@ -11,30 +11,10 @@ patchdir=${2-../kernel-patches}
>  shift 2
>  patchpattern=${@-*}
>  
> -if [ ! -d "${builddir}" ] ; then
> -    echo "Aborting.  '${builddir}' is not a directory."
> -    exit 1
> -fi
> -if [ ! -d "${patchdir}" ] ; then
> -    echo "Aborting.  '${patchdir}' is not a directory."
> -    exit 1
> -fi
> -
> -# Check for rejects because if there are some, even if patches are well
> -# applied, at the end it will complain about rejects into builddir.
> -if [ "`find ${builddir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
> -	echo "There are remaining reject files into ${builddir}, please delete them."
> -fi

 I still think it's better to keep these checks before the definition
of the apply_patch function.

> -    
> -for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do 
> -    apply="patch -g0 -p1 -E -d"
> -    uncomp_parm=""
> -    if [ -d "${patchdir}/$i" ] ; then
> -	type="directory overlay"
> -	uncomp="tar cf - --exclude=.svn --no-anchored -C"
> -	uncomp_parm="."
> -	apply="tar xvf - -C"
> -    else case "$i" in
> +function apply_patch {
> +    path=$1
> +    patch=$2
> +    case "$patch" in
>  	*.gz)
>  	type="gzip"; uncomp="gunzip -dc"; ;; 
>  	*.bz)
> @@ -51,15 +31,40 @@ for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do
>  	type="tar"; uncomp="cat"; apply="tar xvf - -C"; ;; 
>  	*)
>  	type="plaintext"; uncomp="cat"; ;; 
> -    esac fi
> +    esac
>      echo ""
> -    echo "Applying ${i} using ${type}: " 
> -	echo ${i} >> ${builddir}/.applied_patches_list
> -    ${uncomp} "${patchdir}/${i}" ${uncomp_parm} | ${apply} "${builddir}"
> +    echo "Applying $patch using ${type}: "
> +	echo ${1} >> ${builddir}/.applied_patches_list

 Shouldn't this be 'echo $path/$patch' ?  Not that it matters that much...

 Regards,
 Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120210/d6819abf/attachment-0001.html>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 6/6] apply-patches.sh: change archive management
  2012-02-06  1:47 ` [Buildroot] [RFC PATCH 6/6] apply-patches.sh: change archive management ludovic.desroches at atmel.com
@ 2012-02-10 22:48   ` Arnout Vandecappelle
  2012-02-15 16:54     ` Ludovic Desroches
  0 siblings, 1 reply; 24+ messages in thread
From: Arnout Vandecappelle @ 2012-02-10 22:48 UTC (permalink / raw)
  To: buildroot

On Monday 06 February 2012 02:47:19 ludovic.desroches at atmel.com wrote:
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
> The way archives were managed was incorrect because the uncompressed archives
> were sent directly to patch command. It means that alphabetical patch orderwas
> not respected.
> 
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> ---
>  support/scripts/apply-patches.sh |   15 +++++++++++----
>  1 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
> index 3a73ab9..9c2fbb3 100755
> --- a/support/scripts/apply-patches.sh
> +++ b/support/scripts/apply-patches.sh
> @@ -25,10 +25,6 @@ function apply_patch {
>  	type="zip"; uncomp="unzip -d"; ;; 
>  	*.Z)
>  	type="compress"; uncomp="uncompress -c"; ;; 
> -	*.tgz)
> -	type="tar gzip"; uncomp="gunzip -dc"; apply="tar xvf - -C"; ;; 
> -	*.tar)
> -	type="tar"; uncomp="cat"; apply="tar xvf - -C"; ;; 
>  	*)
>  	type="plaintext"; uncomp="cat"; ;; 
>      esac
> @@ -50,6 +46,17 @@ function scan_patchdir {
>      for i in `cd $path; ls -d $patches 2> /dev/null` ; do
>          if [ -d "${path}/$i" ] ; then
>  	    scan_patchdir "${path}/$i"
> +	elif echo "$i" | grep -q -E "tar\.bz$|tbz$|tar.\bz2$|tbz2$|tar\.gz$|tgz$" ; then
 Wouldn't '\.tar(\..*)?$|\.tbz2?$|\.tgz$' be a better pattern?

> +            unpackedarchivedir="$builddir/.patches-$(basename $i)-unpacked"
> +	    rm -rf "$unpackedarchivedir" 2> /dev/null
> +	    mkdir "$unpackedarchivedir"
> +	    if echo "$i" | grep "tar\.bz$|tbz$|tar\.bz2$|.tbz2$" ; then
> +	        tar_options="-xjf"
> +	    else
> +	        tar_options="-xzf"
> +	    fi
 You can also use tar -xaf, which selects compression automatically.

> +	    tar -C "$unpackedarchivedir" --strip-components=1 $tar_options "${path}/$i"
> +	    scan_patchdir "$unpackedarchivedir"
>          else
>              apply_patch "$path" "$i" || exit 1
>          fi
> 


 Regards,
 Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120210/ce0cbfda/attachment.html>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 4/6] apply-patches.sh: directories are considered as a collection of patches
  2012-02-10 22:40   ` Arnout Vandecappelle
@ 2012-02-15 16:51     ` Ludovic Desroches
  2012-02-15 23:06       ` [Buildroot] [RFC PATCH v2 " ludovic.desroches at atmel.com
  2012-02-16  8:49       ` [Buildroot] [RFC PATCH " Ludovic Desroches
  0 siblings, 2 replies; 24+ messages in thread
From: Ludovic Desroches @ 2012-02-15 16:51 UTC (permalink / raw)
  To: buildroot

Hello Arnout,

On Fri, Feb 10, 2012 at 11:40:46PM +0100, Arnout Vandecappelle wrote:
>    On Monday 06 February 2012 02:47:17 ludovic.desroches at atmel.com wrote:
> 
>    > From: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
>    >
> 
>    > Behaviour of directories is changed: it is no more considered as an
>    overlay,
> 
>    > but rather a collection of patches. Subdirectories are not supported.
> 
>    Actually, I think the directory feature could be removed completely.
>    It's
> 
>    not used anywhere at the moment and I don't see why anyone would want
>    to use it.
> 

Even if this feature is not used, I think we have to keep it. For instance,
into an archive we may have several directories with patches into each of them.

>    > -# Check for rejects because if there are some, even if patches are
>    well
> 
>    > -# applied, at the end it will complain about rejects into builddir.
> 
>    > -if [ "`find ${builddir}/ '(' -name '*.rej' -o -name '.*.rej' ')'
>    -print`" ] ; then
> 
>    > - echo "There are remaining reject files into ${builddir}, please
>    delete them."
> 
>    > -fi
> 
>    I still think it's better to keep these checks before the definition
> 
>    of the apply_patch function.
> 

Unintentional mistake, I will keep these checks.

> 
>    > + echo "Applying $patch using ${type}: "
> 
>    > + echo ${1} >> ${builddir}/.applied_patches_list
> 
>    Shouldn't this be 'echo $path/$patch' ? Not that it matters that
>    much...
> 

You're right, I have seen it after sending patches.

Regards

Ludovic

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 6/6] apply-patches.sh: change archive management
  2012-02-10 22:48   ` Arnout Vandecappelle
@ 2012-02-15 16:54     ` Ludovic Desroches
  2012-02-15 23:09       ` [Buildroot] [RFC PATCH v2 " ludovic.desroches at atmel.com
  0 siblings, 1 reply; 24+ messages in thread
From: Ludovic Desroches @ 2012-02-15 16:54 UTC (permalink / raw)
  To: buildroot

On Fri, Feb 10, 2012 at 11:48:08PM +0100, Arnout Vandecappelle wrote:
>    On Monday 06 February 2012 02:47:19 ludovic.desroches at atmel.com wrote:
> 
>    > scan_patchdir "${path}/$i"
> 
>    > + elif echo "$i" | grep -q -E
>    "tar\.bz$|tbz$|tar.\bz2$|tbz2$|tar\.gz$|tgz$" ; then
> 
>    Wouldn't '\.tar(\..*)?$|\.tbz2?$|\.tgz$' be a better pattern?
> 

Of course.

>    > + unpackedarchivedir="$builddir/.patches-$(basename $i)-unpacked"
> 
>    > + rm -rf "$unpackedarchivedir" 2> /dev/null
> 
>    > + mkdir "$unpackedarchivedir"
> 
>    > + if echo "$i" | grep "tar\.bz$|tbz$|tar\.bz2$|.tbz2$" ; then
> 
>    > + tar_options="-xjf"
> 
>    > + else
> 
>    > + tar_options="-xzf"
> 
>    > + fi
> 
>    You can also use tar -xaf, which selects compression automatically.
> 

Thanks for the tip.

Regards

Ludovic

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 1/6] apply-patches.sh: check if there are rejects before applying patches
  2012-02-10 21:43   ` Arnout Vandecappelle
@ 2012-02-15 16:55     ` Ludovic Desroches
  2012-02-15 22:33       ` [Buildroot] [RFC PATCH v2 " ludovic.desroches at atmel.com
  0 siblings, 1 reply; 24+ messages in thread
From: Ludovic Desroches @ 2012-02-15 16:55 UTC (permalink / raw)
  To: buildroot

On Fri, Feb 10, 2012 at 10:43:18PM +0100, Arnout Vandecappelle wrote:
>    On Monday 06 February 2012 02:47:14 ludovic.desroches at atmel.com wrote:
> 
>    > From: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
>    >
> 
>    > Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
>    > Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> 
>    > ---
> 
>    > support/scripts/apply-patches.sh | 6 ++++++
> 
>    > 1 files changed, 6 insertions(+), 0 deletions(-)
> 
>    >
> 
>    > diff --git a/support/scripts/apply-patches.sh
>    b/support/scripts/apply-patches.sh
> 
>    > index 1aef47e..1ad7d1f 100755
> 
>    > --- a/support/scripts/apply-patches.sh
> 
>    > +++ b/support/scripts/apply-patches.sh
> 
>    > @@ -19,6 +19,12 @@ if [ ! -d "${patchdir}" ] ; then
> 
>    > echo "Aborting. '${patchdir}' is not a directory."
> 
>    > exit 1
> 
>    > fi
> 
>    > +
> 
>    > +# Check for rejects because if there are some, even if patches are
>    well
> 
>    > +# applied, at the end it will complain about rejects into targetdir.
> 
>    > +if [ "`find ${targetdir}/ '(' -name '*.rej' -o -name '.*.rej' ')'
>    -print`" ] ; then
> 
>    > + echo "There are remaining reject files into ${targetdir}, please
>    delete them."
> 
>    'into' should be 'in'.
> 
>    Personally, I would just delete them instead of issuing a warning. If
>    you
> 
>    don't then the script should at least exit at this point, otherwise
>    you'll
> 
>    still get the complaint at the end.
> 

Ok I'll change the behavior.

Regards

Ludovic

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH v2 1/6] apply-patches.sh: check if there are rejects before applying patches
  2012-02-15 22:33       ` [Buildroot] [RFC PATCH v2 " ludovic.desroches at atmel.com
@ 2012-02-15 20:56         ` Arnout Vandecappelle
  0 siblings, 0 replies; 24+ messages in thread
From: Arnout Vandecappelle @ 2012-02-15 20:56 UTC (permalink / raw)
  To: buildroot

On Wednesday 15 February 2012 23:33:49 ludovic.desroches at atmel.com wrote:
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH v2 1/6] apply-patches.sh: check if there are rejects before applying patches
  2012-02-15 16:55     ` Ludovic Desroches
@ 2012-02-15 22:33       ` ludovic.desroches at atmel.com
  2012-02-15 20:56         ` Arnout Vandecappelle
  0 siblings, 1 reply; 24+ messages in thread
From: ludovic.desroches at atmel.com @ 2012-02-15 22:33 UTC (permalink / raw)
  To: buildroot

From: Ludovic Desroches <ludovic.desroches@atmel.com>

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 support/scripts/apply-patches.sh |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index 1aef47e..b145b46 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -19,6 +19,13 @@ if [ ! -d "${patchdir}" ] ; then
     echo "Aborting.  '${patchdir}' is not a directory."
     exit 1
 fi
+
+# Check for rejects because if there are some, even if patches are well
+# applied, at the end it will complain about rejects into targetdir.
+if [ "`find ${targetdir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
+	rm -f "${targetdir}/*.rej" 2> /dev/null
+	echo "Remaining reject files in ${targetdir} have been removed"
+fi
     
 for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do 
     apply="patch -g0 -p1 -E -d"
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH v2 4/6] apply-patches.sh: directories are considered as a collection of patches
  2012-02-15 16:51     ` Ludovic Desroches
@ 2012-02-15 23:06       ` ludovic.desroches at atmel.com
  2012-02-15 23:49         ` Arnout Vandecappelle
  2012-02-16  8:49       ` [Buildroot] [RFC PATCH " Ludovic Desroches
  1 sibling, 1 reply; 24+ messages in thread
From: ludovic.desroches at atmel.com @ 2012-02-15 23:06 UTC (permalink / raw)
  To: buildroot

From: Ludovic Desroches <ludovic.desroches@atmel.com>

Behaviour of directories is changed: it is no more considered as an overlay,
but rather a collection of patches. Subdirectories are not supported.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 support/scripts/apply-patches.sh |   33 +++++++++++++++++++--------------
 1 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index 8c38007..3b43e0b 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -27,15 +27,10 @@ if [ "`find ${builddir}/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; th
 	echo "Remaining reject files in ${buildir} have been removed"
 fi
     
-for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do 
-    apply="patch -g0 -p1 -E -d"
-    uncomp_parm=""
-    if [ -d "${patchdir}/$i" ] ; then
-	type="directory overlay"
-	uncomp="tar cf - --exclude=.svn --no-anchored -C"
-	uncomp_parm="."
-	apply="tar xvf - -C"
-    else case "$i" in
+function apply_patch {
+    path=$1
+    patch=$2
+    case "$patch" in
 	*.gz)
 	type="gzip"; uncomp="gunzip -dc"; ;; 
 	*.bz)
@@ -52,15 +47,25 @@ for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do
 	type="tar"; uncomp="cat"; apply="tar xvf - -C"; ;; 
 	*)
 	type="plaintext"; uncomp="cat"; ;; 
-    esac fi
+    esac
     echo ""
-    echo "Applying ${i} using ${type}: " 
-	echo ${i} >> ${builddir}/.applied_patches_list
-    ${uncomp} "${patchdir}/${i}" ${uncomp_parm} | ${apply} "${builddir}"
+    echo "Applying $patch using ${type}: "
+	echo ${path}/$patch >> ${builddir}/.applied_patches_list
+    ${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}"
     if [ $? != 0 ] ; then
-        echo "Patch failed!  Please fix $i!"
+        echo "Patch failed!  Please fix $patch!"
 	exit 1
     fi
+}
+
+for i in `cd ${patchdir}; ls -d ${patchpattern} 2> /dev/null` ; do
+    if [ -d "${patchdir}/$i" ] ; then
+        for p in `ls -d "$i"` ; do
+	    apply_patch "${patchdir}/${i}" "$p" || exit 1
+	done
+    else
+        apply_patch "$patchdir" "$i" || exit 1
+    fi
 done
 
 # Check for rejects...
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH v2 6/6] apply-patches.sh: change archive management
  2012-02-15 16:54     ` Ludovic Desroches
@ 2012-02-15 23:09       ` ludovic.desroches at atmel.com
  2012-02-15 23:54         ` Arnout Vandecappelle
  0 siblings, 1 reply; 24+ messages in thread
From: ludovic.desroches at atmel.com @ 2012-02-15 23:09 UTC (permalink / raw)
  To: buildroot

From: Ludovic Desroches <ludovic.desroches@atmel.com>

The way archives were managed was incorrect because the uncompressed archives
were sent directly to patch command. It means that alphabetical patch orderwas
not respected.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
---
 support/scripts/apply-patches.sh |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index d239943..a075afd 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -41,10 +41,6 @@ function apply_patch {
 	type="zip"; uncomp="unzip -d"; ;; 
 	*.Z)
 	type="compress"; uncomp="uncompress -c"; ;; 
-	*.tgz)
-	type="tar gzip"; uncomp="gunzip -dc"; apply="tar xvf - -C"; ;; 
-	*.tar)
-	type="tar"; uncomp="cat"; apply="tar xvf - -C"; ;; 
 	*)
 	type="plaintext"; uncomp="cat"; ;; 
     esac
@@ -66,6 +62,12 @@ function scan_patchdir {
     for i in `cd $path; ls -d $patches 2> /dev/null` ; do
         if [ -d "${path}/$i" ] ; then
 	    scan_patchdir "${path}/$i"
+	elif echo "$i" | grep -q -E "\.tar(\..*)?$|\.tbz2?$|\.tgz$" ; then
+            unpackedarchivedir="$builddir/.patches-$(basename $i)-unpacked"
+	    rm -rf "$unpackedarchivedir" 2> /dev/null
+	    mkdir "$unpackedarchivedir"
+	    tar -C "$unpackedarchivedir" --strip-components=1 -xaf "${path}/$i"
+	    scan_patchdir "$unpackedarchivedir"
         else
             apply_patch "$path" "$i" || exit 1
         fi
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH v2 4/6] apply-patches.sh: directories are considered as a collection of patches
  2012-02-15 23:06       ` [Buildroot] [RFC PATCH v2 " ludovic.desroches at atmel.com
@ 2012-02-15 23:49         ` Arnout Vandecappelle
  2012-02-16  7:56           ` Ludovic Desroches
  0 siblings, 1 reply; 24+ messages in thread
From: Arnout Vandecappelle @ 2012-02-15 23:49 UTC (permalink / raw)
  To: buildroot

On Thursday 16 February 2012 00:06:14 ludovic.desroches at atmel.com wrote:
> Behaviour of directories is changed: it is no more considered as an overlay,
> but rather a collection of patches. Subdirectories are not supported.
> 
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>

Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>


 BTW, if you update a few patches out of a series, it is usually better
to repost the entire series.  Otherwise there's a risk of some patches
getting lost.

 Regards,
 Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH v2 6/6] apply-patches.sh: change archive management
  2012-02-15 23:09       ` [Buildroot] [RFC PATCH v2 " ludovic.desroches at atmel.com
@ 2012-02-15 23:54         ` Arnout Vandecappelle
  0 siblings, 0 replies; 24+ messages in thread
From: Arnout Vandecappelle @ 2012-02-15 23:54 UTC (permalink / raw)
  To: buildroot

On Thursday 16 February 2012 00:09:59 ludovic.desroches at atmel.com wrote:
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
> The way archives were managed was incorrect because the uncompressed archives
> were sent directly to patch command. It means that alphabetical patch orderwas
> not respected.
> 
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

> +	elif echo "$i" | grep -q -E "\.tar(\..*)?$|\.tbz2?$|\.tgz$" ; then
> +            unpackedarchivedir="$builddir/.patches-$(basename $i)-unpacked"
> +	    rm -rf "$unpackedarchivedir" 2> /dev/null

 Inconsistent whitespace.

> +	    mkdir "$unpackedarchivedir"
> +	    tar -C "$unpackedarchivedir" --strip-components=1 -xaf "${path}/$i"
> +	    scan_patchdir "$unpackedarchivedir"
>          else
>              apply_patch "$path" "$i" || exit 1
>          fi


 Regards,
 Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH v2 4/6] apply-patches.sh: directories are considered as a collection of patches
  2012-02-15 23:49         ` Arnout Vandecappelle
@ 2012-02-16  7:56           ` Ludovic Desroches
  0 siblings, 0 replies; 24+ messages in thread
From: Ludovic Desroches @ 2012-02-16  7:56 UTC (permalink / raw)
  To: buildroot

Hello Arnout,

On Thu, Feb 16, 2012 at 12:49:24AM +0100, Arnout Vandecappelle wrote:
> On Thursday 16 February 2012 00:06:14 ludovic.desroches at atmel.com wrote:
> > Behaviour of directories is changed: it is no more considered as an overlay,
> > but rather a collection of patches. Subdirectories are not supported.
> > 
> > Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
> 
> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> 
> 
>  BTW, if you update a few patches out of a series, it is usually better
> to repost the entire series.  Otherwise there's a risk of some patches
> getting lost.
> 

Agree, I will try to build more packages in order to see if nothing is broken,
then I will publish again the whole series without the RFC tag.

Regards

Ludovic

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 4/6] apply-patches.sh: directories are considered as a collection of patches
  2012-02-15 16:51     ` Ludovic Desroches
  2012-02-15 23:06       ` [Buildroot] [RFC PATCH v2 " ludovic.desroches at atmel.com
@ 2012-02-16  8:49       ` Ludovic Desroches
  2012-02-16  9:45         ` Arnout Vandecappelle
  1 sibling, 1 reply; 24+ messages in thread
From: Ludovic Desroches @ 2012-02-16  8:49 UTC (permalink / raw)
  To: buildroot

On Wed, Feb 15, 2012 at 05:51:04PM +0100, Ludovic Desroches wrote:
> Hello Arnout,
> 
> On Fri, Feb 10, 2012 at 11:40:46PM +0100, Arnout Vandecappelle wrote:
> >    On Monday 06 February 2012 02:47:17 ludovic.desroches at atmel.com wrote:
> > 
> >    > From: Ludovic Desroches <ludovic.desroches@atmel.com>
> > 
> >    >
> > 
> >    > Behaviour of directories is changed: it is no more considered as an
> >    overlay,
> > 
> >    > but rather a collection of patches. Subdirectories are not supported.
> > 
> >    Actually, I think the directory feature could be removed completely.
> >    It's
> > 
> >    not used anywhere at the moment and I don't see why anyone would want
> >    to use it.
> > 
> 
> Even if this feature is not used, I think we have to keep it. For instance,
> into an archive we may have several directories with patches into each of them.

Reading the Buildroot Developer Day you have sent, keeping this feature may
cause issues with versioned patches scheme.

I mean I don't know which parameters will be passed to apply-patches but I
worry about having package/foo/ (with some version directories into it) as
parameter and then explore and apply all the patches contained into this tree.

I would like to keep it because I was thinking of debian-patches like: a
structure with several directories where we may find some patches. From the
top of my head I think it's not the case for debian-patches because patches
are located at the root level but I presume that we could face this kind of
patch.


Regards

Ludovic

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [Buildroot] [RFC PATCH 4/6] apply-patches.sh: directories are considered as a collection of patches
  2012-02-16  8:49       ` [Buildroot] [RFC PATCH " Ludovic Desroches
@ 2012-02-16  9:45         ` Arnout Vandecappelle
  0 siblings, 0 replies; 24+ messages in thread
From: Arnout Vandecappelle @ 2012-02-16  9:45 UTC (permalink / raw)
  To: buildroot

On Thursday 16 February 2012 09:49:53 Ludovic Desroches wrote:
> I mean I don't know which parameters will be passed to apply-patches but I
> worry about having package/foo/ (with some version directories into it) as
> parameter and then explore and apply all the patches contained into this tree.

 I don't think that's an issue, because apply-patches will be called with 
*.patch as a pattern - the version-specific directories will not be called
*.patch.


> I would like to keep it because I was thinking of debian-patches like: a
> structure with several directories where we may find some patches. From the
> top of my head I think it's not the case for debian-patches because patches
> are located at the root level but I presume that we could face this kind of
> patch.

 If you don't have a concrete use case, I would leave this feature out.
Otherwise you don't even know if it does work in practice.  We can always
add the feature again later if it turns out to be required.

 ThomasDS (in CC) has a use case of a tar file containing patches.  Maybe
he has a concrete use case.

 Regards,
 Arnout


-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-02-16  9:45 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-06  1:47 [Buildroot] [RFC PATCH]apply-patches.sh: big update (new directory and archive management) ludovic.desroches at atmel.com
2012-02-06  1:47 ` [Buildroot] [RFC PATCH 1/6] apply-patches.sh: check if there are rejects before applying patches ludovic.desroches at atmel.com
2012-02-10 21:43   ` Arnout Vandecappelle
2012-02-15 16:55     ` Ludovic Desroches
2012-02-15 22:33       ` [Buildroot] [RFC PATCH v2 " ludovic.desroches at atmel.com
2012-02-15 20:56         ` Arnout Vandecappelle
2012-02-06  1:47 ` [Buildroot] [RFC PATCH 2/6] apply-patches.sh: rename targetdir to builddir ludovic.desroches at atmel.com
2012-02-10 21:45   ` Arnout Vandecappelle
2012-02-06  1:47 ` [Buildroot] [RFC PATCH 3/6] apply-patches.sh: cleanup ludovic.desroches at atmel.com
2012-02-10 21:45   ` Arnout Vandecappelle
2012-02-06  1:47 ` [Buildroot] [RFC PATCH 4/6] apply-patches.sh: directories are considered as a collection of patches ludovic.desroches at atmel.com
2012-02-10 22:40   ` Arnout Vandecappelle
2012-02-15 16:51     ` Ludovic Desroches
2012-02-15 23:06       ` [Buildroot] [RFC PATCH v2 " ludovic.desroches at atmel.com
2012-02-15 23:49         ` Arnout Vandecappelle
2012-02-16  7:56           ` Ludovic Desroches
2012-02-16  8:49       ` [Buildroot] [RFC PATCH " Ludovic Desroches
2012-02-16  9:45         ` Arnout Vandecappelle
2012-02-06  1:47 ` [Buildroot] [RFC PATCH 5/6] apply-patches.sh: add recursivity when scanning patchdir ludovic.desroches at atmel.com
2012-02-06  1:47 ` [Buildroot] [RFC PATCH 6/6] apply-patches.sh: change archive management ludovic.desroches at atmel.com
2012-02-10 22:48   ` Arnout Vandecappelle
2012-02-15 16:54     ` Ludovic Desroches
2012-02-15 23:09       ` [Buildroot] [RFC PATCH v2 " ludovic.desroches at atmel.com
2012-02-15 23:54         ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.