Created attachment 206316 [details] patch-Makefile - fix the man page before install "man lsof" returns no such man page exists. The man page does exist, but it uses the ".so" include directive. This directive tries to include additional files, which exist in the stagedir, but not on install. This patch uses 'mandoc' to pre-process the ".so" directive at build time. It also includes a SED kludge to fix a weird error. The result of this patch is: * 04:48 (303) "lsof-4.93.2" root@thompson# sed 's/\\$/\\DUMMY/' Lsof.8 | mandoc -man -T man | sed 's/DUMMY$//' | diff - Lsof.8 1,2c1 < .ds VN 4.93.2 < --- > .so ./version 78,82c77 < Apple Darwin 9 and Mac OS X 10.[567] < FreeBSD 8.[234], 9.0 and 1[012].0 for AMD64-based systems < Linux 2.1.72 and above for x86-based systems < Solaris 9, 10 and 11 < --- > .so ./00DIALECTS 4533d4527 < The patch is attached: cheers, Jamie
Created attachment 206321 [details] svn-diff-manpage-lsof The patch of Jamie does not work.
Created attachment 206323 [details] svn-diff-manpage-lsof-v2 Misses "1" in the REINPLACE_CMD.
Hi. In which way doesn't it work? It works fine for me. Your solution is better than nothing, but it causes the included bits to be dropped. cheers
It produces the original error: man lsof No manual entry for lsof
I don't understand this part ${SED} 's/\\$$/\\DUMMY/' You try replace \$ with \DUMMY. But there is no \$ in the code.
What version of freebsd are you running? Does it have "mandoc"? I verified by re-downloading the patch from this attachment and patching against a fresh port checkout. giving: % l /usr/local/man/man8/lsof.8.gz 40 -r--r--r-- 1 root wheel - 37,611 7 Aug 12:58 /usr/local/man/man8/lsof.8.gz I'm using 12-stable --------- The offending line is line 8. The "$" is the RE for end of line, hence the match is for '/' as the last character of a line. For some reason, the trailing '/' causes the conversion by "mandoc" to get corrupted. Hence the kludge to change it for "dummy", do the conversion, then put it back again. I don't know if it's the fault of mandoc, or the manpage itself - I am not familiar with mdoc / man / roff formatting. Hence the kludge. The before/after diff is shown in my first comment. Without the sed kludge, this diff is instead: 13:36 (14) "lsof-4.93.2" jamie@thompson% mandoc -man -T man Lsof.8 | diff - Lsof.8 1,2c1 < .ds VN 4.93.2 < --- > .so ./version 7c6 < .if !\n(.g \{. if !\n()P .nr )P 1v --- > . if !\n()P .nr )P 1v 78,82c77 < Apple Darwin 9 and Mac OS X 10.[567] < FreeBSD 8.[234], 9.0 and 1[012].0 for AMD64-based systems < Linux 2.1.72 and above for x86-based systems < Solaris 9, 10 and 11 < --- > .so ./00DIALECTS 4533d4527 < That "if..." line is corrupted, and man terminates at that point, showing an empty man page containing just the header and footer.
Sorry, obviously I mean the match is for '\' as the last character of the line, not '/'
I have 11.2-amd64. Has mandoc.
What's the file size/datestamp of the file? % l /usr/local/man/man8/lsof.8.gz 40 -r--r--r-- 1 root wheel - 37,611 7 Aug 12:58 /usr/local/man/man8/lsof.8.gz
-r--r--r-- 1 root wheel 37519 7 Aug. 14:49 /usr/local/man/man8/lsof.8.gz
That's the size of the unpatched file, presumably: SHA256 (/snapshots/weekly/0/usr/local/man/man8/lsof.8.gz) = 5fb2865609d8809861acec482b6d24f76005ab6fcfd925042a41ebc5e0dbcdac Do you get the command appearing in "make stage" ? 14:53 (14) "lsof" root@thompson# make stage ===> Staging for lsof-4.93.2_3,8 ===> Generating temporary packing list install -s -m 555 /scratch/root/ports_base/usr/ports/sysutils/lsof/work/lsof-4.93.2/lsof /scratch/root/ports_base/usr/ports/sysutils/lsof/work/stage/usr/local/sbin (cd /scratch/root/ports_base/usr/ports/sysutils/lsof/work/lsof-4.93.2 && /usr/bin/sed 's/\\$/\\DUMMY/' Lsof.8 | mandoc -T man | /usr/bin/sed 's/DUMMY$//' > /scratch/root/ports_base/usr/ports/sysutils/lsof/work/lsof-4.93.2/lsof.8) install -m 444 /scratch/root/ports_base/usr/ports/sysutils/lsof/work/lsof-4.93.2/lsof.8 /scratch/root/ports_base/usr/ports/sysutils/lsof/work/stage/usr/local/man/man8/lsof.8 install -m 555 /scratch/root/ports_base/usr/ports/sysutils/lsof/work/lsof-4.93.2/scripts/* /scratch/root/ports_base/usr/ports/sysutils/lsof/work/stage/usr/local/share/lsof ====> Compressing man pages (compress-man)
sha256 is irrelevant, I am using portsnap and not svn. Yes, I see the command, if I "make stage".
Created attachment 206335 [details] svn-diff-manpage-new-patch This should work, I think.
portsnap or svn are not relevant (I use portsnap too) - the sha256 was not of the source files, but the resultant lsof.8.gz file (to show that yours hadn't altered) ... No, your new patch just hardcode-includes the manual page for the old 4.89 version. I've tested my patch on 12-stable, 11.1, and a freshly installed 11.3 with no changes, and it works - maybe you should investigate why yours doesn't? # # uname -a FreeBSD catmin 11.3-RELEASE FreeBSD 11.3-RELEASE #0 r349754: Fri Jul 5 04:45:24 UTC 2019 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 # # sed 's/\\$/\\DUMMY/' Lsof.8 | mandoc -man -T man | sed 's/DUMMY$//' | diff - Lsof.8 1,2c1 < .ds VN 4.93.2 < --- > .so ./version 78,82c77 < Apple Darwin 9 and Mac OS X 10.[567] < FreeBSD 8.[234], 9.0 and 1[012].0 for AMD64-based systems < Linux 2.1.72 and above for x86-based systems < Solaris 9, 10 and 11 < --- > .so ./00DIALECTS 4533d4527 <
Last try worked with your patch. Don't ask me what changed. Any non-printable character or something else.
Sorry, I didn't mean to sound rude. It would be useful to see why this doesnt' work for you: # sed 's/\\$/\\DUMMY/' Lsof.8 | mandoc -man -T man | sed 's/DUMMY$//' | diff - Lsof.8 as it may affect others too. locale? environment?
> as it may affect others too. locale? environment? maybe, I have: ANG=de_DE.UTF-8 LC_CTYPE="de_DE.UTF-8" LC_COLLATE="de_DE.UTF-8" LC_TIME="de_DE.UTF-8" LC_NUMERIC="de_DE.UTF-8" LC_MONETARY="de_DE.UTF-8" LC_MESSAGES=C LC_ALL=
That made no difference for me... So, to recap, you're saying this produces no output? : # mandoc -Tman Lsof.8 |diff - Lsof.8
I never said. You patch seemed produce no manpage. But as I wrote, this is now working. Let it be. If it was a non-printing character, a paiste thing or a locale thing, you will never find out.
:-) As long as it works now!
A commit references this bug: Author: ler Date: Sat Aug 10 22:44:29 UTC 2019 New revision: 508510 URL: https://svnweb.freebsd.org/changeset/ports/508510 Log: sysutils/lsof: fix build on -current, fix man page - fix build post r350531 [0] - fix manpage. [1] PR: 239686 [1], 239754 [0] Submitted by: yasu@utahime.org [0], jamie@catflap.org [1] Changes: head/sysutils/lsof/Makefile head/sysutils/lsof/files/patch-dialects_freebsd_dsock.c
committed, thanks!
Cheers Larry and Walter!