tar-replacement-native: Add a target to replace the default tar

tar < 1.24 has symlink issues where extracting a tar archive containing a symlink
to a directory where that symlink already exists will cause the symlink to be
dereferenced. If that target doesn't exist tar can fail with a permissions error.

Since we need to be able to do this for packages containing symlinks like
xorg-minimal-fonts and eglibc, we have to ensure a tar 1.25 is available early
in the build process.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2011-02-21 16:29:43 +00:00
parent 05c4692320
commit 577dd4b3e5
3 changed files with 16 additions and 4 deletions

View File

@ -0,0 +1,5 @@
require tar_${PV}.bb
inherit native
BPN = "tar"

View File

@ -8,11 +8,18 @@ SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2"
inherit autotools gettext inherit autotools gettext
EXTRAINSTALL = "do_install_extra"
EXTRAINSTALL_virtclass-native = ""
do_install () { do_install () {
autotools_do_install autotools_do_install
install -d ${D}${base_bindir} install -d ${D}${base_bindir}
mv ${D}${bindir}/tar ${D}${base_bindir}/tar.${PN} ${EXTRAINSTALL}
mv ${D}${libexecdir}/rmt ${D}${libexecdir}/rmt.${PN} }
do_install_extra () {
mv ${D}${bindir}/tar ${D}${base_bindir}/tar.${PN} \
mv ${D}${libexecdir}/rmt ${D}${libexecdir}/rmt.${PN}
} }
pkg_postinst_${PN} () { pkg_postinst_${PN} () {

View File

@ -15,7 +15,7 @@ done
buildpseudo="1" buildpseudo="1"
if [ $needpseudo = "1" ] && [ -e "$BUILDDIR/pseudodone" ]; then if [ $needpseudo = "1" ] && [ -e "$BUILDDIR/pseudodone" ]; then
PSEUDOBINDIR=`cat $BUILDDIR/pseudodone` PSEUDOBINDIR=`cat $BUILDDIR/pseudodone`
if [ -e "$PSEUDOBINDIR/pseudo" ]; then if [ -e "$PSEUDOBINDIR/pseudo" -a -e "$PSEUDOBINDIR/tar" ]; then
buildpseudo="0" buildpseudo="0"
fi fi
fi fi
@ -27,7 +27,7 @@ OLDPATH=$PATH
export PATH=`echo $PATH | sed s#[^:]*/scripts:##` export PATH=`echo $PATH | sed s#[^:]*/scripts:##`
if [ $buildpseudo = "1" ]; then if [ $buildpseudo = "1" ]; then
echo "Pseudo is not present but is required, building this first before the main build" echo "Pseudo is not present but is required, building this first before the main build"
bitbake pseudo-native -c populate_sysroot bitbake pseudo-native tar-replacement-native -c populate_sysroot
ret=$? ret=$?
if [ "$ret" != "0" ]; then if [ "$ret" != "0" ]; then
exit 1 exit 1