Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date not set properly in manpage #2692

Closed
mc-butler opened this issue Dec 16, 2011 · 22 comments
Closed

Date not set properly in manpage #2692

mc-butler opened this issue Dec 16, 2011 · 22 comments
Assignees
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress ver: 4.8.1 Reproducible in version 4.8.1
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/2692
Reporter egmont (@egmontkob)

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.

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Dec 16, 2011 at 16:06 UTC (comment 1)

I'll try to find the proper cross-OS command to print the timestamp of a file.

perl

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Dec 16, 2011 at 16:52 UTC (comment 2)

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.

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Dec 16, 2011 at 20:02 UTC (comment 3)

if `perl -v > /dev/null 2>&1` ; then
    echo "perl found!"
fi

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Mar 22, 2012 at 16:01 UTC (comment 4)

  • Owner set to slavazanko
  • Status changed from new to accepted

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Mar 22, 2012 at 17:16 UTC (comment 5)

  • Branch state changed from no branch to on review

Created branch 2692_manpage_broken_date [6b8d17831de22ba2734d3a9ab4b88327885984a7]

Review, please.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Mar 22, 2012 at 17:31 UTC (comment 6)

  • Keywords set to stable-candidate

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Mar 22, 2012 at 19:02 UTC (comment 7)

  • Milestone changed from Future Releases to 4.8.3

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Mar 23, 2012 at 15:10 UTC (comment 8)

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 ;)

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Mar 23, 2012 at 15:15 UTC (comment 9)

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.

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Mar 25, 2012 at 13:51 UTC (comment 10)

Anyway, I'll double check on Mac and get back to you with the results.

Okay, we awaiting.

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Mar 26, 2012 at 12:31 UTC (comment 11)

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.

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Mar 27, 2012 at 8:57 UTC (comment 12)

Wow, no man-files in tarball, really. This my fail. Egmont, thanks for this good testing. I'll fix it ASAP.

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Mar 27, 2012 at 9:45 UTC (comment 13)

Fixed in latest commit of branch. review, please.

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Mar 27, 2012 at 10:38 UTC (comment 14)

"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!

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Mar 28, 2012 at 11:17 UTC (comment 15)

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.

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Mar 28, 2012 at 11:54 UTC (comment 16)

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!

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Mar 28, 2012 at 12:11 UTC (comment 17)

"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!

@mc-butler
Copy link
Author

Changed by egmont (@egmontkob) on Mar 28, 2012 at 13:36 UTC (comment 18)

Perfect! Thanks sooo much! :)

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Mar 29, 2012 at 10:26 UTC (comment 19)

  • Votes set to andrew_b

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Apr 2, 2012 at 9:58 UTC (comment 20)

  • Votes changed from andrew_b to andrew_b angel_il
  • Branch state changed from on review to approved

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Apr 2, 2012 at 10:50 UTC (comment 21)

  • Status changed from accepted to testing
  • Votes 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

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Apr 2, 2012 at 10:55 UTC (comment 22)

  • Keywords stable-candidate deleted
  • Votes changed from committed-master to committed-master committed-stable
  • Status changed from testing to closed

merged to stable:

git log --pretty=oneline b7eb59e..344130d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: core Issues not related to a specific subsystem prio: medium Has the potential to affect progress ver: 4.8.1 Reproducible in version 4.8.1
Development

No branches or pull requests

2 participants