* Andreas Beckmann <a...@debian.org>, 2013-05-27, 05:49:
From the attached log (scroll to the bottom...):

 Preparing to replace python-gsw 3.0.1-1 (using .../python-gsw_3.0.1-2_all.deb) 
...
 Unpacking replacement python-gsw ...
 dpkg: error processing /var/cache/apt/archives/python-gsw_3.0.1-2_all.deb 
(--unpack):
  unable to install new version of 
`/usr/lib/python2.7/dist-packages/gsw-3.0.1.egg-info/dependency_links.txt': No 
such file or directory
 Errors were encountered while processing:
  /var/cache/apt/archives/python-gsw_3.0.1-2_all.deb

This is a rather unusual instance of "dpkg won't replace symlinks-to-directories with directories" problem. It's unusual, because if you look at each package separately, there are only symlinks to files, which are supposed to be safe:

3.0.1-1 ships:

/usr/share/pyshared/gsw-3.0.1.egg-info
/usr/lib/python2.7/dist-packages/gsw-3.0.1.egg-info -> 
../../../share/pyshared/gsw-3.0.1.egg-info

3.0.1-2 ships:

/usr/share/pyshared/gsw-3.0.1.egg-info/
/usr/share/pyshared/gsw-3.0.1.egg-info/dependency_links.txt
/usr/lib/python2.7/dist-packages/gsw-3.0.1.egg-info/
/usr/lib/python2.7/dist-packages/gsw-3.0.1.egg-info/dependency_links.txt -> 
../../../../share/pyshared/gsw-3.0.1.egg-info/dependency_links.txt

This is what happens then dpkg upgrades 3.0.1-1 -> 3.0.1-2:

1) It replaces /usr/share/pyshared/gsw-3.0.1.egg-info (a regular file) with a directory. 2) It DOESN'T replace /usr/lib/python2.7/dist-packages/gsw-3.0.1.egg-info with a directory, because it's now a symlink to a directory. 3) It follows the symlink when creating /usr/lib/python2.7/dist-packages/gsw-3.0.1.egg-info/dependency_links.txt.

So you end up with two files (/usr/share/pyshared/gsw-3.0.1.egg-info/dependency_links.txt and /usr/lib/python2.7/dist-packages/gsw-3.0.1.egg-info/dependency_links.txt) installed under the same name. This makes dpkg unhappy.


Okay, so why .egg-info suddenly became a directory? It's because of this fragment of setup.py:
| try:
|     from setuptools import setup
|     from setuptools.command.sdist import sdist
| except ImportError:
|     from distutils.core import setup
|     from distutils.command.sdist import sdist

Setuptools creates .egg-info as a directory (putting some extra metadata there), while distutils always creates .egg-info as a file. Apparently 3.0.1-2 was built in a non-minimal environment which had python-setuptools installed.

--
Jakub Wilk


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to