From aafb97199125802e44f5b47f40e066cd2dc96b62 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 5 Oct 2011 14:26:54 +0200 Subject: [PATCH] xbps-src: code to handle new pycompile trigger. --- xbps-src/libexec/doinst-helper.sh.in | 4 ++++ xbps-src/shutils/metadata_scripts.sh | 13 +++++++++++++ xbps-src/shutils/tmpl_funcs.sh.in | 1 + 3 files changed, 18 insertions(+) diff --git a/xbps-src/libexec/doinst-helper.sh.in b/xbps-src/libexec/doinst-helper.sh.in index 1a9b3876c4..f8f5deb26e 100644 --- a/xbps-src/libexec/doinst-helper.sh.in +++ b/xbps-src/libexec/doinst-helper.sh.in @@ -91,6 +91,10 @@ install_src_phase() msg_normal "$pkgver: removing libtool archives...\n" find ${DESTDIR} -type f -name \*.la -delete fi + # Remove bytecode python generated files. + msg_normal "$pkgver: removing python bytecode archives...\n" + find ${DESTDIR} -type f -name \*.py[co] -delete + # Always remove perllocal.pod and .packlist files. if [ "$pkgname" != "perl" ]; then find ${DESTDIR} -type f -name perllocal.pod -delete diff --git a/xbps-src/shutils/metadata_scripts.sh b/xbps-src/shutils/metadata_scripts.sh index e86bb89c8e..9d5d92926e 100644 --- a/xbps-src/shutils/metadata_scripts.sh +++ b/xbps-src/shutils/metadata_scripts.sh @@ -258,6 +258,19 @@ _EOF fi fi + # + # Handle python bytecode archives with pycompile trigger. + # + if [ -n "${pycompile_dirs}" -o -n "${pycompile_module}" ]; then + if [ -n "${pycompile_dirs}" ]; then + echo "export pycompile_dirs=\"${pycompile_dirs}\"" >>$tmpf + fi + if [ -n "${pycompile_module}" ]; then + echo "export pycompile_module=\"${pycompile_module}\"" >>$tmpf + fi + _add_trigger pycompile + fi + # End of trigger var exports. echo >> $tmpf diff --git a/xbps-src/shutils/tmpl_funcs.sh.in b/xbps-src/shutils/tmpl_funcs.sh.in index 6a3c6f18ca..cb8fd829a6 100644 --- a/xbps-src/shutils/tmpl_funcs.sh.in +++ b/xbps-src/shutils/tmpl_funcs.sh.in @@ -105,6 +105,7 @@ reset_tmpl_vars() ignore_vdeps_dir noverifyrdeps conflicts dkms_modules \ gconf_entries gconf_schemas stow_copy stow_copy_files \ pre_remove post_remove post_stow do_build do_install \ + pycompile_dirs pycompile_module \ homepage license kernel_hooks_version SUBPKG \ XBPS_EXTRACT_DONE XBPS_CONFIGURE_DONE \ XBPS_BUILD_DONE XBPS_INSTALL_DONE FILESDIR DESTDIR \