Bug 235169

Summary: lang/python-doc-html: Update 3.7 doc entries to 3.7.2. Add missing entries, Remove python34 entries
Product: Ports & Packages Reporter: Craig Leres <leres>
Component: Individual Port(s)Assignee: Craig Leres <leres>
Status: Closed FIXED    
Severity: Affects Some People CC: python, sunpoet
Priority: --- Keywords: feature
Version: LatestFlags: koobs: maintainer-feedback+
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch
none
Script to generate distinfo
none
patch koobs: maintainer-approval+

Description Craig Leres freebsd_committer 2019-01-23 23:42:23 UTC
I'd like to build lang/python-doc-html for python 3.7.2 but the distinfo lines are missing.
Comment 1 Craig Leres freebsd_committer 2019-01-23 23:43:25 UTC
Created attachment 201372 [details]
patch
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2019-01-25 01:38:58 UTC
Thanks Craig.

Also, it looks like:

1) The other doc types (-pdf-{letter,a4},text need to be updated to 3.7.2 as well
2) python35 entries are missing entirely
3) python34 entries can be removed (lang/python34 has been deleted)

It would be really cool to have a make target that updated distinfo entries for all versions/types automatically.
Comment 3 Craig Leres freebsd_committer 2019-01-25 08:29:12 UTC
Created attachment 201386 [details]
Script to generate distinfo

On 1/24/19 5:38 PM, bugzilla-noreply@freebsd.org wrote:
> It would be really cool to have a make target that updated distinfo entries for
> all versions/types automatically.

Yes!

Here's a hack that does the job. I started trying to add a makesumall target to the Makefile but it's way too hard to write a .for loop that does the right thing so I reverted to a /bin/sh script. I don't like that it uses distinfo as a temp file (it didn't look easy to change where the makesum.sh script writes its output) and also that the docformats are hardcoded but it gets the job done.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2019-01-26 01:03:08 UTC
3.7.2 entries were added by sunpoet@ in ports r491197
Comment 5 Sunpoet Po-Chuan Hsieh freebsd_committer 2019-01-26 10:51:19 UTC
Python 3.5 is an upstream issue. They only provide 3.5.6 documentation but no 3.5.8 one.
3.4.8 entries are removed in ports r491257.
Comment 6 Craig Leres freebsd_committer 2019-01-26 18:12:46 UTC
Can we use a version of the script I attached to this PR? It adds distinfo for all of the lang/python[23]? ports (including 3.5.6 which is currently missing).
Comment 7 Sunpoet Po-Chuan Hsieh freebsd_committer 2019-01-28 03:00:51 UTC
(In reply to Craig Leres from comment #6)

Don't why I read 3.5.6 and 3.6.8 as 3.5.8. I've added 3.5.6 entries in r491447.
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2019-01-28 03:10:11 UTC
(In reply to Craig Leres from comment #6)

Yep, that would be the goal. Could you convert the shell script attachment to a diff against the port adding a make target?

It might be worth making it a replacement of, part of, extension of, or supplement to (post-makesum:), the standard makesum target
Comment 9 Craig Leres freebsd_committer 2019-01-28 07:13:29 UTC
Created attachment 201472 [details]
patch

(In reply to Kubilay Kocak from comment #8)
I figured out a cleaner way to do this. It's basically a shell script that generates a minimal, temporary makefile that can be used to generate the distfiles file.

I also marked my original patch obsolete since distfiles has been updated by now (although ordered differently that the script generates).
Comment 10 Kubilay Kocak freebsd_committer freebsd_triage 2019-01-28 09:35:11 UTC
(In reply to Craig Leres from comment #9)

Thank you for that Craig. Happy to approve the addition if its been tested and you're confident with it. 

Only feedback I can provide is that it's probably worth using WRKDIR for any temp files, rather than /tmp or anywhere else on the filesystem to keep it all self contained
Comment 11 Craig Leres freebsd_committer 2019-01-28 17:18:47 UTC
(In reply to Kubilay Kocak from comment #10)

At first using WRKDIR seemed like a great idea but I see now that when it doesn't exist I'll have to create it. Is it really ok for "make makesum" to have the side effect of leaving a "work" sub-directory around? I would think this would only be used interactively and not from inside a poudriere jail.
Comment 12 Kubilay Kocak freebsd_committer freebsd_triage 2019-01-29 01:03:26 UTC
(In reply to Craig Leres from comment #11)

Not sure, on one hand we'd like any temporary artifacts cleaned up with any make clean, on the other makesum doesn't doesn't run after or rely on WRKDIR being created. I thought about using the port directory itself (.CURDIR) instead, but that doesn't solve the leftover artifacts issue either.

Perhaps the script can clean up the temp file? If not trivial/possible, happy to have this committed as is.
Comment 13 Kubilay Kocak freebsd_committer freebsd_triage 2019-01-29 01:06:40 UTC
Committed, but no PR referenced:

- Update 3.7.x distinfo entries for 3.7.2 (ports r491197)
- Remove 3.4.x distinfo entries, lang/python34 deleted (ports r491257)
- Add 3.5.x distinfo entries (ports r491447)
Comment 14 Craig Leres freebsd_committer 2019-01-29 03:04:07 UTC
(In reply to Kubilay Kocak from comment #12)

I used:

    trap 'rm -f $${t1}' exit

and in my testing I've yet to see it leak a temp file.
Comment 15 Kubilay Kocak freebsd_committer freebsd_triage 2019-01-29 11:35:42 UTC
Comment on attachment 201472 [details]
patch

Approved by: koobs (python)

Over to you Craig, and thank you for the feature :)
Comment 16 Kubilay Kocak freebsd_committer freebsd_triage 2019-01-29 11:36:33 UTC
Comment on attachment 201472 [details]
patch

Approved by: koobs (python)
Approved by: koobs (ports)
Comment 17 commit-hook freebsd_committer 2019-02-15 02:55:16 UTC
A commit references this bug:

Author: leres
Date: Fri Feb 15 02:54:53 UTC 2019
New revision: 492965
URL: https://svnweb.freebsd.org/changeset/ports/492965

Log:
  When doing makesum set MASTER_SITES and DISTFILES that generate a
  distinfo containing all supported Python versions vs. all document
  formats.

  While we're here update distfiles to match the new order (i.e.
  _PYTHON_VERSIONS from Uses/python.mk).

  PR:		235169
  Reviewed by:	koobs (python, ports), matthew (mentor)
  Approved by:	koobs (python, ports), matthew (mentor)
  Differential Revision:	D19064

Changes:
  head/lang/python-doc-html/Makefile
  head/lang/python-doc-html/distinfo
Comment 18 Craig Leres freebsd_committer 2019-02-15 03:11:55 UTC
Thanks to all who helped me put the polish on this change!