Bug#1026309: dh_link: Dynamically create symlinks for localized man pages

2022-12-18 Thread Helge Kreutzmann
Hello Niels,
On Sun, Dec 18, 2022 at 11:22:39AM +0100, Niels Thykier wrote:
> Helge Kreutzmann:
> > Package: debhelper
> > Version: 13.11.1
> > Severity: wishlist
> > Tags: l10n
> > X-Debbugs-Cc: Marc Haber 
> >  > [...]
> > 
> > Depending on the translator's work, man pages might appear or vanish
> > (if they are not translated enough, see po4a(1) for details).
> > Therefore, creating and maintaining static .links files for dh_link is
> > not an option. [...]
> > 
> > 
> > [...]

> This sounds like a case for having your .links file be executable with a
> custom generator.  In this case, your .links file will be run as a script
> and its output (stdout) will be used as the .links file (albeit, debhelper
> is more strict with generated output - e.g., no comments).
> 
> 
> Something like:
> """
> cat > debian/pkg.links < #!/bin/sh
> for LINE in $(cat "${path_to}/links.txt") ; do
> source=$(...)
> if [ -f "${source}" ]; then
> link_target=$(...)
> link_dest=$(...)
> echo "${link_target} ${link_dest}"
> fi
> done
> EOF
> chmod +x debian/pkg.links
> """
> 
> 
> Should work as a starting point (though I have left some $(...) parts for
> you to fill in).
> 
> This feature is already supported by debhelper and enables you to have
> package specific custom logic that match exactly your needs.

Thank you very much for this proposal. I wasn't aware that something
like this is possible.

I will try this out, this looks quite promising.

Thanks again.

Greetings

 Helge

-- 
  Dr. Helge Kreutzmann deb...@helgefjell.de
   Dipl.-Phys.   http://www.helgefjell.de/debian.php
64bit GNU powered gpg signed mail preferred
   Help keep free software "libre": http://www.ffii.de/


signature.asc
Description: PGP signature


Bug#1026309: dh_link: Dynamically create symlinks for localized man pages

2022-12-18 Thread Niels Thykier

Helge Kreutzmann:

Package: debhelper
Version: 13.11.1
Severity: wishlist
Tags: l10n
X-Debbugs-Cc: Marc Haber 
 > [...]

Depending on the translator's work, man pages might appear or vanish
(if they are not translated enough, see po4a(1) for details).
Therefore, creating and maintaining static .links files for dh_link is
not an option. [...]


[...]




Hi Helge,

This sounds like a case for having your .links file be executable with a 
custom generator.  In this case, your .links file will be run as a 
script and its output (stdout) will be used as the .links file (albeit, 
debhelper is more strict with generated output - e.g., no comments).



Something like:
"""
cat > debian/pkg.links 

Bug#1026309: dh_link: Dynamically create symlinks for localized man pages

2022-12-17 Thread Helge Kreutzmann
Package: debhelper
Version: 13.11.1
Severity: wishlist
Tags: l10n
X-Debbugs-Cc: Marc Haber 

I'm the Debian maintainer for manpages-l10n. This package carries
thounds of man pages for various languages.  As in the english 
original, man pages are known under various names and .so links are 
present. Upstream converts this .so links to a small text file
(callled links.txt) which would be handy for dh_link(1). This 
file contains all known so links.

Depending on the translator's work, man pages might appear or vanish 
(if they are not translated enough, see po4a(1) for details).
Therefore, creating and maintaining static .links files for dh_link is
not an option. Even creating the file with some helper code before the
build is not possible - only after building the pages I know if the
translation (i.e. the source file for dh_link) is there or not (for 
this language).

Upstreams links.txt is the "complete set", i.e. in
case *all* man pages would be translated, this would be the .links
file (maybe with some slight massaging to add the build path).
(Ideally the file name for dh_link would not be hardcoded).

However, if I provide this list to dh_link then *all* links are
created, even if the man page is not present (not build), creating
dangling symlinks. 

Therefore it would be great if I could provide dh_link (or
dh_installman) with this file and only those links are set where the
source file actually exists.

Possibly this could also be resolved differently, I noticed #971039
and #1006939 which are adressing similiar (albeit slightly different)
issues; thus I took Marc in CC.

Until this is implemented, I'm looking how to do this myself in
manpages-l10n.

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to de_DE.UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages debhelper depends on:
ii  autotools-dev20220109.1
ii  dh-autoreconf20
ii  dh-strip-nondeterminism  1.13.0-2
ii  dpkg 1.21.12
ii  dpkg-dev 1.21.12
ii  dwz  0.14+20220924-2
ii  file 1:5.41-4
ii  libdebhelper-perl13.11.1
ii  libdpkg-perl 1.21.12
ii  man-db   2.11.1-1
ii  perl 5.36.0-6
ii  po-debconf   1.0.21+nmu1

debhelper recommends no packages.

Versions of packages debhelper suggests:
ii  dh-make  2.202204

-- no debconf information

-- 
  Dr. Helge Kreutzmann deb...@helgefjell.de
   Dipl.-Phys.   http://www.helgefjell.de/debian.php
64bit GNU powered gpg signed mail preferred
   Help keep free software "libre": http://www.ffii.de/


signature.asc
Description: PGP signature