summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-09-07 06:00:18 +0000
committerZac Medico <zmedico@gentoo.org>2006-09-07 06:00:18 +0000
commit0cd9dc98ce290f00234bd200ea5b7905909622c9 (patch)
tree4ac027d9f69d456cc32440ca95572a5a81945da1
parent7483ec999518187de6a0c70714d05c89bd5da228 (diff)
downloadportage-0cd9dc98ce290f00234bd200ea5b7905909622c9.tar.gz
portage-0cd9dc98ce290f00234bd200ea5b7905909622c9.tar.bz2
portage-0cd9dc98ce290f00234bd200ea5b7905909622c9.zip
Optimize quickpkg so that it creates the binary package directly in $PKGDIR/All. This eliminates the need for tbz2tool and is the same approach used by the package phase in misc-functions.sh.
svn path=/main/trunk/; revision=4420
-rwxr-xr-xbin/quickpkg13
1 files changed, 8 insertions, 5 deletions
diff --git a/bin/quickpkg b/bin/quickpkg
index 6101ddc11..f90e73089 100755
--- a/bin/quickpkg
+++ b/bin/quickpkg
@@ -17,6 +17,8 @@ fi
# We need to ensure a sane umask for the packages that will be created.
umask 022
+# Make sure the xpak module is in PYTHONPATH
+export PYTHONPATH=$(portageq envvar PORTAGE_PYM_PATH)
export PORTAGE_DB=$(portageq vdb_path)
export ROOT=$(portageq envvar ROOT)
export ROOT=${ROOT%/}/
@@ -63,6 +65,9 @@ do_pkg() {
# get pkg info files
mkdir -p "${MYDIR}"/temp
cp "${SRCDIR}"/* "${MYDIR}"/temp/
+ [ -d "${PKGDIR}"/All ] || mkdir -p "${PKGDIR}"/All
+ local pkg_dest="${PKGDIR}/All/${1}.tbz2"
+ local pkg_tmp="${PKGDIR}/All/${1}.tbz2.$$"
# create filelist and a basic tbz2
gawk '{
@@ -74,16 +79,14 @@ do_pkg() {
}
print
}' "${SRCDIR}"/CONTENTS | cut -f2- -d" " - | sed -e 's:^/:./:' > "${MYDIR}"/filelist
- tar vjcf "${MYDIR}"/bin.tar.bz2 -C "${ROOT}" --files-from="${MYDIR}"/filelist --no-recursion
+ tar vjcf "${pkg_tmp}" -C "${ROOT}" --files-from="${MYDIR}"/filelist --no-recursion
# join together the basic tbz2 and the pkg info files
- xpak "${MYDIR}"/temp "${MYDIR}"/inf.xpak
- tbz2tool join "${MYDIR}"/bin.tar.bz2 "${MYDIR}"/inf.xpak "${MYDIR}"/$1.tbz2
+ python -c "import xpak; t=xpak.tbz2('${pkg_tmp}'); t.recompose('${MYDIR}/temp')"
# move the final binary package to PKGDIR
- [ -d "${PKGDIR}"/All ] || mkdir -p "${PKGDIR}"/All
+ mv -f "${pkg_tmp}" "${pkg_dest}"
[ -d "${PKGDIR}/$2" ] || mkdir -p "${PKGDIR}/$2"
- mv "${MYDIR}"/$1.tbz2 "${PKGDIR}"/All
( cd "${PKGDIR}/$2" && ln -s ../All/$1.tbz2 )
# cleanup again