Wednesday, August 31, 2022

Re: PERMIT_* Audit

Ok. Thanks for the tip.

> On Aug 30, 2022, at 3:27 AM, Stuart Henderson <stu@spacehopper.org> wrote:
>
> On 2022/08/29 23:53, William Rusnack wrote:
>> I have been learning about ports and found a number of strange values in the make files for PERMIT_PACKAGE and PERMIT_DISTFILES.
>>
>> Some of the interesting values were:
>> stupid license
>> unclear license
>> incomplete/bad license
>> yEs
>>
>> I have included my commands to find these
>> ```
>> # Finds all the Makefiles with its PERMIT_* value
>> find /usr/ports/ -name Makefile -exec grep -H '^PERMIT' '{}' ';' > /tmp/permits.txt
>>
>> # Show the various unique values
>> cat /tmp/permits.txt | tr -d '\t' | sed -e 's/^.*://' -e 's/ *= */ = /' | sort -u
>>
>> # Filename with values that are not Yes nor No
>> cat /tmp/permits.txt | tr -d '\t' | tr ':' ' ' | sed 's/ *= */ = /' | sort -k 2 -t ' ' | grep -v -e 'yes$' -e 'no$' -e 'Yes$' -e 'No$'
>> ```
>
> You can also pkg_add sqlports, run "sqlite3 /usr/local/share/sqlports"
> amd run a query like
>
> select fullpkgpath,permit_package,permit_distfiles from ports where
> permit_package != 'Yes' or permit_distfiles != 'Yes';
>
> The various values aren't a problem though. The values are lower-cased
> before being compared with 'yes'. Anything else is "don't package" or
> "don't distribute distfiles". Normally the reason would be given instead
> of just 'No' but it doesn't matter too much.
>

No comments:

Post a Comment