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: Torsten Veller <ml-en@...>
Subject: Re: perl-module.eclass -- review - 2
Date: Mon, 2 Mar 2009 08:24:35 +0100
* Donnie Berkholz <dberkholz@g.o>:

Thanks for your comments.

> On 12:28 Sat 28 Feb     , Torsten Veller wrote:
> > case "${EAPI:-0}" in
> > 	0|1)
> > 		EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm src_compile src_install src_test src_unpack
> > 		;;
> > 	*)
> > 		EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install
> > 		;;
> > esac
> 
> Maybe this is just me, but I prefer to reserve '*' cases for the 
> fallback when I don't understand what I'm given.

As this is a general problem we should move it out of this thread.
I also think this should have been discussed months ago.


> > 	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?

http://www.opengroup.org/onlinepubs/000095399/utilities/find.html

The brackets are no problem.
But -mindepth and -delete are not in the specs:

| The -mindepth and -maxdepth options are GNU extensions that should be
| avoided if possible.                             (from devmanual.g.o)
Well, even the portage ebuild uses -mindepth. So should I replace it?

| The `-delete' action was introduced by the BSD family of operating
| systems                                         (from `info find`)
and is also used several times in the tree.


> > 	find "${D}" -type f -not -name '*.so' | while read f ; do
> > 		if file "${f}" | grep -q -i " text" ; then
> > if grep -q "${D}" "${f}" ; then ewarn "QA: File contains a temporary path ${f}" ; fi
> > 			sed -i -e "s:${D}:/:g" "${f}" || die
> 
> Could you just use dosed here?

I guess you mean the default expression?

dosed defaults to "s:${D}::g"
$D is supposed to end with a trailing slash.
-> is the path still absolute?

Strange at least.


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. 

Is there still a problem in the snippet above and is the following better
(if we assume that packages contain files with sane names)?

pushd "${D}" > /dev/null
for f in $(find . -type f -not -name '*.so' ) ; do
    if file "${f}" | grep -q -i " text" ; then
        sed -i -e "s:${D}:/:g" "${f}" || die
    fi
done
popd > /dev/null

Maybe i need some coffee.


Replies:
Re: Re: perl-module.eclass -- review - 2
-- Bo Ørsted Andresen
References:
perl-module.eclass -- review
-- Torsten Veller
Re: perl-module.eclass -- review - 2
-- Torsten Veller
Re: Re: perl-module.eclass -- review - 2
-- Donnie Berkholz
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: Re: perl-module.eclass -- review - 2
Next by thread:
Re: Re: perl-module.eclass -- review - 2
Previous by date:
Re: QA Overlay Layout support.
Next by date:
Re: Collecting opinions about GLEP 55 and alternatives


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.