2 2

[alpine-devel] [PATCH] Remove *.la files by default

Bartłomiej Piotrowski
Details
Message ID
<1417803938-31292-1-git-send-email-b@bpiotrowski.pl>
Sender timestamp
1417803938
DKIM signature
missing
Download raw message
Patch: +5 -6
Libtool archives are useless in the most of cases and can be safely
removed. A quick grep shows that *.la files are explicitly removed in
903 APKBUILDs, while intentionally preserved only in 17.

postcheck() is discussable place to perform the deletion, but it's
currently the only function being run for each subpackage, including
the artifact of package().
---
 abuild.in | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/abuild.in b/abuild.in
index 5459a9b..1ccb1e4 100644
--- a/abuild.in
+++ b/abuild.in
@@ -616,13 +616,12 @@ postcheck() {
 			return 1
 		fi
 	fi
-	# look for *.la files
-	i=$(find "$dir" -name '*.la' | sed "s|^$dir|\t|")
-	if [ -n "$i" ] && ! options_has "libtool"; then
-		error "Libtool archives (*.la) files found and \$options has no 'libtool' flag:"
-		echo "$i"
-		return 1
+
+	# remove *.la files if libtool is not set
+	if ! options_has "libtool"; then
+		find "$dir" -name '*.la' -type f -delete
 	fi
+
 	# look for /usr/lib/charset.alias
 	if [ -e "$dir"/usr/lib/charset.alias ] \
 			&& ! options_has "charset.alias"; then
-- 
2.1.3


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---

[alpine-devel] [PATCH v2] abuild: remove *.la files by default

Bartłomiej Piotrowski
Details
Message ID
<1417804626-32460-1-git-send-email-b@bpiotrowski.pl>
In-Reply-To
<1417803938-31292-1-git-send-email-b@bpiotrowski.pl> (view parent)
Sender timestamp
1417804626
DKIM signature
missing
Download raw message
Patch: +5 -6
Libtool archives are useless in the most of cases and can be safely
removed. A quick grep shows that *.la files are explicitly removed in
903 APKBUILDs, while intentionally preserved only in 17.

postcheck() is discussable place to perform the deletion, but it's
currently the only function being run for each subpackage, including
the artifact of package().
---
 abuild.in | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/abuild.in b/abuild.in
index 5459a9b..1ccb1e4 100644
--- a/abuild.in
+++ b/abuild.in
@@ -616,13 +616,12 @@ postcheck() {
 			return 1
 		fi
 	fi
-	# look for *.la files
-	i=$(find "$dir" -name '*.la' | sed "s|^$dir|\t|")
-	if [ -n "$i" ] && ! options_has "libtool"; then
-		error "Libtool archives (*.la) files found and \$options has no 'libtool' flag:"
-		echo "$i"
-		return 1
+
+	# remove *.la files if libtool is not set
+	if ! options_has "libtool"; then
+		find "$dir" -name '*.la' -type f -delete
 	fi
+
 	# look for /usr/lib/charset.alias
 	if [ -e "$dir"/usr/lib/charset.alias ] \
 			&& ! options_has "charset.alias"; then
-- 
2.1.3


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---

Re: [alpine-devel] [PATCH v2] abuild: remove *.la files by default

Natanael Copa
Details
Message ID
<20141215160312.40910e46@ncopa-desktop.alpinelinux.org>
In-Reply-To
<1417804626-32460-1-git-send-email-b@bpiotrowski.pl> (view parent)
Sender timestamp
1418655792
DKIM signature
missing
Download raw message
On Fri,  5 Dec 2014 19:37:06 +0100
Bart*omiej Piotrowski <b@bpiotrowski.pl> wrote:

> Libtool archives are useless in the most of cases and can be safely
> removed. A quick grep shows that *.la files are explicitly removed in
> 903 APKBUILDs, while intentionally preserved only in 17.
> 
> postcheck() is discussable place to perform the deletion, but it's
> currently the only function being run for each subpackage, including
> the artifact of package().

I agree that postcheck is not optimal, but I don't have any better
suggestions atm either. Applied as is.

This will be included in next abuild release, 2.22.0.

Thanks!


-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---