diff options
Diffstat (limited to 'pbuilder-satisfydepends-funcs')
-rwxr-xr-x | pbuilder-satisfydepends-funcs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/pbuilder-satisfydepends-funcs b/pbuilder-satisfydepends-funcs index 6c8dc28..e028fa2 100755 --- a/pbuilder-satisfydepends-funcs +++ b/pbuilder-satisfydepends-funcs @@ -117,6 +117,37 @@ get_build_conflicts() { echo "$output" } +# filter out dependencies sent on input not for this arch; deps can have +# multiple lines; output is on a single line or "" if empty +filter_arch_deps() { + local arch="$1" + local INSTALLPKGMULTI + local INSTALLPKG + + # split on "," + sed 's/[[:space:]]*,[[:space:]]*/\n/g' | + while read INSTALLPKGMULTI; do + echo "$INSTALLPKGMULTI" | + # split on "|" + sed 's/[[:space:]]*|[[:space:]]*/\n/g' | + while read INSTALLPKG; do + if echo "$INSTALLPKG" | grep -q '\['; then + if checkbuilddep_archdeps "$INSTALLPKG" "$arch"; then + continue + fi + fi + # output the selected package + echo "$INSTALLPKG" + done | + # remove the arch list and add " | " between entries + sed 's/\[.*\]//; $,$! s/$/ |/' | + xargs --no-run-if-empty + done | + # add ", " between entries + sed '$,$! s/$/,/' | + xargs --no-run-if-empty +} + checkbuilddep_archdeps() { # returns FALSE on INSTALL local INSTALLPKG="$1" |