On Wed, 15 Mar 2017 18:39:14 +0100 Markus Koschany <[email protected]> wrote:
> I recently created a maintscript file for holotz-castle to convert
> symlinks to real directories on upgrade.
>
> maintscript:
maintscript files are for debhelper (dh_installdeb), not dpkg.
> symlink_to_dir /usr/share/doc/holotz-castle /usr/share/doc/holotz-castle-data
> 1.3.14-8~ holotz-castle
> symlink_to_dir /usr/share/doc/holotz-castle-editor
> /usr/share/doc/holotz-castle-data 1.3.14-8~ holotz-castle-editor
>
> Currently the syntax described in the man page is as follows:
>
> symlink_to_dir pathname old-target [prior-version [package]]
>
> I was under the impression that symlink_to_dir will act on [package]
> name but apparently maintscript without the $PACKAGE prefix will only
> act on the first binary package. I find this behavior rather confusing
> at the moment. For a package with ten binary packages this would
> require up to ten different $PACKAGE.maintscript files which seems to
> be impractical to me.
I don't see much difference between 1 file with 10 lines and 10 files
with 1 line each.
> I would appreciate it if maintscript acted on [package] instead. If
> you don't want to implement this feature, please consider to update
> the man page of dpkg-maintscript-helper which should be more precise
> why specifying [package] is needed at all.
The "package" argument is not about the package that makes the changes,
but about the package owning the stuff being acted upon. Usually both
are the same and the "package" argument can be omitted.
I think the "package" argument is not used for symlink_to_dir, but
needed for dir_to_symlink ("Is all the stuff found in dir owned by
$package?"). Or for rm_conffile/mv_conffile cases where the conffile was
previously owned by a *different* package.
Maybe something could be accomplished with dh-exec, but that sounds like
overkill ...
Andreas
PS: at some point I would have liked to put all the lintian overrides in
one file ... it sounded so natural to just dump a bit of lintian's
output into a single ignore list ... and so redundant to prefix each
line in $package.lintian_overrides with "$package: " - but luckily that
can be omitted :-)