[package] firewall:
[openwrt.git] / scripts / deptest.sh
1 DIR="$PWD/tmp/deptest"
2 STAMP_DIR="$DIR/stamp"
3 BUILD_DIR="$DIR/build"
4 BUILD_DIR_HOST="$DIR/build_host"
5 STAGING_DIR="$DIR/staging"
6 STAGING_DIR_HOST="$DIR/staging_host"
7 STAGING_DIR_HOST_TMPL="$DIR/staging_host_tmpl"
8 LOG_DIR="$DIR/logs"
9
10 mkdir -p "$STAMP_DIR" "$BUILD_DIR" "$LOG_DIR"
11
12 [ -d "$STAGING_DIR_HOST_TMPL" ] || {
13 rm -rf staging_dir/host
14 make tools/install || {
15 echo "make tools/install failed, please check"
16 exit 1
17 }
18 cp -al staging_dir/host "$STAGING_DIR_HOST_TMPL"
19 }
20
21 for pkg in `cat tmp/.packagedeps | grep CONFIG_PACKAGE | grep -v curdir | sed -e 's,.*[/=]\s*,,' | sort -u`; do
22 SELECTED=
23 for conf in `grep CONFIG_PACKAGE tmp/.packagedeps | grep -E "[ /]$pkg\$" | sed -e 's,package-$(\(CONFIG_PACKAGE_.*\)).*,\1,'`; do
24 grep "$conf=" .config > /dev/null && SELECTED=1
25 done
26 [ -f "$STAMP_DIR/$pkg-done" ] && continue
27 [ -n "$SELECTED" ] || {
28 echo "Package $pkg is not selected"
29 continue
30 }
31 echo "Testing package $pkg..."
32 rm -rf "$STAGING_DIR"
33 mkdir -p "$STAGING_DIR"
34 rm -rf "$STAGING_DIR_HOST"
35 cp -al "$STAGING_DIR_HOST_TMPL" "$STAGING_DIR_HOST"
36 make package/$pkg/compile \
37 BUILD_DIR="$BUILD_DIR" \
38 BUILD_DIR_HOST="$BUILD_DIR_HOST" \
39 STAGING_DIR="$STAGING_DIR" \
40 STAGING_DIR_HOST="$STAGING_DIR_HOST" \
41 V=99 >"$LOG_DIR/$(basename $pkg).log" 2>&1 \
42 && touch "$STAMP_DIR/$pkg-done" || {
43 echo "Building package $pkg failed!"
44 }
45 done
This page took 0.057099 seconds and 5 git commands to generate.