Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Bo Ørsted Andresen <bo.andresen@...>
Subject: Re: Re: perl-module.eclass -- review - 2
Date: Mon, 2 Mar 2009 13:01:41 +0100
On Monday 02 March 2009 08:24:35 Torsten Veller wrote:
> > > 	find "${D}/${VENDOR_LIB}" -type f -a \( -name .packlist \
> > > 		-o \( -name '*.bs' -a -empty \) \) -delete
> > > 	find "${D}/${VENDOR_LIB}" -depth -mindepth 1 -type d -empty -delete
> >
> > I'm curious how portable the find () construct is. Do you know?

It was established well over a year ago that find in the ebuild environment 
must be GNU find. Using portable find is not worth the pain.

[...]
> > Could you just use dosed here?

dosed needs to die.

[...]
> BTW: After I looked up the devmanual part about "find" above, I wonder:
> | find "${S}" -type f | while read f ; do
> | [...]
> | for f in $(find "${S}" -type f) ; do
> | [...]
> | Warning
> | In both cases, files with weird characters or spaces in their names may
> | cause serious problems.

The while loop breaks with leading or trailing spaces in the path. If the 
spaces are anywhere else in the path it works. The for loop breaks with spaces 
regardless of where they are. And you can of course come up with weird 
characters that break them both.

If you really want to do better use:

  find "${S}" -print0 | while read -rd '' f; do
      if file "${f}" ...
  done

You also really should provide proper die messages.

-- 
Bo Andresen


Replies:
Re: Re: perl-module.eclass -- review - 2
-- Peter Volkov
References:
perl-module.eclass -- review
-- Torsten Veller
Re: Re: perl-module.eclass -- review - 2
-- Donnie Berkholz
Re: perl-module.eclass -- review - 2
-- Torsten Veller
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: perl-module.eclass -- review - 2
Next by thread:
Re: Re: perl-module.eclass -- review - 2
Previous by date:
package.use in profiles and IUSE defaults
Next by date:
Re: perl-module.eclass -- review


Updated Jun 17, 2009

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.