[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#544986: lprng: Fail to upgrade/reinstall if /etc/printcap do not exist



Package: lprng
Version: 3.8.A-2.1
Severity: important

I discovered this by change, while working on a NMU of lprng.  The
package fail to upgrade/reinstall if /etc/printcap do not exist.  The
problem is this code in the postinst:

        # Only make the symlink if nothing is there already Bug: #147641
        if [ ! -e /etc/lprng/printcap ] ; then
            (cd /etc/lprng ; ln -s ../printcap . )
        fi

If the symlink point to no-where, the -e test fail and the call to ln
fail.  Perhaps -L should be used instead?  Replacing -e with -L solved
the installation problem, but might fail if a sysadmin replaces the
symlink with a real file.

Or perhaps there is a missing dependency, a package what should make
sure /etc/printcap is available?

Here is the output from the failing installation.  It was done in a
clean sid chroot.

# aptitude install lprng
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
The following NEW packages will be installed:
  lprng
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/1158kB of archives. After unpacking 2871kB will be used.
Writing extended state information... Done
Preconfiguring packages ...
Selecting previously deselected package lprng.
(Reading database ... 20185 files and directories currently installed.)
Unpacking lprng (from .../lprng_3.8.A-2.1_i386.deb) ...
Processing triggers for man-db ...
Setting up lprng (3.8.A-2.1) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
Reading task descriptions... Done

# ls -l /etc/printcap /etc/lprng/printcap
ls: cannot access /etc/printcap: No such file or directory
lrwxrwxrwx 1 root root 11 Sep  4 09:49 /etc/lprng/printcap -> ../printcap
# aptitude reinstall lprng
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
The following packages will be REINSTALLED:
  lprng
0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0B/1158kB of archives. After unpacking 0B will be used.
Writing extended state information... Done
Preconfiguring packages ...
(Reading database ... 20238 files and directories currently installed.)
Preparing to replace lprng 3.8.A-2.1 (using .../lprng_3.8.A-2.1_i386.deb) ...
Unpacking replacement lprng ...
Processing triggers for man-db ...
Setting up lprng (3.8.A-2.1) ...
ln: creating symbolic link `./printcap': File exists
dpkg: error processing lprng (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 lprng
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up lprng (3.8.A-2.1) ...
ln: creating symbolic link `./printcap': File exists
dpkg: error processing lprng (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 lprng
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done

#




Reply to: