Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 575790 - texlive-common.eclass: Call texmf-update/fmtutil-sys when ROOT is set.
Summary: texlive-common.eclass: Call texmf-update/fmtutil-sys when ROOT is set.
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal enhancement with 1 vote (vote)
Assignee: TeX project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-27 00:27 UTC by Skruppy
Modified: 2016-03-02 18:59 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Skruppy 2016-02-27 00:27:22 UTC
When ROOT is set (e.g. with "emerge --root" or in /etc/portage/make.conf), texlive-common.eclass doesn't call texmf-update or fmtutil-sys. But if those tools can be found in $ROOT, there is probably also a whole gentoo system in there (you are installing things into $ROOT therefore it wouldn't hurt to add more files with texmf-update or fmtutil-sys).

Reproducible: Always

Steps to Reproduce:
1. mkdir /tmp/foo
2. mount --bind / /tmp/foo
3. emerge --root /tmp/foo -1 dev-libs/kpathsea

Actual Results:
```
 * Cannot run texmf-update for some reason.
 * Your texmf tree might be inconsistent with your configuration
 * Please try to figure what has happened
```

Expected Results:
```
Configuring TeXLive ...
Generating /etc/texmf/web2c/texmf.cnf from /etc/texmf/texmf.d ...
Generating /etc/texmf/web2c/fmtutil.cnf from /etc/texmf/fmtutil.d ...
...
```

Cause:
`if [ "$ROOT" = "/" ]` in `etexmf-update()` and `efmtutil-sys()` in texlive-common.eclass takes the simple approach of giving a not very helpful warning :)

Suggested Fix:
(Additionally: Add "|| die" at the end of the chroot lines?)
The following, tested in my /etc/portage/make.conf, works for me.
```
etexmf-update() {
        if has_version 'app-text/texlive-core' ; then
                if [ -x "${EROOT}"/usr/sbin/texmf-update ] ; then
                        chroot "${ROOT}" "${EPREFIX}"/usr/sbin/texmf-update
                else
                        ewarn "${EROOT}/usr/sbin/texmf-update is not executable."
                        ewarn "Your texmf tree might be inconsistent with your configuration."
                fi
        fi
}

efmtutil-sys() {
        if has_version 'app-text/texlive-core' ; then
                if [ -x "${EROOT}"/usr/bin/fmtutil-sys ] ; then
                        einfo "Rebuilding formats"
                        chroot "${ROOT}" "${EPREFIX}"/usr/bin/fmtutil-sys --all &> /dev/null
                else
                        ewarn "${EROOT}/usr/bin/fmtutil-sys is not executable."
                        ewarn "Your formats might be inconsistent with your installed ${PN} version."
                fi
        fi
}
```
Comment 1 Alexis Ballier gentoo-dev 2016-03-02 18:59:03 UTC
chrooting wont work when cross-compiling; the tools should be made root-aware, that is: they must not touch anything in / when ROOT!=/, which I doubt is the case without heavy patching, but I might be wrong and it might just be about setting the proper variables