mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-24 04:59:14 -07:00
perl-module.eclass and perl-functions.eclass: Add infrastructure to build .packlist files and keep/fix them in EAPI=6
This commit is contained in:
@@ -106,17 +106,46 @@ perl_delete_packlist() {
|
||||
debug-print-function $FUNCNAME "$@"
|
||||
perl_set_version
|
||||
if [[ -d ${D}/${VENDOR_ARCH} ]] ; then
|
||||
find "${D}/${VENDOR_ARCH}" -type f -a \( -name .packlist \
|
||||
-o \( -name '*.bs' -a -empty \) \) -delete
|
||||
find "${D}/${VENDOR_ARCH}" -type f -a -name .packlist -delete
|
||||
perl_delete_emptybsdir
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: perl_delete_emptybsdir
|
||||
# @USAGE: perl_delete_emptybsdir
|
||||
# @DESCRIPTION:
|
||||
# Look through ${D} for empty .bs files and empty directories,
|
||||
# and get rid of items found.
|
||||
perl_delete_emptybsdir() {
|
||||
debug-print-function $FUNCNAME "$@"
|
||||
perl_set_version
|
||||
if [[ -d ${D}/${VENDOR_ARCH} ]] ; then
|
||||
find "${D}/${VENDOR_ARCH}" -type f \
|
||||
-a -name '*.bs' -a -empty -delete
|
||||
find "${D}" -depth -mindepth 1 -type d -empty -delete
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: perl_fix_packlist
|
||||
# @USAGE: perl_fix_packlist
|
||||
# @DESCRIPTION:
|
||||
# Look through ${D} for .packlist text files containing the temporary installation
|
||||
# folder (i.e. ${D}). If the pattern is found, silently replace it with `/'.
|
||||
perl_fix_packlist() {
|
||||
debug-print-function $FUNCNAME "$@"
|
||||
|
||||
find "${D}" -type f -name '.packlist' -print0 | while read -rd '' f ; do
|
||||
if file "${f}" | grep -q -i " text" ; then
|
||||
sed -i -e "s:${D}:/:g" "${f}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# @FUNCTION: perl_remove_temppath
|
||||
# @USAGE: perl_remove_temppath
|
||||
# @DESCRIPTION:
|
||||
# Look through ${D} for text files containing the temporary installation
|
||||
# folder (i.e. ${D}). If the pattern is found (i.e. " text"), replace it with `/'.
|
||||
# folder (i.e. ${D}). If the pattern is found, replace it with `/' and warn.
|
||||
perl_remove_temppath() {
|
||||
debug-print-function $FUNCNAME "$@"
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ perl-module_src_configure() {
|
||||
--installdirs=vendor \
|
||||
--libdoc= \
|
||||
--destdir="${D}" \
|
||||
--create_packlist=0 \
|
||||
--create_packlist=1 \
|
||||
"${myconf_local[@]}"
|
||||
einfo "perl Build.PL" "$@"
|
||||
perl Build.PL "$@" <<< "${pm_echovar}" \
|
||||
@@ -407,7 +407,12 @@ perl-module_src_install() {
|
||||
|
||||
perl_delete_module_manpages
|
||||
perl_delete_localpod
|
||||
perl_delete_packlist
|
||||
if [[ ${EAPI:-0} == 5 ]] ; then
|
||||
perl_delete_packlist
|
||||
else
|
||||
perl_fix_packlist
|
||||
perl_delete_emptybsdir
|
||||
fi
|
||||
perl_remove_temppath
|
||||
|
||||
for f in Change* CHANGES README* TODO FAQ ${mydoc}; do
|
||||
|
||||
Reference in New Issue
Block a user