Last change
on this file since 105afb5 was
c5c522c,
checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago
|
initial commit, transferred from cleaned syn3 svn tree
|
-
Property mode set to
100755
|
File size:
1.5 KB
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | if ! [ "$1" ]; then |
---|
4 | echo "$0 packagename of buildscript path" |
---|
5 | echo "Bepaald recursief alle build dependencies van de meegeven pacakage. Dus alle NEEDs en DEPs" |
---|
6 | exit 1 |
---|
7 | fi |
---|
8 | |
---|
9 | cd `dirname $0` || exit 1 |
---|
10 | |
---|
11 | export BUILDDEPS="" |
---|
12 | |
---|
13 | getdeps() |
---|
14 | { |
---|
15 | if ! [ -f $1 ]; then |
---|
16 | BUILDSCRIPT=`./findbuild $1`.SlackBuild || exit 1 |
---|
17 | else |
---|
18 | BUILDSCRIPT=$1 |
---|
19 | fi |
---|
20 | |
---|
21 | DEPS="`cat "$BUILDSCRIPT"|egrep '^#DEP:'|cut -f2 -d':'`" || exit 1 |
---|
22 | for DEP in $DEPS; do |
---|
23 | if ! echo "$BUILDDEPS" | grep " $DEP " >/dev/null; then |
---|
24 | BUILDDEPS="$BUILDDEPS $DEP " |
---|
25 | #recurse |
---|
26 | getdeps $DEP || exit 1 |
---|
27 | fi |
---|
28 | done |
---|
29 | } |
---|
30 | |
---|
31 | |
---|
32 | if ! [ -f $1 ]; then |
---|
33 | BUILDSCRIPT=`./findbuild $1`.SlackBuild || exit 1 |
---|
34 | else |
---|
35 | BUILDSCRIPT=$1 |
---|
36 | fi |
---|
37 | |
---|
38 | #toplevel needs |
---|
39 | BUILDDEPS="$BUILDDEPS `cat "$BUILDSCRIPT"|egrep '^#NEED:'|cut -f2 -d':'| tr '\n' ' '`" || exit 1 |
---|
40 | |
---|
41 | #toplevel deps |
---|
42 | BUILDDEPS="$BUILDDEPS `cat "$BUILDSCRIPT"|egrep '^#DEP:'|cut -f2 -d':'| tr '\n' ' '`" || exit 1 |
---|
43 | |
---|
44 | #toplevel deps_dev, if they exists |
---|
45 | DEVS="`cat "$BUILDSCRIPT"|egrep '^#DEP:'|cut -f2 -d':'| sed 's/$/_dev/g'| tr '\n' ' '`" || exit 1 |
---|
46 | for DEV in $DEVS; do |
---|
47 | if ./findbuild $DEV 2>/dev/null >/dev/null ; then |
---|
48 | BUILDDEPS="$BUILDDEPS $DEV" || exit 1 |
---|
49 | fi |
---|
50 | done |
---|
51 | |
---|
52 | #determine sub-deps recursively, because those usually are runtime dependencies as well |
---|
53 | DEPS="`cat "$BUILDSCRIPT"|egrep '(^#DEP:|^#NEED)'|cut -f2 -d':'`" || exit 1 |
---|
54 | for DEP in $DEPS; do |
---|
55 | getdeps $DEP || exit 1 |
---|
56 | done |
---|
57 | |
---|
58 | #output |
---|
59 | for DEP in $BUILDDEPS; do |
---|
60 | echo $DEP |
---|
61 | done |
---|
Note: See
TracBrowser
for help on using the repository browser.