Skip to contentSkip to conversation

core/pkg-autotools: don't use APPLY_PATCHES for libtool patches

PATCH New Romain Naour 3 participants 9 messages Aug 17, 2016 – Aug 19, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 core/pkg-autotools: don't use APPLY_PATCHES for libtool patches

Since [1] <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 uses AUTORECONF, the libtool patch can be applied a second time on the same ltmain.sh in the same directory as the <package>-reconfigure target is called. This is not a problem since autoreconf will overwrite the previously patched files. But with the check introduced by [1], apply-patches.sh throw an error when the package is reconfigured since the libtool patch is already present in .applied_patches_list.

In addition to this, the .applied_patches_list file generated by apply-patches.sh while patching ltmain.sh is not in the top-level package source directory. Instead a duplicated .applied_patches_list is generated beside the patched ltmain.sh which can be in a subdirectory.

As noticed by Arnout Vandecappelle [2], the apply-patches.sh script doesn't bring anything for the libtool patches.

"apply_patches.sh does the following:

* It handles directories -> not needed here.
* It handles compressed patches and tarballs -> not needed.
* It handles series files -> not needed.
* It handles errors in case of multiple patches -> not needed since it's only one patch.
* It detects errors based on *.rej files -> not needed since it's only a single patch so patch exit code is OK.
* It writes the patch list -> for libtool, this is quite silly because it will be written in the directory where ltmain.sh is found, not in the top-level directory, so you have these patch lists spread over the source tree."

So use patch directly rather than apply-patches.

[1] 19241598147e7555dce40b6dd44b28ef22b67ed9
[2] http://lists.busybox.net/pipermail/buildroot/2016-August/169810.html

---
v2: improve the commit log (Arnout)

---
 package/pkg-autotools.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
package/pkg-autotools.mk +4 -4
index 75e2df0..d1cdb89 100644
@@ -65,14 +65,14 @@ define LIBTOOL_PATCH_HOOK
 		ltmain_patchlevel=`sed -n '/^[ \t]*VERSION=/{s/^[ \t]*VERSION=//;p;q;}' $$i | \
 		sed -e 's/\([0-9]*\.[0-9]*\.*\)\([0-9]*\).*/\2/' -e 's/\"//'`; \
 		if test $${ltmain_version} = '1.5'; then \
