From d3d236b2bf2784d7454dcb7fce595b6aac6967cd Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Tue, 8 Feb 2011 22:16:41 -0600 Subject: Misc hard link fixes I searched the various classes and looked for copies that should attempt to preserve hardlinks. This fixes the majority of this copies by switching to using tar as the copy method. It also has the side effect of preserving sparse files. Signed-off-by: Mark Hatle --- meta/classes/libc-package.bbclass | 12 ++++++------ meta/classes/populate_sdk_deb.bbclass | 2 +- meta/classes/sourcepkg.bbclass | 2 +- meta/classes/staging.bbclass | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass index 733f26b85..c9d81f063 100644 --- a/meta/classes/libc-package.bbclass +++ b/meta/classes/libc-package.bbclass @@ -104,24 +104,24 @@ TMP_LOCALE="/tmp/locale${libdir}/locale" do_prep_locale_tree() { treedir=${WORKDIR}/locale-tree rm -rf $treedir - mkdir -p $treedir/bin $treedir/lib $treedir/${datadir} $treedir/${libdir}/locale - cp -pPR ${PKGD}${datadir}/i18n $treedir/${datadir}/i18n + mkdir -p $treedir/${base_bindir} $treedir/${base_libdir} $treedir/${datadir} $treedir/${libdir}/locale + tar -cf - -C ${PKGD}${datadir} -ps i18n | tar -xf - -C $treedir/${datadir} # unzip to avoid parsing errors for i in $treedir/${datadir}/i18n/charmaps/*gz; do gunzip $i done - cp -pPR ${PKGD}${base_libdir}/* $treedir/lib + tar -cf - -C ${PKGD}${base_libdir} -ps . | tar -xf - -C $treedir/${base_libdir} if [ -f ${STAGING_DIR_NATIVE}${prefix_native}/lib/libgcc_s.* ]; then - cp -pPR ${STAGING_DIR_NATIVE}/${prefix_native}/lib/libgcc_s.* $treedir/lib + tar -cf - -C ${STAGING_DIR_NATIVE}/${prefix_native}/${base_libdir} -ps libgcc_s.* | tar -xf - -C $treedir/${base_libdir} fi - install -m 0755 ${PKGD}${bindir}/localedef $treedir/bin + install -m 0755 ${PKGD}${bindir}/localedef $treedir/${base_bindir} } do_collect_bins_from_locale_tree() { treedir=${WORKDIR}/locale-tree mkdir -p ${PKGD}${libdir} - cp -pPR $treedir/${libdir}/locale ${PKGD}${libdir} + tar -cf - -C $treedir/${libdir} -ps locale | tar -xf - -C ${PKGD}${libdir} } inherit qemu diff --git a/meta/classes/populate_sdk_deb.bbclass b/meta/classes/populate_sdk_deb.bbclass index d563c2867..a5b6384f7 100644 --- a/meta/classes/populate_sdk_deb.bbclass +++ b/meta/classes/populate_sdk_deb.bbclass @@ -6,7 +6,7 @@ populate_sdk_post_deb () { local target_rootfs=$1 - cp -r ${STAGING_ETCDIR_NATIVE}/apt ${target_rootfs}/etc + tar -cf -C ${STAGING_ETCDIR_NATIVE} -ps apt | tar -xf - -C ${target_rootfs}/etc } fakeroot populate_sdk_deb () { diff --git a/meta/classes/sourcepkg.bbclass b/meta/classes/sourcepkg.bbclass index f73855303..f12a1955d 100644 --- a/meta/classes/sourcepkg.bbclass +++ b/meta/classes/sourcepkg.bbclass @@ -41,7 +41,7 @@ sourcepkg_do_create_orig_tgz(){ echo $src_tree oenote "Creating .orig.tar.gz in ${DEPLOY_DIR_SRC}/${P}.orig.tar.gz" tar cvzf ${DEPLOY_DIR_SRC}/${P}.orig.tar.gz --exclude-from temp/exclude-from-file $src_tree - cp -pPR $src_tree $src_tree.orig + tar -cf - -C $src_tree -ps . | tar -xf - -C $src_tree.orig } sourcepkg_do_archive_bb() { diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass index a713734c3..fef645739 100644 --- a/meta/classes/staging.bbclass +++ b/meta/classes/staging.bbclass @@ -17,7 +17,7 @@ sysroot_stage_dir() { # However we always want to stage a $src itself, even if it's empty mkdir -p "$dest" if [ -d "$src" ]; then - cp -fpPR "$src"/* "$dest" + tar -cf - -C "$src" -ps . | tar -xf - -C "$dest" fi } -- cgit v1.2.3