Bug 205056

Summary: Mk/Uses/python.mk: USE_PYTHON=autoplist fails to generate the correct plist when some tag is empty in setup.cfg
Product: Ports & Packages Reporter: Yuri Victorovich <yuri>
Component: Ports FrameworkAssignee: freebsd-python (Nobody) <python>
Status: New ---    
Severity: Affects Only Me CC: ant, antoine, arrowd, freebsd, mva, osidorkin, pi, ports-bugs, python, trombik1973
Priority: --- Keywords: needs-qa
Version: LatestFlags: arrowd: maintainer-feedback? (python)
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201386
Attachments:
Description Flags
patch to add special handling for directoried with USE_PYTHON=autoplist none

Description Yuri Victorovich freebsd_committer freebsd_triage 2015-12-06 11:51:24 UTC
For this very simple port:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201386

This error occurs without the patch:
> # make check-plist
> ====> Checking for pkg-plist issues (check-plist)
> ===> Parsing plist
> ===> Checking for items in STAGEDIR missing from pkg-plist
> Error: Orphaned: @dir bandit
> ===> Checking for items in pkg-plist which are not in STAGEDIR
> Error: Missing: bandit
> ===> Error: Plist issues found.
> *** Error code 1

The cause is the empty bandit= tag in setup.cfg:
> [files]
> data_files = 
>         bandit =

I am not familiar with 'autoplist', somebody should take a look why this empty tag triggers the error in plist.
Comment 1 Gleb Popov freebsd_committer freebsd_triage 2020-09-11 14:37:01 UTC
Is this still relevant? Yuri, can you assess?
Comment 2 Oleg Sidorkin 2021-05-05 16:30:11 UTC
Created attachment 224696 [details]
patch to add special handling for directoried with USE_PYTHON=autoplist

Some python packages adds empty directories entries to the list of installed files. python.mk blindly copies these entries to the plist file, and then such plist produces some strange effects (e.g. pkg fails to calculate sha256).

I've spotted this when tried to update py-buildbot port.

Attached patch adds a check if the given entry is a directory and adds @dir prefix to directory entries.

I can attach my version of buildbot port that reproduces this problem.
Comment 3 Anthony Johnston 2021-09-20 15:54:47 UTC
(In reply to Oleg Sidorkin from comment #2)

I can confirm this is (1) An actual problem; and (2) This patch seems to solve, at least for me, for buildbot.

I have been working on getting the buildbot port upgraded, and this was the blocker.