Gentoo Archives: gentoo-dev

From: Torsten Veller <ml-en@××××××.net>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] Re: perl-module.eclass -- review - 2
Date: Mon, 02 Mar 2009 07:25:58
Message-Id: 20090302053455.TA31dba.tv@veller.net
In Reply to: Re: [gentoo-dev] Re: perl-module.eclass -- review - 2 by Donnie Berkholz
1 * Donnie Berkholz <dberkholz@g.o>:
2
3 Thanks for your comments.
4
5 > On 12:28 Sat 28 Feb , Torsten Veller wrote:
6 > > case "${EAPI:-0}" in
7 > > 0|1)
8 > > EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm src_compile src_install src_test src_unpack
9 > > ;;
10 > > *)
11 > > EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install
12 > > ;;
13 > > esac
14 >
15 > Maybe this is just me, but I prefer to reserve '*' cases for the
16 > fallback when I don't understand what I'm given.
17
18 As this is a general problem we should move it out of this thread.
19 I also think this should have been discussed months ago.
20
21
22 > > find "${D}/${VENDOR_LIB}" -type f -a \( -name .packlist \
23 > > -o \( -name '*.bs' -a -empty \) \) -delete
24 > > find "${D}/${VENDOR_LIB}" -depth -mindepth 1 -type d -empty -delete
25 >
26 > I'm curious how portable the find () construct is. Do you know?
27
28 http://www.opengroup.org/onlinepubs/000095399/utilities/find.html
29
30 The brackets are no problem.
31 But -mindepth and -delete are not in the specs:
32
33 | The -mindepth and -maxdepth options are GNU extensions that should be
34 | avoided if possible. (from devmanual.g.o)
35 Well, even the portage ebuild uses -mindepth. So should I replace it?
36
37 | The `-delete' action was introduced by the BSD family of operating
38 | systems (from `info find`)
39 and is also used several times in the tree.
40
41
42 > > find "${D}" -type f -not -name '*.so' | while read f ; do
43 > > if file "${f}" | grep -q -i " text" ; then
44 > > if grep -q "${D}" "${f}" ; then ewarn "QA: File contains a temporary path ${f}" ; fi
45 > > sed -i -e "s:${D}:/:g" "${f}" || die
46 >
47 > Could you just use dosed here?
48
49 I guess you mean the default expression?
50
51 dosed defaults to "s:${D}::g"
52 $D is supposed to end with a trailing slash.
53 -> is the path still absolute?
54
55 Strange at least.
56
57
58 BTW: After I looked up the devmanual part about "find" above, I wonder:
59 | find "${S}" -type f | while read f ; do
60 | [...]
61 | for f in $(find "${S}" -type f) ; do
62 | [...]
63 | Warning
64 | In both cases, files with weird characters or spaces in their names may
65 | cause serious problems.
66
67 Is there still a problem in the snippet above and is the following better
68 (if we assume that packages contain files with sane names)?
69
70 pushd "${D}" > /dev/null
71 for f in $(find . -type f -not -name '*.so' ) ; do
72 if file "${f}" | grep -q -i " text" ; then
73 sed -i -e "s:${D}:/:g" "${f}" || die
74 fi
75 done
76 popd > /dev/null
77
78 Maybe i need some coffee.

Replies

Subject Author
Re: [gentoo-dev] Re: perl-module.eclass -- review - 2 "Bo Ørsted Andresen" <bo.andresen@××××.dk>