summaryrefslogtreecommitdiffstats
path: root/bin/misc-functions.sh
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-05-23 04:47:36 +0000
committerZac Medico <zmedico@gentoo.org>2007-05-23 04:47:36 +0000
commit1f8e2fe1729c68bbe7b173378ce7c9d7bb14f582 (patch)
treeddc8dd6109cb492593a88465a8a4ce826037a64e /bin/misc-functions.sh
parent9ec3cb8abadd77bdb8c645c92852e681e46a3196 (diff)
downloadportage-1f8e2fe1729c68bbe7b173378ce7c9d7bb14f582.tar.gz
portage-1f8e2fe1729c68bbe7b173378ce7c9d7bb14f582.tar.bz2
portage-1f8e2fe1729c68bbe7b173378ce7c9d7bb14f582.zip
Pass a temporary file name to the package phase in the environment variable PORTAGE_BINPKG_TMPFILE and move the temporary file into place inside binarytree.inject(). This allows binarytree.inject() to perform the move while holding a lock.
svn path=/main/trunk/; revision=6591
Diffstat (limited to 'bin/misc-functions.sh')
-rwxr-xr-xbin/misc-functions.sh19
1 files changed, 4 insertions, 15 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 86d13292d..de349e029 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -496,32 +496,21 @@ preinst_selinux_labels() {
dyn_package() {
cd "${PORTAGE_BUILDDIR}/image"
install_mask "${PORTAGE_BUILDDIR}/image" ${PKG_INSTALL_MASK}
- 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}" || \
+ mkdir -p "${PORTAGE_BINPKG_TMPFILE%/*}" || die "mkdir failed"
+ tar ${tar_options} -cf - . | bzip2 -f > "${PORTAGE_BINPKG_TMPFILE}" || \
die "Failed to create tarball"
cd ..
export PYTHONPATH="${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}:${PYTHONPATH}"
- python -c "from portage import xpak; t=xpak.tbz2('${pkg_tmp}'); t.recompose('${PORTAGE_BUILDDIR}/build-info')"
+ python -c "from portage import xpak; t=xpak.tbz2('${PORTAGE_BINPKG_TMPFILE}'); t.recompose('${PORTAGE_BUILDDIR}/build-info')"
if [ $? -ne 0 ]; then
- rm -f "${pkg_tmp}"
+ rm -f "${PORTAGE_BINPKG_TMPFILE}"
die "Failed to append metadata to the tbz2 file"
fi
- mv -f "${pkg_tmp}" "${pkg_dest}" || die "Failed to move tbz2 to ${pkg_dest}"
- 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}"