public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: reavertm@gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH autotools-utils 5/9] Check command-line args completely in remove_libtool_files().
Date: Tue, 13 Sep 2011 16:10:29 +0200	[thread overview]
Message-ID: <1315923033-23397-5-git-send-email-mgorny@gentoo.org> (raw)
In-Reply-To: <1315923033-23397-1-git-send-email-mgorny@gentoo.org>

---
 eclass/autotools-utils.eclass |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/eclass/autotools-utils.eclass b/eclass/autotools-utils.eclass
index fd644bb..84f6cb6 100644
--- a/eclass/autotools-utils.eclass
+++ b/eclass/autotools-utils.eclass
@@ -144,6 +144,17 @@ _check_build_dir() {
 # See autotools-utils_src_install for reference.
 remove_libtool_files() {
 	debug-print-function ${FUNCNAME} "$@"
+	local removing_all
+	[[ ${#} -le 1 ]] || die "Invalid number of args to ${FUNCNAME}()"
+	if [[ ${#} -eq 1 ]]; then
+		case "${1}" in
+			all)
+				removing_all=1
+				;;
+			*)
+				die "Invalid argument to ${FUNCNAME}(): ${1}"
+		esac
+	fi
 
 	local f
 	find "${D}" -type f -name '*.la' -print0 | while read -r -d '' f; do
@@ -154,7 +165,7 @@ remove_libtool_files() {
 		# Keep .la files when:
 		# - they have shouldnotlink=yes - likely plugins,
 		# - respective static archive exists.
-		if [[ "$1" == 'all' || ( -z ${shouldnotlink} && ! -f ${archivefile} ) ]]; then
+		if [[ ${removing_all} || ( -z ${shouldnotlink} && ! -f ${archivefile} ) ]]; then
 			einfo "Removing unnecessary ${f#${D%/}}"
 			rm -f "${f}" || die
 		fi
-- 
1.7.6.1




  parent reply	other threads:[~2011-09-13 14:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-12 19:57 [gentoo-dev] [PATCH] autotools-utils.eclass: punt unnecessary .la files even w/ USE=static-libs Michał Górny
2011-09-12 21:00 ` Donnie Berkholz
2011-09-12 21:46   ` Samuli Suominen
2011-09-12 21:51     ` Donnie Berkholz
2011-09-12 22:34       ` Samuli Suominen
2011-09-12 21:58   ` Michał Górny
2011-09-12 22:10     ` Donnie Berkholz
2011-09-13  6:40       ` Michał Górny
2011-09-13 14:10 ` [gentoo-dev] [PATCH autotools-utils 1/9] Fix handling whitespace in filenames when looking for .la files Michał Górny
2011-09-13 14:10   ` [gentoo-dev] [PATCH autotools-utils 2/9] Strip ${D} from removal message to shorten it Michał Górny
2011-09-13 14:10   ` [gentoo-dev] [PATCH autotools-utils 3/9] For .la removal, look for static archives rather than USE=static-libs Michał Górny
2011-09-13 14:10   ` [gentoo-dev] [PATCH autotools-utils 4/9] Clean up & simplify la removal code a little Michał Górny
2011-09-13 14:10   ` Michał Górny [this message]
2011-09-13 14:10   ` [gentoo-dev] [PATCH autotools-utils 6/9] Refactor remove_libtool_files() to simplify conditions Michał Górny
2011-09-13 14:10   ` [gentoo-dev] [PATCH autotools-utils 7/9] Drop 'empty' .la files as well (those lacking libs & flags) Michał Górny
2011-09-13 14:10   ` [gentoo-dev] [PATCH autotools-utils 8/9] Remove static libs covered by .pc files as well Michał Górny
2011-09-13 14:10   ` [gentoo-dev] [PATCH autotools-utils 9/9] Explain .la removal reasons in output Michał Górny
2011-09-13 15:13   ` [gentoo-dev] [PATCH autotools-utils 1/9] Fix handling whitespace in filenames when looking for .la files Dirkjan Ochtman
2011-09-13 16:23     ` Nirbheek Chauhan
2011-09-16 13:45       ` Donnie Berkholz
2011-09-13 18:33     ` Michał Górny

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=1315923033-23397-5-git-send-email-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=reavertm@gentoo.org \
    /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