-			$(APPLY_PATCHES) $${i%/*} support/libtool buildroot-libtool-v1.5.patch; \
+			patch -i support/libtool/buildroot-libtool-v1.5.patch $${i}; \
 		elif test $${ltmain_version} = "2.2"; then\
-			$(APPLY_PATCHES) $${i%/*} support/libtool buildroot-libtool-v2.2.patch; \
+			patch -i support/libtool/buildroot-libtool-v2.2.patch $${i}; \
 		elif test $${ltmain_version} = "2.4"; then\
 			if test $${ltmain_patchlevel:-0} -gt 2; then\
-				$(APPLY_PATCHES) $${i%/*} support/libtool buildroot-libtool-v2.4.4.patch; \
+				patch -i support/libtool/buildroot-libtool-v2.4.4.patch $${i}; \
 			else \
-				$(APPLY_PATCHES) $${i%/*} support/libtool buildroot-libtool-v2.4.patch; \
+				patch -i support/libtool/buildroot-libtool-v2.4.patch $${i}; \
 			fi \
 		fi \
 	done
Signature · 1 line
2.5.5
#1 lore raw

PATCH v2 2/3 docs: update legal-notice.txt

Since 1273636fc686cd788b6de87be75dd0726cf8676c applied patches are also saved.

Cc "Yann E. MORIN" <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
---
 docs/manual/legal-notice.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
docs/manual/legal-notice.txt +3 -3
index 0572dae..a4911f7 100644
@@ -41,9 +41,9 @@ There you will find:
   +host-sources/+ subdirectories for target and host packages respectively.
   The source code for packages that set +<PKG>_REDISTRIBUTE = NO+ will not be
   saved.
-  Patches applied to some packages by Buildroot are distributed with the
-  Buildroot sources and are not duplicated in the +sources/+ and +host-sources/+
-  subdirectories.
+  Patches that were applied are also saved, along with a file named +series+
+  that lists the patches in the order they were applied. Patches are under the
+  same license as the files that they modify.
 * A manifest file (one for host and one for target packages) listing the
   configured packages, their version, license and related information.
   Some of this information might not be defined in Buildroot; such items are
Signature · 1 line
2.5.5
#2 lore raw

PATCH v2 2/3 docs: update legal-notice.txt

Romain, All,

On 2016-08-17 18:01 +0200, Romain Naour spake thusly:

Quoted 7 lines

Since 1273636fc686cd788b6de87be75dd0726cf8676c applied patches are also saved.

Cc "Yann E. MORIN" <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>

Regards,
Yann E. MORIN.

Quoted 24 lines
---
 docs/manual/legal-notice.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
docs/manual/legal-notice.txt +3 -3
index 0572dae..a4911f7 100644
@@ -41,9 +41,9 @@ There you will find:
   +host-sources/+ subdirectories for target and host packages respectively.
   The source code for packages that set +<PKG>_REDISTRIBUTE = NO+ will not be
   saved.
-  Patches applied to some packages by Buildroot are distributed with the
-  Buildroot sources and are not duplicated in the +sources/+ and +host-sources/+
-  subdirectories.
+  Patches that were applied are also saved, along with a file named +series+
+  that lists the patches in the order they were applied. Patches are under the
+  same license as the files that they modify.
 * A manifest file (one for host and one for target packages) listing the
   configured packages, their version, license and related information.
   Some of this information might not be defined in Buildroot; such items are
Signature · 1 line
2.5.5
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH v2 2/3 docs: update legal-notice.txt

In reply to Romain Naour

Hello,

Quoted 10 lines · Romain Naour

Since 1273636fc686cd788b6de87be75dd0726cf8676c applied patches are also saved.

Cc "Yann E. MORIN" <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
---
 docs/manual/legal-notice.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH v2 3/3 docs: libtool patches are not handled by legal-info infrastructure.

In reply to Romain Naour
Cc "Yann E. MORIN" <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
---
 docs/manual/legal-notice.txt     | 4 ++++
 support/legal-info/README.header | 4 ++++
 2 files changed, 8 insertions(+)
docs/manual/legal-notice.txt +4 -0
index a4911f7..fd1e5aa 100644
@@ -44,6 +44,10 @@ There you will find:
   Patches that were applied are also saved, along with a file named +series+
   that lists the patches in the order they were applied. Patches are under the
   same license as the files that they modify.
+  Note: Buildroot applies additional patches to Libtool scripts of
+  autotools-based packages. These patches can be found under +support/libtool+
+  in the buildroot source and are not saved with the package sources due to
+  technical limitations. You may need to collect them manually.
 * A manifest file (one for host and one for target packages) listing the
   configured packages, their version, license and related information.
   Some of this information might not be defined in Buildroot; such items are
support/legal-info/README.header +4 -0
index 1f3524f..ee34886 100644
@@ -20,6 +20,10 @@ This material is composed of the following items.
    with a file named 'series' that lists the patches in the order they were
    applied. Patches are under the same license as the files that they modify
    in the original package.
+   Note: Buildroot applies additional patches to Libtool scripts of
+   autotools-based packages. These patches can be found under support/libtool
+   in the buildroot source and are not saved with the package sources due to
+   technical limitations. You may need to collect them manually.
  * A manifest file listing the configured packages and related information.
  * The license text of the packages; they have been saved in the licenses/
    subdirectory.
Signature · 1 line
2.5.5
#5 lore raw

PATCH v2 3/3 docs: libtool patches are not handled by legal-info infrastructure.

Romain, All,

On 2016-08-17 18:01 +0200, Romain Naour spake thusly:

Quoted 14 lines
Cc "Yann E. MORIN" <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
---
 docs/manual/legal-notice.txt     | 4 ++++
 support/legal-info/README.header | 4 ++++
 2 files changed, 8 insertions(+)
docs/manual/legal-notice.txt +0 -0
index a4911f7..fd1e5aa 100644

docs/manual/legal-notice.txt There you will find: · line 50

Quoted 7 lines
docs/manual/legal-notice.txt +4 -0
@@ -44,6 +44,10 @@ There you will find:
   Patches that were applied are also saved, along with a file named +series+
   that lists the patches in the order they were applied. Patches are under the
   same license as the files that they modify.
+  Note: Buildroot applies additional patches to Libtool scripts of
+  autotools-based packages. These patches can be found under +support/libtool+
+  in the buildroot source and are not saved with the package sources due to
+  technical limitations. You may need to collect them manually.

I would have said:

[...] and, due to technical limitations, are not saved with the other patches.

(Ditto below, of course).

Otherwise:

Regards,
Yann E. MORIN.

Quoted 21 lines
docs/manual/legal-notice.txt +0 -0
 * A manifest file (one for host and one for target packages) listing the
   configured packages, their version, license and related information.
   Some of this information might not be defined in Buildroot; such items are
support/legal-info/README.header +4 -0
index 1f3524f..ee34886 100644
@@ -20,6 +20,10 @@ This material is composed of the following items.
    with a file named 'series' that lists the patches in the order they were
    applied. Patches are under the same license as the files that they modify
    in the original package.
+   Note: Buildroot applies additional patches to Libtool scripts of
+   autotools-based packages. These patches can be found under support/libtool
+   in the buildroot source and are not saved with the package sources due to
+   technical limitations. You may need to collect them manually.
  * A manifest file listing the configured packages and related information.
  * The license text of the packages; they have been saved in the licenses/
    subdirectory.
Signature · 1 line
2.5.5
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH v2 3/3 docs: libtool patches are not handled by legal-info infrastructure.

In reply to Romain Naour

Hello,

Quoted 8 lines · Romain Naour
Cc "Yann E. MORIN" <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
---
 docs/manual/legal-notice.txt     | 4 ++++
 support/legal-info/README.header | 4 ++++
 2 files changed, 8 insertions(+)

Applied to master, after taking into account the suggestion from Yann (hopefully correctly).

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#7 lore raw

PATCH v2 3/3 docs: libtool patches are not handled by legal-info infrastructure.

Thomas, Romain, All,

On 2016-08-19 23:34 +0200, Thomas Petazzoni spake thusly:

Quoted 10 lines · Romain Naour
Quoted 8 lines
Cc "Yann E. MORIN" <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Arnout Vandecappelle <[email protected]>
---
 docs/manual/legal-notice.txt     | 4 ++++
 support/legal-info/README.header | 4 ++++
 2 files changed, 8 insertions(+)
Quoted 2 lines

Applied to master, after taking into account the suggestion from Yann (hopefully correctly).

Yep, good. Thanks! :-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH v2 1/3 core/pkg-autotools: don't use APPLY_PATCHES for libtool patches

In reply to Romain Naour

Hello,

Quoted 52 lines · Romain Naour

Since [1] <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 uses AUTORECONF, the libtool patch can be applied a second time on the same ltmain.sh in the same directory as the <package>-reconfigure target is called. This is not a problem since autoreconf will overwrite the previously patched files. But with the check introduced by [1], apply-patches.sh throw an error when the package is reconfigured since the libtool patch is already present in .applied_patches_list.

In addition to this, the .applied_patches_list file generated by apply-patches.sh while patching ltmain.sh is not in the top-level package source directory. Instead a duplicated .applied_patches_list is generated beside the patched ltmain.sh which can be in a subdirectory.

As noticed by Arnout Vandecappelle [2], the apply-patches.sh script doesn't bring anything for the libtool patches.

"apply_patches.sh does the following:

* It handles directories -> not needed here.
* It handles compressed patches and tarballs -> not needed.
* It handles series files -> not needed.
* It handles errors in case of multiple patches -> not needed since it's only one patch.
* It detects errors based on *.rej files -> not needed since it's only a single patch so patch exit code is OK.
* It writes the patch list -> for libtool, this is quite silly because it will be written in the directory where ltmain.sh is found, not in the top-level directory, so you have these patch lists spread over the source tree."

So use patch directly rather than apply-patches.

[1] 19241598147e7555dce40b6dd44b28ef22b67ed9
[2] http://lists.busybox.net/pipermail/buildroot/2016-August/169810.html

Quoted 5 lines

---
v2: improve the commit log (Arnout)

---
 package/pkg-autotools.mk | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com