summaryrefslogtreecommitdiffstats
path: root/bin/misc-functions.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-05-22 06:27:32 +0000
committerZac Medico <zmedico@gentoo.org>2007-05-22 06:27:32 +0000
commit29fd2e335caa465372eb35a1b65ecdf9a37f83a6 (patch)
tree556544d3719f854f1a67a20841068226a5071e27 /bin/misc-functions.sh
parente258a70559dfb3720f8370c483241e2487e88a97 (diff)
downloadportage-29fd2e335caa465372eb35a1b65ecdf9a37f83a6.tar.gz
portage-29fd2e335caa465372eb35a1b65ecdf9a37f83a6.tar.bz2
portage-29fd2e335caa465372eb35a1b65ecdf9a37f83a6.zip
When ${PKGDIR}/All/ doesn't exist, put packages in ${PKGDIR}/${CATEGORY}/ instead. This new layout is backward compatible with portage-2.1.2 and it will be a requirement for new PORTAGE_BINHOST support that is comming.
svn path=/main/trunk/; revision=6568
Diffstat (limited to 'bin/misc-functions.sh')
-rwxr-xr-xbin/misc-functions.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index d7aa9b05f..86d13292d 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -496,13 +496,18 @@ preinst_selinux_labels() {
dyn_package() {
cd "${PORTAGE_BUILDDIR}/image"
install_mask "${PORTAGE_BUILDDIR}/image" ${PKG_INSTALL_MASK}
- local pkg_dest="${PKGDIR}/All/${PF}.tbz2"
- local pkg_tmp="${PKGDIR}/All/${PF}.tbz2.$$"
+ if [ -d "${PKGDIR}/All" ] ; then
+ local pkg_dest="${PKGDIR}/All/${PF}.tbz2"
+ else
+ local pkg_dest="${PKGDIR}/${CATEGORY}/${PF}.tbz2"
+ fi
+ local pkg_tmp="${pkg_dest}.$$"
local tar_options=""
[ "${PORTAGE_QUIET}" == "1" ] || tar_options="${tar_options} -v"
# Sandbox is disabled in case the user wants to use a symlink
# for $PKGDIR and/or $PKGDIR/All.
export SANDBOX_ON="0"
+ mkdir -p "${pkg_tmp%/*}" || die "mkdir failed"
tar ${tar_options} -cf - . | bzip2 -f > "${pkg_tmp}" || \
die "Failed to create tarball"
cd ..
@@ -513,7 +518,10 @@ dyn_package() {
die "Failed to append metadata to the tbz2 file"
fi
mv -f "${pkg_tmp}" "${pkg_dest}" || die "Failed to move tbz2 to ${pkg_dest}"
- ln -sf "../All/${PF}.tbz2" "${PKGDIR}/${CATEGORY}/${PF}.tbz2" || die "Failed to create symlink in ${PKGDIR}/${CATEGORY}"
+ if [ -d "${PKGDIR}/All" ] ; then
+ ln -sf "../All/${PF}.tbz2" "${PKGDIR}/${CATEGORY}/${PF}.tbz2" || \
+ die "Failed to create symlink in ${PKGDIR}/${CATEGORY}"
+ fi
vecho ">>> Done."
cd "${PORTAGE_BUILDDIR}"
touch .packaged || die "Failed to 'touch .packaged' in ${PORTAGE_BUILDDIR}"