summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-04-14 15:14:42 +0200
committerMichał Górny <mgorny@gentoo.org>2020-04-14 15:16:52 +0200
commit97812dcc9ddb1e043d8a67216692b214d62099a7 (patch)
tree26ecf26331e638986786253d26f0de3d62fc6261 /eclass
parentapp-portage/nattka: Bump to 0.1.10 (diff)
downloadgentoo-97812dcc9ddb1e043d8a67216692b214d62099a7.tar.gz
gentoo-97812dcc9ddb1e043d8a67216692b214d62099a7.tar.bz2
gentoo-97812dcc9ddb1e043d8a67216692b214d62099a7.zip
texlive-module.eclass: Optimize src_unpack()
This goes a bit further than slyfox's work. On my machine, it reduces the post-unpack time from ~44m to ~13m. Bug: https://bugs.gentoo.org/688922 Acked-by: Mikle Kolyada <zlogene@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/texlive-module.eclass18
1 files changed, 8 insertions, 10 deletions
diff --git a/eclass/texlive-module.eclass b/eclass/texlive-module.eclass
index a415205e035f..fc83abe49c54 100644
--- a/eclass/texlive-module.eclass
+++ b/eclass/texlive-module.eclass
@@ -140,16 +140,14 @@ RELOC_TARGET=texmf-dist
texlive-module_src_unpack() {
unpack ${A}
- grep RELOC tlpkg/tlpobj/* | awk '{print $2}' | sed 's#^RELOC/##' > "${T}/reloclist" || die
- { for i in $(<"${T}/reloclist"); do dirname ${i}; done; } | uniq > "${T}/dirlist"
- for i in $(<"${T}/dirlist"); do
- if [[ ! -d ${RELOC_TARGET}/${i} ]]; then
- mkdir -p "${RELOC_TARGET}/${i}" || die
- fi
- done
- for i in $(<"${T}/reloclist"); do
- mv "${i}" "${RELOC_TARGET}"/$(dirname "${i}") || die "failed to relocate ${i} to ${RELOC_TARGET}/$(dirname ${i})"
- done
+ sed -n -e 's:\s*RELOC/::p' tlpkg/tlpobj/* > "${T}/reloclist" || die
+ sed -e 's/\/[^/]*$//' -e "s:^:${RELOC_TARGET}/:" "${T}/reloclist" |
+ sort -u |
+ xargs mkdir -p || die
+ local i
+ while read i; do
+ mv "${i}" "${RELOC_TARGET}/${i%/*}" || die
+ done < "${T}/reloclist"
}
# @FUNCTION: texlive-module_add_format