On Mon Dec 06, 2021 at 09:44:51AM +0000, Stuart Henderson wrote: > On 2021/12/06 07:07, Rafael Sadowski wrote: > > On Sun Dec 05, 2021 at 09:46:33AM +0000, Stuart Henderson wrote: > > > That Python file just looks like a script that is run. The .pyc bytecode > > > files are only used for things which are pulled in by "import" from a > > > python > > > program. (in most cases this is for modules which are in > > > /usr/local/lib/python3.9 etc). So I think the MODPY_COMPILE is not useful. > > > > > > > Makes total sense and thanks for the explanation. Learned something > > again. New diff with a comment otherwise I will forget about it again > > for the next update. > > Could do, though it would be better if portcheck would avoid bogus warnings. > Maybe this is better. It might miss some cases but probably not many (the > main problem it tries to solve is that if a program is run by root, > pyc files might get created and left behind after pkg_delete). >
Do you want to commit this? > Index: portcheck > =================================================================== > RCS file: /cvs/ports/infrastructure/bin/portcheck,v > retrieving revision 1.139 > diff -u -p -r1.139 portcheck > --- portcheck 14 Aug 2021 06:56:18 -0000 1.139 > +++ portcheck 6 Dec 2021 09:42:10 -0000 > @@ -1132,16 +1132,13 @@ check_plist() { > ;; > > # XXX KSH arrays are limited to 10239 items > - share/@(doc|*(*/)examples)+(/*).py|?(s)bin/*.py) > - # ignore > - ;; > - *.py) > + lib/python*/*/*.py) > py_files[${#py_files[@]}]=$l > ;; > - *.pyc) > + lib/python*/*/*.pyc) > pyc_files[${#pyc_files[@]}]=$(normalize_pyco "$l") > ;; > - *.pyo) > + lib/python*/*/*.pyo) > pyo_files[${#pyo_files[@]}]=$(normalize_pyco "$l") > ;; > >