summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-03-24 08:33:22 +0000
committerZac Medico <zmedico@gentoo.org>2006-03-24 08:33:22 +0000
commitec5108ad87c690cbd7105ccd4ccdcf511f258b9f (patch)
tree0d23ad91ffdc26763e24f3cfb5cafe422d6cc942
parentAdd a portage_debug module and python-trace feature for --debug mode. (diff)
downloadportage-multirepo-ec5108ad87c690cbd7105ccd4ccdcf511f258b9f.tar.gz
portage-multirepo-ec5108ad87c690cbd7105ccd4ccdcf511f258b9f.tar.bz2
portage-multirepo-ec5108ad87c690cbd7105ccd4ccdcf511f258b9f.zip
Create tbz2 package directly in ${PKGDIR}/All to avoid need for temp file (inefficient) and avoid selinux label issues for bug #127374.
svn path=/main/trunk/; revision=2986
-rw-r--r--bin/misc-functions.sh17
1 files changed, 9 insertions, 8 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index e5751e13..88365843 100644
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -406,16 +406,17 @@ preinst_selinux_labels() {
dyn_package() {
cd "${PORTAGE_BUILDDIR}/image"
install_mask "${PORTAGE_BUILDDIR}/image" ${PKG_INSTALL_MASK}
- tar cpvf - ./ | bzip2 -f > ../bin.tar.bz2 || die "Failed to create tarball"
- cd ..
- xpak build-info inf.xpak
- tbz2tool join bin.tar.bz2 inf.xpak "${PF}.tbz2"
+ local pkg_dest="${PKGDIR}/All/${PF}.tbz2"
+ local pkg_tmp="${PKGDIR}/All/${PF}.tbz2.$$"
addwrite "${PKGDIR}"
- mv -f "${PF}.tbz2" "${PKGDIR}/All" || die "Failed to move tbz2 to ${PKGDIR}/All"
- rm -f inf.xpak bin.tar.bz2
- if [ ! -d "${PKGDIR}/${CATEGORY}" ]; then
- install -d "${PKGDIR}/${CATEGORY}"
+ tar cpvf - ./ | bzip2 -f > "${pkg_tmp}" || die "Failed to create tarball"
+ cd ..
+ python -c "import xpak; t=xpak.tbz2('${pkg_tmp}'); t.recompose('${PORTAGE_BUILDDIR}/build-info')"
+ if [ $? -ne 0 ]; then
+ rm -f "${pkg_tmp}"
+ 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}"
echo ">>> Done."
cd "${PORTAGE_BUILDDIR}"