From f5dd7aa666e6671d264a22466588b04bc4b840bd Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 9 Nov 2011 16:25:11 +0100 Subject: [PATCH] xbps-src: deprecate keep_empty_dirs, warn when an empty dir is removed. --- xbps-src/libexec/doinst-helper.sh.in | 13 ++++++------- xbps-src/shutils/metadata.sh | 2 +- xbps-src/shutils/tmpl_funcs.sh.in | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/xbps-src/libexec/doinst-helper.sh.in b/xbps-src/libexec/doinst-helper.sh.in index 4edcd3e9571..4069b2ea118 100644 --- a/xbps-src/libexec/doinst-helper.sh.in +++ b/xbps-src/libexec/doinst-helper.sh.in @@ -99,12 +99,9 @@ install_src_phase() find ${DESTDIR} -type f -name .packlist -delete fi # Remove empty directories by default. - if [ -z "$keep_empty_dirs" ]; then - msg_normal "$pkgver: removing empty dirs...\n" - find ${DESTDIR} -depth -type d -exec rmdir 2>/dev/null {} \; - fi - touch -f $XBPS_INSTALL_DONE - + for f in $(find ${DESTDIR} -depth -type d); do + rmdir $f 2>/dev/null && msg_warn "removed empty dir: ${f##${DESTDIR}}\n" + done # # Build subpackages if found. # @@ -127,12 +124,14 @@ install_src_phase() set_tmpl_common_vars if [ ! -f ${wrksrc}/.xbps_do_install_${pkgname}_done ]; then run_func do_install - [ $? -eq 0 ] && \ + if [ $? -eq 0 ]; then touch -f ${wrksrc}/.xbps_do_install_${pkgname}_done + fi else msg_warn "$pkgver: skipping '$pkgname' subpkg, already installed into destdir.\n" fi done + touch -f $XBPS_INSTALL_DONE } [ -z "$PKG_TMPLNAME" ] && exit 2 diff --git a/xbps-src/shutils/metadata.sh b/xbps-src/shutils/metadata.sh index 2f027668854..6bf4ec1d4c2 100644 --- a/xbps-src/shutils/metadata.sh +++ b/xbps-src/shutils/metadata.sh @@ -44,7 +44,7 @@ xbps_write_metadata_pkg() setup_tmpl ${sourcepkg} unset run_depends conf_files noarch triggers replaces \ revision system_accounts system_groups \ - preserve keep_empty_dirs xml_entries sgml_entries \ + preserve xml_entries sgml_entries \ xml_catalogs sgml_catalogs gconf_entries gconf_schemas \ gtk_iconcache_dirs font_dirs dkms_modules provides \ kernel_hooks_version conflicts pycompile_dirs \ diff --git a/xbps-src/shutils/tmpl_funcs.sh.in b/xbps-src/shutils/tmpl_funcs.sh.in index 597710b8ae5..72291949b58 100644 --- a/xbps-src/shutils/tmpl_funcs.sh.in +++ b/xbps-src/shutils/tmpl_funcs.sh.in @@ -90,7 +90,7 @@ reset_tmpl_vars() local TMPL_VARS="pkgname distfiles configure_args strip_cmd \ make_build_args make_install_args build_style \ short_desc maintainer long_desc checksum wrksrc \ - make_cmd bootstrap register_shell keep_empty_dirs \ + make_cmd bootstrap register_shell \ make_build_target configure_script noextract nofetch \ build_depends nostrip nonfree \ make_install_target version revision patch_args \