Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] support/apply-patches: don't bail-out on libtool patch while using <package>-reconfigure
Date: Sun, 14 Aug 2016 02:00:46 +0200	[thread overview]
Message-ID: <20160814000046.GE5734@free.fr> (raw)
In-Reply-To: <1471129615-12376-1-git-send-email-romain.naour@gmail.com>

Romain, All,

On 2016-08-14 01:06 +0200, Romain Naour spake thusly:
> Since 19241598147e7555dce40b6dd44b28ef22b67ed9 <package>-reconfigure target is
> broken.
> 
> $ make elementary-reconfigure
> Applying buildroot-libtool-v2.4.4.patch using patch:
> Error: duplicate filename 'buildroot-libtool-v2.4.4.patch'
> Conflicting files are:
>   already applied: buildroot/support/libtool/buildroot-libtool-v2.4.4.patch
>   to be applied  : buildroot/support/libtool/buildroot-libtool-v2.4.4.patch
> 
> When a package use AUTORECONF, the libtool patch can be applied many
> times as the <package>-reconfigure target is called. This is not a
> problem since autoreconf will overwrite the previously patched files.
> 
> Don't bail-out on libtool patch if already present in .applied_patches_list.
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  support/scripts/apply-patches.sh | 18 ++++++++++++------
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
> index 7ccb39d..11b218f 100755
> --- a/support/scripts/apply-patches.sh
> +++ b/support/scripts/apply-patches.sh
> @@ -107,13 +107,19 @@ function apply_patch {
>      fi
>      existing="$(grep -E "/${patch}\$" ${builddir}/.applied_patches_list || true)"
>      if [ -n "${existing}" ]; then
> -        echo "Error: duplicate filename '${patch}'"
> -        echo "Conflicting files are:"
> -        echo "  already applied: ${existing}"
> -        echo "  to be applied  : ${path}/${patch}"
> -        exit 1
> +        # When a package use AUTORECONF, the libtool patch can be applied many
> +        # times as the <package>-reconfigure target is called. This is not a
> +        # problem since autoreconf will overwrite the previously patched files.
> +        if [[ ${patch} != buildroot-libtool-v*.patch ]]; then

I'm not very fond of treating the patch name as a magic value. Rather,
I would suggest we add an option to apply-patches.sh to not fail on a
duplicate patch.

And at the same time, turn all positional arguments into options, so
that it becomes easy to manage.

Regards,
Yann E. MORIN.

> +            echo "Error: duplicate filename '${patch}'"
> +            echo "Conflicting files are:"
> +            echo "  already applied: ${existing}"
> +            echo "  to be applied  : ${path}/${patch}"
> +            exit 1
> +        fi
> +    else
> +        echo "${path}/${patch}" >> ${builddir}/.applied_patches_list
>      fi
> -    echo "${path}/${patch}" >> ${builddir}/.applied_patches_list
>      ${uncomp} "${path}/$patch" | patch -g0 -p1 -E -d "${builddir}" -t -N $silent
>      if [ $? != 0 ] ; then
>          echo "Patch failed!  Please fix ${patch}!"
> -- 
> 2.5.5
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2016-08-14  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-13 23:06 [Buildroot] [PATCH] support/apply-patches: don't bail-out on libtool patch while using <package>-reconfigure Romain Naour
2016-08-14  0:00 ` Yann E. MORIN [this message]
2016-08-14 15:21 ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160814000046.GE5734@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox