Bug#919438: libgsm1-dev: unhandled symlink to directory conversion: /usr/share/doc/PACKAGE

2019-03-17 Thread gregor herrmann
Control: tag -1 + patch

On Tue, 15 Jan 2019 23:59:05 +0100, Andreas Beckmann wrote:

> an upgrade test with piuparts revealed that your package installs files
> over existing symlinks and possibly overwrites files owned by other
> packages. This usually means an old version of the package shipped a
> symlink but that was later replaced by a real (and non-empty)
> directory. This kind of overwriting another package's files cannot be
> detected by dpkg.

> It is recommended to use the dpkg-maintscript-helper commands
> 'dir_to_symlink' and 'symlink_to_dir' (available since dpkg 1.17.14)
> to perform the conversion, ideally using d/$PACKAGE.maintscript.
> See dpkg-maintscript-helper(1) and dh_installdeb(1) for details.

Here's a patch using dpkg-maintscript-helper to handle the
symlink_to_dir transition.


Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `-   NP: hons: molly's got a rider
diff -Nru libgsm-1.0.18/debian/changelog libgsm-1.0.18/debian/changelog
--- libgsm-1.0.18/debian/changelog	2019-01-01 00:28:12.0 +0100
+++ libgsm-1.0.18/debian/changelog	2019-03-17 16:34:15.0 +0100
@@ -1,3 +1,13 @@
+libgsm (1.0.18-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix "unhandled symlink to directory conversion:
+/usr/share/doc/PACKAGE":
+add libgsm1-dev.maintscript for the symlink_to_dir transition.
+(Closes: #919438)
+
+ -- gregor herrmann   Sun, 17 Mar 2019 16:34:15 +0100
+
 libgsm (1.0.18-1) unstable; urgency=medium
 
   * New upstream version
diff -Nru libgsm-1.0.18/debian/libgsm1-dev.maintscript libgsm-1.0.18/debian/libgsm1-dev.maintscript
--- libgsm-1.0.18/debian/libgsm1-dev.maintscript	1970-01-01 01:00:00.0 +0100
+++ libgsm-1.0.18/debian/libgsm1-dev.maintscript	2019-03-17 16:34:15.0 +0100
@@ -0,0 +1 @@
+symlink_to_dir /usr/share/doc/libgsm1-dev libgsm1 1.0.18-1.1~


signature.asc
Description: Digital Signature


Processed: Re: Bug#919438: libgsm1-dev: unhandled symlink to directory conversion: /usr/share/doc/PACKAGE

2019-03-17 Thread Debian Bug Tracking System
Processing control commands:

> tag -1 + patch
Bug #919438 [libgsm1-dev] libgsm1-dev: unhandled symlink to directory 
conversion: /usr/share/doc/PACKAGE
Added tag(s) patch.

-- 
919438: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=919438
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#919438: libgsm1-dev: unhandled symlink to directory conversion: /usr/share/doc/PACKAGE

2019-01-15 Thread Andreas Beckmann
Package: libgsm1-dev
Version: 1.0.18-1
Severity: serious
User: debian...@lists.debian.org
Usertags: piuparts

Hi,

an upgrade test with piuparts revealed that your package installs files
over existing symlinks and possibly overwrites files owned by other
packages. This usually means an old version of the package shipped a
symlink but that was later replaced by a real (and non-empty)
directory. This kind of overwriting another package's files cannot be
detected by dpkg.

This was observed on the following upgrade paths:

  stretch -> buster

For /usr/share/doc/PACKAGE this may not be problematic as long as both
packages are installed, ship byte-for-byte identical files and are
upgraded in lockstep. But once one of the involved packages gets
removed, the other one will lose its documentation files, too,
including the copyright file, which is a violation of Policy 12.5:
https://www.debian.org/doc/debian-policy/ch-docs.html#copyright-information

For other overwritten locations anything interesting may happen.

Note that dpkg intentionally does not replace directories with symlinks
and vice versa, you need the maintainer scripts to do this.
See in particular the end of point 4 in
https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#details-of-unpack-phase-of-installation-or-upgrade

It is recommended to use the dpkg-maintscript-helper commands
'dir_to_symlink' and 'symlink_to_dir' (available since dpkg 1.17.14)
to perform the conversion, ideally using d/$PACKAGE.maintscript.
See dpkg-maintscript-helper(1) and dh_installdeb(1) for details.


>From the attached log (scroll to the bottom...):

0m26.1s ERROR: FAIL: silently overwrites files via directory symlinks:
  /usr/share/doc/libgsm1-dev/MACHINES (libgsm1-dev:amd64) != 
/usr/share/doc/libgsm1/MACHINES (libgsm1:amd64)
/usr/share/doc/libgsm1-dev -> libgsm1
  /usr/share/doc/libgsm1-dev/README (libgsm1-dev:amd64) != 
/usr/share/doc/libgsm1/README (libgsm1:amd64)
/usr/share/doc/libgsm1-dev -> libgsm1
  /usr/share/doc/libgsm1-dev/changelog.Debian.gz (libgsm1-dev:amd64) != 
/usr/share/doc/libgsm1/changelog.Debian.gz (libgsm1:amd64)
/usr/share/doc/libgsm1-dev -> libgsm1
  /usr/share/doc/libgsm1-dev/changelog.gz (libgsm1-dev:amd64) != 
/usr/share/doc/libgsm1/changelog.gz (libgsm1:amd64)
/usr/share/doc/libgsm1-dev -> libgsm1
  /usr/share/doc/libgsm1-dev/copyright (libgsm1-dev:amd64) != 
/usr/share/doc/libgsm1/copyright (libgsm1:amd64)
/usr/share/doc/libgsm1-dev -> libgsm1


cheers,

Andreas


libgsm1-dev_1.0.18-1.log.gz
Description: application/gzip