Skip to contentSkip to conversation

pkg-autotools: fix patching libtool for version 2.4

PATCH New Yann E. MORIN 2 participants 2 messages Jan 26, 2015 – Feb 1, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pkg-autotools: fix patching libtool for version 2.4

If the libtool used by the package is 2.4 (i.e. with no patchlevel), we end up with a confusing message:

/bin/sh: line 0: test: -gt: unary operator expected

That's because patchlevel is empty, and thus there is nothing to comapre to 2, and test complains.

Fake a patchlevel of 0 (which is really what a missing patchlevel means anyway) in that case.

Cc Thomas Petazzoni <[email protected]>
Cc Peter Korsgaard <[email protected]>
---
 package/pkg-autotools.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-autotools.mk +1 -1
index b20e20e..b6b83f8 100644
@@ -69,7 +69,7 @@ define LIBTOOL_PATCH_HOOK
 		elif test $${ltmain_version} = "2.2"; then\
 			$(APPLY_PATCHES) $${i%/*} support/libtool buildroot-libtool-v2.2.patch; \
 		elif test $${ltmain_version} = "2.4"; then\
-			if test $${ltmain_patchlevel} -gt 2; then\
+			if test $${ltmain_patchlevel:-0} -gt 2; then\
 				$(APPLY_PATCHES) $${i%/*} support/libtool buildroot-libtool-v2.4.4.patch; \
 			else \
 				$(APPLY_PATCHES) $${i%/*} support/libtool buildroot-libtool-v2.4.patch; \
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 pkg-autotools: fix patching libtool for version 2.4

Dear Yann E. MORIN,

Quoted 11 lines · Yann E. MORIN

If the libtool used by the package is 2.4 (i.e. with no patchlevel), we end up with a confusing message:

/bin/sh: line 0: test: -gt: unary operator expected

That's because patchlevel is empty, and thus there is nothing to comapre to 2, and test complains.

Fake a patchlevel of 0 (which is really what a missing patchlevel means anyway) in that case.

Quoted 6 lines
Cc Thomas Petazzoni <[email protected]>
Cc Peter Korsgaard <[email protected]>
---
 package/pkg-autotools.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Thomas

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