Ticket #2692 (closed defect: fixed)
Date not set properly in manpage
Reported by: | egmont | Owned by: | slavazanko |
---|---|---|---|
Priority: | major | Milestone: | 4.8.3 |
Component: | mc-core | Version: | 4.8.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | merged | Votes for changeset: | committed-master committed-stable |
Description
After installing mc-4.8.1 the footer of the manpage says:
MC Version 4.8.1 @DATE_OF_MAN_PAGE@ MC(1)
Running just the configure script (and no make) already generates mc.1 from mc.1.in (and similarly for all other manpages) and substitutes all the varibables (like version number, path prefixes) except for the date.
Running make in that directory would substitute the version number too, but the target file is already more recent than the source, so this step is not executed. If you remove mc.1 or touch it back in time, then a make generates mc.1 with a proper date.
I don't know what the desired solution would be, but it seems currently that configure and make are working against each other, they both try to do the same thing (and do it differently). It should be the responsibility of one of them to generate the manpages from the corresponding *.in files.
Also note (moving here from ticket #2689) that the code that updates the date in the manpage uses "stat -c" and "date -d", both are apparently GNU/Linux stuff, not supported on Mac or probably on *BSD.
As a partial solution, maybe the best solution would be to substitute the version number and date when the dist tarball is created (as part of running autoconf/automake), so the user gets these ready. This way creating a tarball or compiling from git probably still wouldn't work on Mac, but at least compiling a tarball would go fine. (I'm wondering, I don't know: is there a best practice for this in other free software?)
I'll try to find the proper cross-OS command to print the timestamp of a file.
Change History
comment:2 Changed 13 years ago by egmont
Yep I was just gonna figure out if perl was already used or ask if it's acceptable. Seems I'll go for that. BSD's stat and date are just ridiculously stupid.
comment:3 Changed 13 years ago by angel_il
if `perl -v > /dev/null 2>&1` ; then echo "perl found!" fi
comment:4 Changed 13 years ago by slavazanko
- Owner set to slavazanko
- Status changed from new to accepted
comment:5 Changed 13 years ago by slavazanko
- Branch state changed from no branch to on review
Created branch 2692_manpage_broken_date
Review, please.
comment:8 Changed 13 years ago by egmont
I'm afraid this change would break compilation on Mac, since that has that braindamaged 'date' and 'stat' commands. I don't have my Mac with me right now to verify this.
The solution could be to replace the date and stat commands with a perl script, as mentioned above; or to move the substitution of date (and maybe version number too) from the normal configure&&make phase to the autogen phase (which would still break on Mac for git version, but would keep tarballs working).
I'd be happy to write the perl program in a couple of days, just please hold on your current change until then ;)
comment:9 Changed 13 years ago by egmont
Oh wait... apparently you did get rid of date and stat??? You rock!
Anyway, I'll double check on Mac and get back to you with the results.
comment:10 Changed 13 years ago by slavazanko
Anyway, I'll double check on Mac and get back to you with the results.
Okay, we awaiting.
comment:11 Changed 13 years ago by egmont
Here's what I'm trying to do, since I cannot run ./autogen on my Mac:
on Linux:
git clone ...
git checkout 2692_manpage_broken_date
create tarball as written here https://www.midnight-commander.org/wiki/ReleaseGuidelines , skipping the .po files part.
copy the tarball over to Mac
on Mac:
./configure && make && make install
Here's where it goes wrong:
The tarball does not contain the manpages - I guess this was broken by this branch; the tarball created from the main git branch is okay.
comment:12 Changed 13 years ago by slavazanko
Wow, no man-files in tarball, really. This my fail. Egmont, thanks for this good testing. I'll fix it as soon.
comment:13 Changed 13 years ago by slavazanko
Fixed in latest commit of branch. review, please.
comment:14 Changed 13 years ago by egmont
"awk: calling undefined function strftime"
I'm sorry that Mac sucks so much :( Seems perl is the only tool we can trust.
Two more notes:
date-of-man-include.am sets LC_TIME, but this can be overridden by LC_ALL if the user has that set, leading to incorrect language and even to incorrect charset. I think date-of-man-include.am should override LC_ALL instead.
For Hungarian (hu), the date format should be like "2012. március", that is,
DATE_FORMAT=%Y. %B
Could you please fix this as well?
Thanks!
comment:15 Changed 13 years ago by slavazanko
Egmont, try to check the latest changes in branch on MacOS. Now used just perl for setting the dates on man-pages.
For Hungarian (hu), the date format should be like "2012. március", that is,
DATE_FORMAT=%Y. %B
Could you please fix this as well?
Done.
comment:16 Changed 13 years ago by egmont
Date substitution now works great :)
"make install" puts the i18n manpages into ${prefix}/share/man/hu_HU/man1 and similar, instead of ${prefix}/share/man/hu/man1 - I guess this might cause problems with various man readers.
Also, could you please consider overriding LC_ALL instead of LC_TIME, as per the previous comment?
thanks!
comment:17 Changed 13 years ago by slavazanko
"make install" puts the i18n manpages into ${prefix}/share/man/hu_HU/man1 and similar, instead of ${prefix}/share/man/hu/man1 - I guess this might cause problems with various man readers.
Oh, my fail. I errorneusly changed LANG variable. Fixed
Also, could you please consider overriding LC_ALL instead of LC_TIME, as per the previous comment?
Done. Thanks for testing!
comment:18 Changed 13 years ago by egmont
Perfect! Thanks sooo much! :)
comment:20 Changed 13 years ago by angel_il
- Votes for changeset changed from andrew_b to andrew_b angel_il
- Branch state changed from on review to approved
comment:21 Changed 13 years ago by slavazanko
- Status changed from accepted to testing
- Votes for changeset changed from andrew_b angel_il to committed-master
- Resolution set to fixed
- Branch state changed from approved to merged
merged to master:
git log --pretty=oneline ea82ca4..cd1f777
comment:22 Changed 13 years ago by slavazanko
- Keywords stable-candidate removed
- Status changed from testing to closed
- Votes for changeset changed from committed-master to committed-master committed-stable
merged to stable:
git log --pretty=oneline b7eb59e..344130d
perl