]> www.hackdaworld.org Git - hdw-linux/hdw-linux.git/blob - scripts/Build-Package
added this forgotten script!
[hdw-linux/hdw-linux.git] / scripts / Build-Package
1 #! /bin/bash
2 #
3 # author: hackbard@hackdaworld.dyndns.org
4 #
5 # this script is used to build hdw-linux packages on a running system. 
6 #
7
8 package=""
9 stage="3"
10 bappend=""
11 priority="x"
12 dir=""
13
14 if [ -z "$1" ] ; then
15         echo "usage: $0 <package> [-stage <stagelevel 3|4>]"
16         exit 1
17 fi
18
19 while [ "$1" ] ; do
20         case "$1" in
21                 -no_src_del)    bappend="-no_src_del" ; shift 1 ;;
22                 -stage) stage=$2 ; shift 2 ;;
23                 -priority)      priority=$2 ; shift 2 ;;
24                 -dir)           dir=$2  ; shift 2 ;;
25                 *)      package="$package $1" ; shift ;;
26         esac
27 done
28
29 [ -n "$dir" ] && bappend="-dir $dir $bappend"
30
31 for s_package in $package; do
32         echo "building package $package ..."
33         echo "log -> /var/adm/logs/$stage-$priority-$s_package(.out)"
34         . ./scripts/Build -package $s_package -priority $priority \
35                 -stage $stage $bappend > \
36         /var/adm/logs/$stage-$priority-$s_package.out 2>&1
37         returncode=$?
38         if [ "$returncode" = "0" ] ; then
39                 mv /var/adm/logs/$stage-$priority-$s_package.out \
40                 /var/adm/logs/$stage-$priority-$s_package
41                 echo "done building package $s_package"
42                 echo
43         else
44                 echo -n "build failed -> "
45                 echo "/var/adm/logs/$stage-$priority-$s_package.out"
46         fi
47 done
48