1
; Copyright (c) Gergely Nagy <algernon@debian.org>, 2012, under the
2
; terms of dput-ng itself.
10
"Prune a string representation of the build-depends so that only a
11
list of packages remain."
14
(map #(first (-> % (.strip) (.split " "))) (.. bd-string (split ","))))
16
(defn has-blacklisted?
17
"Given a dsc file and a blacklist, check if any of the
18
build-depencencies are in that list. Throws an error if there are
23
(let [dsc (dput.dsc/parse_dsc_file dsc-file)
24
build-deps (prune-build-deps (.. dsc (get "build-depends")))]
25
(if-let [bad-bd (some blacklist build-deps)]
26
(throw (dput.exceptions/HookException. (str "Blacklisted build-dependency found: " bad-bd)))
27
(-> dput.core/logger (.trace "Build-Dependencies do not have anything on the blacklist")))))
29
(defn blacklist-checker
30
"Checks whether the dsc has blacklisted build-dependencies, ignores
31
the check when no dsc is to be found."
33
[changes profile interface]
35
(if-let [dsc-file (.. changes (get_dsc))]
36
(has-blacklisted? dsc-file (set (get profile "bd-blacklist")))
37
(-> dput.core/logger (.trace "No .dsc found, build-dependencies cannot be checked"))))