Tuesday, September 15, 2026

Improve Makefile parsing in portgen(1)

If you have a "fancy" Makefile in a port, after portgen updates we completely lose the first line and suddenly the two DBICTEST variables are for make not MAKE_ENV: -MAKE_ENV += DBICTEST_MYSQL_DSN='dbi:mysql:database=${DATABASE};mysql_socket=${MODMARIADB_TEST_SOCKET}' \ - DBICTEST_MYSQL_USER=root \ +DBICTEST_MYSQL_USER= root \ DBICTEST_MYSQL_PASS=1 Lets match all the possible assignments instead so my DBIx::Class updates are easier. Comments, OK? Index: infrastructure/lib/OpenBSD/PortGen/Port.pm =================================================================== RCS file: /cvs/ports/infrastructure/lib/OpenBSD/PortGen/Port.pm,v diff -u -p -r1.25 Port.pm --- infrastructure/lib/OpenBSD/PortGen/Port.pm 18 Jun 2022 19:32:19 -0000 1.25 +++ infrastructure/lib/OpenBSD/PortGen/Port.pm 16 Sep 2026 01:47:33 -0000 @@ -313,7 +317,7 @@ sub parse_makefile if ( $line =~ /^ (?<comment> \#? ) \s* (?<key> (?<name>[\p{Upper}_]+) (?<package>-\w+)? ) - (?<equal> \s* \?? = ) + (?<equal> \s* (?:\?|\+|!!?|:)? = ) (?<spaces> \s* ) (?<value> .* ) /xms ) {

No comments:

Post a Comment