X-Original-To: alpine-aports@mail.alpinelinux.org Delivered-To: alpine-aports@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 19BF6DC7C2B; Wed, 19 Aug 2015 08:27:01 +0000 (UTC) Received: from ncopa-desktop.alpinelinux.org (unknown [79.160.13.133]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: n@tanael.org) by mail.alpinelinux.org (Postfix) with ESMTPSA id 76F2BDC1152; Wed, 19 Aug 2015 08:27:00 +0000 (UTC) Date: Wed, 19 Aug 2015 10:26:56 +0200 From: Natanael Copa To: Isaac Dunham Cc: alpine-aports@lists.alpinelinux.org Subject: Re: [alpine-aports] Bugs in man and manpages Message-ID: <20150819102656.66bf85a7@ncopa-desktop.alpinelinux.org> In-Reply-To: <20150817041450.GD2568@newbook> References: <20150817041450.GD2568@newbook> X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.25; x86_64-alpine-linux-musl) X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP On Sun, 16 Aug 2015 21:14:51 -0700 Isaac Dunham wrote: > Hello all, > I've run into some issues related to manpages. > > 1- dangling links to manpages > I encountered some dangling links in dosfstools-doc, which pointed to > the original, uncompressed, manpages. > Apparently there's a bug in the abuild manpage compression code (lines > 1410-1413). While abuild does find and compress the actual manpages, > all the symlinks to the manpages never get updated. > > 2- translated manpages never get compressed. > A bug in the same code. > > Roughly, a fix for these issues could look like this: > > find "$subpkgdir"/usr/share/man/man[1-9]* \ > "$subpkgdir"/usr/share/man/*/man[1-9]* \ > -type f \! -name \*.gz \! -name \*.bz2 2>/dev/null | > xargs -r gzip -9 > find "$subpkgdir"/usr/share/man/man[1-9]* \ > "$subpkgdir"/usr/share/man/*/man[1-9]* \ > -type l \! -name \*.gz \! -name \*.bz2 2>/dev/null | { > while read MAN; do > case "$MAN" in > (*.gz|*.bz2);; > (*.[0-9]*) > ln -s `readlink "$MAN"`.gz "$MAN".gz > rm "$MAN" > ;; > esac > done > } we also need to deal with hardlinks. Maybe something like: local previnode= prevname= find "$subpkgdir"/usr/share/man/man[0-9]* \ -type f \! -name \*.gz \! -name \*.bz2 \ -exec stat -c "%i %n" {} \; | sort -n \ | while read inode name; do if [ "$inode" = "$previnode" ]; then # update hard link rm "$name" ln "$prevname".gz "$name".gz else gzip -9 "$name" fi previnode="$inode" prevname="$name" done find "$subpkgdir"/usr/share/man/man[0-9]* \ -type l \! -name \*.gz \! -name \*.bz2 \ | while read symlink; do ln -s $(readlink $symlink).gz "$symlink".gz rm "$symlink" done > Finally, there's an annoyance I have with mdocml. > It's impossible to specify the POSIX manpage if another manpage for the same command/function is installed in the same numeric section. > On Debian, you can have the manpages: > /usr/share/man/man1/ls.1 > /usr/share/man/man1/ls.1posix > > installed at the same time, and get the POSIX manpage via: > man 1p ls > > On Alpine, this fails; the root cause seems to be that if you specify a > section, mdocml insists on looking in > "/usr/share/man/man$SECTION/$COMMAND.$SECTION" > > > If you have both the Linux and POSIX manpages installed (which I always do), > "man 3 fprintf" gives you the Linux manpage, as would be expected. > But "man 3p fprintf" says "man: No entry for fprintf in the manual." > When I run > ln -s man3 /usr/share/man/man3p > man 3p fprintf > I end up getting the Linux manpage, which suggests that there *is* fuzzy matching code, but the logic is backwards. Is this a problem in our config or is it an upstream bug? > Thanks, > Isaac Dunham > > > --- > Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org > Help: alpine-aports+help@lists.alpinelinux.org > --- > --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---