xbps-src: deprecate keep_empty_dirs, warn when an empty dir is removed.

This commit is contained in:
Juan RP 2011-11-09 16:25:11 +01:00
parent 94dceeaae8
commit f5dd7aa666
3 changed files with 8 additions and 9 deletions

View file

@ -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