List Archive: gentoo-dev
* 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.
|
|