diff --git a/xbps-src/libexec/doinst-helper.sh.in b/xbps-src/libexec/doinst-helper.sh.in index 1a9b3876c45..f8f5deb26e4 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 e86bb89c8e0..9d5d92926ed 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 6a3c6f18ca2..cb8fd829a6e 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 \