File: build_deps_list

package info (click to toggle)
python-irodsclient 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,352 kB
  • sloc: python: 16,650; xml: 525; sh: 104; awk: 5; sql: 3; makefile: 3
file content (22 lines) | stat: -rwxr-xr-x 497 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

build_deps_list()
{
    local -A pkglist
    local pkg
    while [ $# -gt 0 ]
    do
        while read f
        do
            if [[ ! $f =~ \(.*\)\s*$ ]]; then  # todo: include version-specific ?
               pkglist["$f"]=""
            fi
        done < <(dpkg -I "$1"|grep -i '^ *depends:'|tr ',:' \\n | tail -n +2)
        shift
    done
    for pkg in "${!pkglist[@]}"  # package list de-duped by associative array
    do
        echo "$pkg"
    done
}
build_deps_list "$@"