Please review the following necessary changes for Prefix installs for portage-utils-0.9: --- portage-utils-0.9.ebuild 2011-12-22 21:46:03.000000000 +0100 +++ portage-utils-0.9.ebuild 2011-12-23 09:41:41.817814000 +0100 @@ -19,7 +19,7 @@ use static && append-ldflags -static # Avoid slow configure+gnulib+make if on an up-to-date Linux system - if ! use kernel_linux ; then + if use prefix || use !kernel_linux ; then econf --with-eprefix="${EPREFIX}" else tc-export CC @@ -34,22 +34,28 @@ doexe "${FILESDIR}"/post_sync || die insinto /etc/portage/postsync.d doins "${FILESDIR}"/q-reinitialize || die + + # Portage fixes shebangs, we just need to fix the paths in the files + sed -i \ + -e "s:\(/etc/portage/postsync.d\|/usr/bin/q\):${EPREFIX}&:g" \ + ${ED}/etc/portage/bin/post_sync \ + ${ED}/etc/portage/postsync.d/q-reinitialize || die } pkg_preinst() { # preserve +x bit on postsync files #301721 local x - pushd "${D}" >/dev/null + pushd "${ED}" >/dev/null for x in etc/portage/postsync.d/* ; do - [[ -x ${ROOT}/${x} ]] && chmod +x "${x}" + [[ -x ${EROOT}/${x} ]] && chmod +x "${x}" done } pkg_postinst() { - elog "/etc/portage/postsync.d/q-reinitialize has been installed for convenience" + elog "${EPREFIX}/etc/portage/postsync.d/q-reinitialize has been installed for convenience" elog "If you wish for it to be automatically run at the end of every --sync:" - elog " # chmod +x /etc/portage/postsync.d/q-reinitialize" + elog " # chmod +x ${EPREFIX}/etc/portage/postsync.d/q-reinitialize" elog "Normally this should only take a few seconds to run but file systems" elog "such as ext3 can take a lot longer. To disable, simply do:" - elog " # chmod -x /etc/portage/postsync.d/q-reinitialize" + elog " # chmod -x ${EPREFIX}/etc/portage/postsync.d/q-reinitialize" }
pkg_{pre,post}inst changes are fine the first hunk should be "use prefix || ! use kernel_linux" the 2nd hunk, i'm not sure about. is there a way this could be done in the configure script itself ? at least, you're missing quotes around ${ED} ...
(In reply to comment #1) > pkg_{pre,post}inst changes are fine > > the first hunk should be "use prefix || ! use kernel_linux" use understands "!xxxx", but I'll change it to "! use xxxx" if you like. > the 2nd hunk, i'm not sure about. is there a way this could be done in the > configure script itself ? at least, you're missing quotes around ${ED} ... Of course, if they were .in files and configure would expand paths in them. Quotes are indeed missing.
i know `use` supports that syntax (iirc, i added it), but i find it harder to quickly grok when scanning code. keeping the operators before the command keeps it clearer i think. for now, we can `sed` things, but long term, i'd like to see this in Makefile.am. the files don't need to be ".in" and have autoconf replace them ... you can run the sed yourself in an install-hook in Makefile.am.
I just committed the changes, and was about to make configure do its thing, until I realised that both files come from ${FILESDIR}, so not much configure-foo to add, unless we decide to move those files in the portage-utils repo (makes sense to me). Changing this bug to reflect the work left to be done.
oh, in that case, don't worry about it