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

Bug#867425: gcc-defaults: /usr/share/doc/gcc symlink recreated on every package upgrade



Source: gcc-defaults
Version: 1.168d1
Severity: minor
Tags: patch

The gcc preinst script removes the /usr/share/doc/gcc symlink (it tests
whether /usr/share/doc/gcc is a directory, but this test also succeeds
for a symlink to a directory), apparently as part of a
directory -> symlink conversion that happened over 16 years ago:

,----
| gcc-defaults (0.4) unstable; urgency=low
| 
|   * Link /usr/share/doc/gcc to cpp doc directory (#80990).
| 
|  -- Matthias Klose <doko@debian.org>  Mon,  1 Jan 2001 18:27:27 +0100
`----

It seems that the preinst script and the part of the postinst script
that also deals with this conversion can be safely removed, see the
attached patch.


-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (101, 'experimental')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 4.12.0-nouveau (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

diff -Nru gcc-defaults-1.168d1/debian/gcc.postinst.in gcc-defaults-1.168d1local1/debian/gcc.postinst.in
--- gcc-defaults-1.168d1/debian/gcc.postinst.in	2013-06-12 23:03:20.000000000 +0200
+++ gcc-defaults-1.168d1local1/debian/gcc.postinst.in	2017-07-06 10:00:09.000000000 +0200
@@ -1,12 +1,5 @@
 #! /bin/sh -e
 
-# remove the doc dir, if it's still a directory and replace with a symlink
-pkg=`basename $0 .postinst`
-if [ ! -L  /usr/share/doc/$pkg ]; then
-    rm -rf /usr/share/doc/$pkg
-    ln -s cpp /usr/share/doc/$pkg
-fi
-
 update-alternatives --quiet \
     --install /usr/bin/cc cc /usr/bin/gcc 20 \
     @GFDL@--slave /usr/share/man/man1/cc.1.gz cc.1.gz /usr/share/man/man1/gcc.1.gz
diff -Nru gcc-defaults-1.168d1/debian/gcc.preinst gcc-defaults-1.168d1local1/debian/gcc.preinst
--- gcc-defaults-1.168d1/debian/gcc.preinst	2015-07-18 20:30:28.000000000 +0200
+++ gcc-defaults-1.168d1local1/debian/gcc.preinst	1970-01-01 01:00:00.000000000 +0100
@@ -1,10 +0,0 @@
-#! /bin/sh -e
-
-if [ -d /usr/share/doc/gcc ]; then
-    echo "Removing old gcc doc directory."
-    rm -rf /usr/share/doc/gcc
-fi
-
-#DEBHELPER#
-
-exit 0

Reply to: