Bug#244601: tetex-bin: package fails to configure: Error: `mpost -ini -jobname=metafun -progname=mpost metafun.mp' failed
Frank Küster <frank@debian.org> wrote:
> On Branden's system, /usr/share/texmf/web2c is _not_ a symlink. It is no
> wonder that no package claims to own files in there, it just shouldn't
> exist. One explanation for its existence would have been manual
> intervention. Branden says he can exclude this.
>
> I simply can't think of a different explanation. Some imagined dpkg bug
> could lead to the error that a to-be-symlink is created as a
> directory. But there is no code at all in Debian, AFAIS, that would copy
> the files that we ship in /var/lib/texmf/web2c to that directory.
I have a possible partial explanation, that relies on this quote from
Policy (§ 6.5, step 4):
[ when installing a package that Replaces another package ]
A directory will never be replaced by a symbolic link to a directory
or vice versa; instead, the existing state (symlink or not) will be
left alone and dpkg will follow the symlink if there is one.
If at some point, Branden installed a package X that ships
/var/lib/texmf/web2c as a symbolic link to /usr/share/texmf/web2c and
/usr/share/texmf/web2c[1] as a directory (i.e., the wrong way), then if
a (valid) package Y is installed that:
- Replaces: X
- ships files such as /var/lib/texmf/web2c/tex.pool
shhhazaaaaaam! dpkg will preserve /var/lib/texmf/web2c as a symlink and
will install tex.pool under /usr/share/texmf/web2c (following the
symlink). I verified this with dummy packages (except for the particular
case in [1]). Also, 'dpkg -S /usr/share/texmf/web2c/tex.pool' will fail
to find an owner, just as happens in Branden's case: the file is
registered as /var/lib/texmf/web2c/tex.pool from package Y, even though
it actually lives under /usr/share/texmf/web2c/.
Then, I can imagine that if X is removed, a package such as Y could turn
(upon upgrade, perhaps) /var/lib/texmf/web2c into a real directory,
as seems to be the case on Branden's system.
HTH.
[1] I think the scenario still applies if /usr/share/texmf/web2c is
provided as a directory by another package before that is already
installed when package Y is installed.
Summary of my tests
-------------------
Package foo
~~~~~~~~~~~
,----[ debian/control ]
| Source: foo
| Section: misc
| Priority: optional
| Maintainer: Florent Rougon <f.rougon@free.fr>
| Build-Depends: debhelper (>= 4)
| Standards-Version: 3.6.1
|
| Package: foo
| Architecture: all
| Description: dummy package for experiments
| foo is a dummy package for experiments with dpkg, apt, etc.
`----
,----[ debian/rules ]
| #! /usr/bin/make -f
|
| PACKAGE := foo
| REL_PKG_INSTALL_DIR := debian/$(PACKAGE)
|
| INSTALL = install
| INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
|
| build: build-indep
|
| build-indep:
| # Nothing to do here
|
| clean:
| dh_testdir pouet
| dh_testroot
| dh_clean
|
| binary-indep: build-indep
| dh_testdir
| dh_testroot
| dh_clean
|
| dh_installdirs usr/share/evil
| dh_link usr/share/evil var/lib/evil
|
| dh_installdocs
| dh_installchangelogs
|
| dh_compress
| dh_fixperms
| dh_installdeb
| dh_gencontrol
| dh_md5sums
| dh_builddeb
|
| binary-arch:
| # We have nothing to do here but the Debian Policy says this target must
| # exist.
|
| binary: binary-indep binary-arch
|
| .PHONY: clean build build-indep binary binary-arch binary-indep
`----
Package bar
~~~~~~~~~~~
,----[ debian/control ]
| Source: bar
| Section: misc
| Priority: optional
| Maintainer: Florent Rougon <f.rougon@free.fr>
| Build-Depends: debhelper (>= 4)
| Standards-Version: 3.6.1
|
| Package: bar
| Architecture: all
| Replaces: foo
| Description: dummy package for experiments
| bar is a dummy package for experiments with dpkg, apt, etc.
`----
,----[ debian/rules ]
| #! /usr/bin/make -f
|
| PACKAGE := bar
| REL_PKG_INSTALL_DIR := debian/$(PACKAGE)
|
| INSTALL = install
| INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644
|
| build: build-indep
|
| build-indep:
| # Nothing to do here
|
| clean:
| dh_testdir pouet
| dh_testroot
| dh_clean
|
| binary-indep: build-indep
| dh_testdir
| dh_testroot
| dh_clean
|
| dh_installdirs var/lib/evil
| $(INSTALL_FILE) evil-file "$(REL_PKG_INSTALL_DIR)/var/lib/evil"
|
| dh_installdocs
| dh_installchangelogs
|
| dh_compress
| dh_fixperms
| dh_installdeb
| dh_gencontrol
| dh_md5sums
| dh_builddeb
|
| binary-arch:
| # We have nothing to do here but the Debian Policy says this target must
| # exist.
|
| binary: binary-indep binary-arch
|
| .PHONY: clean build build-indep binary binary-arch binary-indep
`----
Experiment
~~~~~~~~~~
~flo/debian-experiments # dpkg -i foo/foo_1.0-1_all.deb sid root@florent
Selecting previously deselected package foo.
(Reading database ... 88849 files and directories currently installed.)
Unpacking foo (from foo/foo_1.0-1_all.deb) ...
Setting up foo (1.0-1) ...
~flo/debian-experiments # ls -l /usr/share/evil sid root@florent
total 0
~flo/debian-experiments # ls -l /var/lib/evil sid root@florent
lrwxrwxrwx 1 root root 15 2004-05-22 15:32 /var/lib/evil -> /us
r/share/evil
~flo/debian-experiments # dpkg -i bar/bar_1.1-1_all.deb sid root@florent
Selecting previously deselected package bar.
(Reading database ... 88854 files and directories currently installed.)
Unpacking bar (from bar/bar_1.1-1_all.deb) ...
Setting up bar (1.1-1) ...
~flo/debian-experiments # ls -l /var/lib/evil sid root@florent
lrwxrwxrwx 1 root root 15 2004-05-22 15:32 /var/lib/evil -> /us
r/share/evil
~flo/debian-experiments # ls -l /usr/share/evil sid root@florent
total 0
-rw-r--r-- 1 root root 0 2004-02-01 11:38 evil-file
~flo/debian-experiments # dpkg -S /usr/share/evil/evil-file sid root@florent
dpkg: /usr/share/evil/evil-file not found.
~flo/debian-experiments # dpkg -S /var/lib/evil/evil-file sid root@florent
bar: /var/lib/evil/evil-file
~flo/debian-experiments #
--
Florent
Reply to: