pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Can't quite figure out how to use logic from lang/python/plist-python.awk

On 2019-02-11 15:51, Greg Troxel wrote:
Aleksej Lebedev <> writes:

If I prefix ${PYSITELIB}/conans/test/unittests/model/info/
(along with .pyc & .pyo) with ${PLIST.py2x} the first part of the
warning above disappears.

However, adding
(I tried adding .pyc and .pyo enrties as well) to PLIST doesn't fix
the second part.

There is that extra cache dir.

I see that it works exactly as expected in devel/py-future/PLIST, but
I can't figure
what's wrong my PLIST.

There are two things: one is if the package installs the right files,
and second if the PLIST captures that list correctly.

I am doing my best to trace where exactly it is going wrong, but maybe
somebody more
experienced can already spot the problem or direct me to how to debug
this awk scripts easily?

The real question is why __pycache__ appears and if that's a rule in
py36, or odd in this package.  The next question is about adjusting
expectations to match python norms, if they are off.

This seems normal to me. These files in __pycache__ should be automatically
added to the final PLIST by lang/python/plist-python.awk:

/^[^@]/ && /[^\/]+\.py[co]$/ {
	sub(/[^\/]+\.py[co]$/, "__pycache__/&")
	sub(/\.py[co]$/, ".cpython-" PYVERS "&")
	if (PYVERS ~ /^3[5-9]$/ && $0 ~ /\.pyo$/) {
		sub(/\.pyo$/, ".opt-1.pyc")

And I see them being added when the package devel/py-future is built.
But for some reason it's not working for wip/py-conan.

I set PKG_DEBUG_LEVEL=1 so that I can now see how exactly awk is executed, but the whole command line giant and I am still analyzing what it's doing.

It sounds like one of your packages is behaving as expected, and I would
expect most are or we'd be seeing this issue a lot.

So I would first try to understand why __pycache__ appears in the path
and if you think that is correct/normal or not.

Well, this sees standard for python3 after some version. And the awk-file
that adds these cache files is automatically appended to PLIST_AWK.

Currently I think there is some problem in other awk functions that run before
plist-python.awk. But I am not 100% sure yet.

Aleksej Lebedev

Home | Main Index | Thread Index | Old Index