Match more liberally in Package-Requires lists

This commit is contained in:
Steve Purcell 2020-06-20 15:50:07 +12:00
parent 8439afbe1e
commit 1b7520aab8

View file

@ -12,11 +12,11 @@ let
requires = requires =
lib.concatMapStrings lib.concatMapStrings
(line: (line:
let match = builtins.match "^;;;* *[pP]ackage-[rR]equires *: *\\((.*)\\)" line; let match = builtins.match ";;;* *[pP]ackage-[rR]equires *: *\\((.*)\\) *" line;
in if match == null then "" else builtins.head match) in if match == null then "" else builtins.head match)
lines; lines;
parseReqList = s: parseReqList = s:
let matchAndRest = builtins.match " *\\(? *([^ \"\\)]+)( +\"[^\"]+\" *\\))?(.*)" s; let matchAndRest = builtins.match " *\\(? *([^ \"\\)]+)( +\"[^\"]+\" *\\)| *\\))?(.*)" s;
in in
if isStrEmpty s then if isStrEmpty s then
[ ] [ ]