public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH eutils] Move remove_libtool_files() from autotools-utils for wider use.
Date: Thu, 31 May 2012 02:09:11 -0400	[thread overview]
Message-ID: <201205310209.12438.vapier@gentoo.org> (raw)
In-Reply-To: <20120531074641.73b93222@pomiocik.lan>

[-- Attachment #1: Type: Text/Plain, Size: 2068 bytes --]

On Thursday 31 May 2012 01:46:41 Michał Górny wrote:
> On Wed, 30 May 2012 17:19:49 -0400 Mike Frysinger wrote:
> > On Monday 28 May 2012 03:58:56 Michał Górny wrote:
> > > +# @USAGE: [all]
> > 
> > this is incorrect.  the usage is:
> > 	<all | files to remove>
> 
> No, it's perfectly valid. Moreover, it even explains what the function
> actually does rather than your imagination.

why are you so angry all the time ?  try being less confrontational for once.

going from the usage:
	remove_libtool_files [all]

that means this may be called in only two ways:
1)	remove_libtool_files
2)	remove_libtool_files all

yet, if you read the actual code, you'll see:
+	[[ ${#} -le 1 ]] || die "Invalid number of args to ${FUNCNAME}()"
+	if [[ ${#} -eq 1 ]]; then
+	...
+	fi

that means if more than 1 argument is passed, no error is thrown.  i thought 
you were intending to parse $@ further on because of it (hence the suggestion 
of updating the @USAGE), but it looks merely like your arg parsing is 
incorrect and needs fixing.  probably easiest by doing:
	case $#:$1 in
	0:'') ;;
	1:all) removing_all=1 ;;
	*) die "invalid usage" ;;
	esac

> > although, since we don't call die or anything, we can pipeline it to
> > speed things up a bit:
> > 	pc_libs=( $(
> > 		tpc="${T}/.pc"
> > 		find "${D}" -name '*.pc' -type f | \
> > 		while read pc ; do
> > 			sed -e '/^Requires:/d' "${pc}" > "${tpc}"
> > 			$(tc-getPKG_CONFIG) --libs "${tpc}"
> > 		done | tr ' ' '\n' | sort -u | \
> > 		sed -n '/^-l/{s:^-l:lib:;s:$:.la:;p}'
> > 		rm -f "${tpc}"
> > 	) )
> 
> Could you remind me, please, what performance-critical use of this
> function does justify making it so harsh?

looks perfectly fine to me, and it has the bonus of working

> > > +			rm -f "${archivefile}" || die
> > 
> > `rm -f` almost never fails.  in the edge cases where it does, you've
> > got bigger problems.
> 
> And that problem is good enough to die here.

more like the system at large is going to be falling over independently
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2012-05-31  6:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-28  7:58 [gentoo-dev] [PATCH eutils] Move remove_libtool_files() from autotools-utils for wider use Michał Górny
2012-05-28  9:03 ` Pacho Ramos
2012-05-29 13:50 ` [gentoo-dev] " Steven J Long
2012-05-29 14:26   ` Steven J Long
2012-05-30 17:16   ` Michał Górny
2012-05-30 21:19 ` [gentoo-dev] " Mike Frysinger
2012-05-31  5:46   ` Michał Górny
2012-05-31  6:09     ` Mike Frysinger [this message]
2012-05-31 11:40       ` Michał Górny
2012-05-31 12:55   ` [gentoo-dev] [PATCH eutils] Introduce prune_libtool_files() Michał Górny
2012-06-05  6:00     ` Mike Frysinger
2012-06-06 15:40       ` Michał Górny
2012-06-05  2:46 ` [gentoo-dev] Re: [PATCH eutils] Move remove_libtool_files() from autotools-utils for wider use Ryan Hill

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=201205310209.12438.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gentoo-dev@lists.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