GNU bug report logs -
#34195
[PATCH] linux-modules: Add module-soft-dependencies.
Previous Next
Full log
Message #11 received at 34195 <at> debbugs.gnu.org (full text, mbox):
Hi Danny,
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:
> * gnu/build/linux-modules.scm (not-softdep-whitespace): New variable.
> (module-soft-dependencies): New procedure.
That was fast! :-)
[...]
> +(define (module-soft-dependencies file)
> + "Return a list of (cons mode soft-dependency) of module FILE."
> + ;; TEXT: "pre: baz blubb foo post: bax bar"
> + (define (parse-softdep text)
> + (let loop ((value '())
> + (tokens (string-tokenize text not-softdep-whitespace))
> + (section #f))
> + (match tokens
> + ((token _ ...)
> + (if (string=? (string-take-right token 1) ":") ; section
> + (loop value
> + (cdr tokens)
> + (string-trim-both token))
You can use the pattern (token rest ...) and then:
(loop value rest (string-trim-both token))
instead of the not-so-nice ‘cdr’. :-)
> + (let ((info (modinfo-section-contents file)))
> + (apply append
> + (filter-map (match-lambda
> + (('softdep . value)
> + (parse-softdep value))
> + (_ #f))
> + (modinfo-section-contents file)))))
Replace ‘apply append’ with ‘concatenate’.
OK with these changes, thank you!
Ludo’.
This bug report was last modified 6 years and 120 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.