fixed pkg_dir bug
[hdw-linux/hdw-linux.git] / scripts / Helper
1 #!/bin/sh
2 #
3 # hdw - linux ./scripts/Helper script
4 #
5 # author: hackbard@hackdaworld.dyndns.org
6 #
7
8 # reading Config file
9 . ./Config
10 . ./scripts/subroutines
11
12 # soon there will be some usefull options available:
13 # - create new priorities according to dependencies
14
15 ccl=0
16 cdf=0
17
18 while [ "$1" ] ; do
19         case "$1" in
20                 -create_cvs_list)       ccl=1;  shift 1 ;;
21                 -create_dist_files)     cdf=1;  shift 1 ;;
22                 *)
23                         echo
24                         echo "usage:"
25                         echo
26                         echo "$0 -create_cvs_list"
27                         echo "$0 -create_dist_files"
28                         echo
29                         exit 1 ;;
30         esac
31 done
32
33
34 if [ "$ccl" = "1" ] ; then
35         for i in download/*/PKGS; do
36                 grep 'cvs:' $i | \
37                         while read pkg package foo; do
38                                 cat=`echo $i | awk -F/ '{ print $2 }'`
39                                 echo "download/$cat/$pkg/$package"
40                         done
41         done
42 fi
43
44 if [ "$cdf" = "1" ] ; then
45         max=`grep '^max=' ./scripts/Build-Distro | awk -F= '{ print $2 }'`
46         mkdir -p ./distro
47         . ./Config
48         echo -en "creating dist file ./distro/$hdw_target ..."
49         . ./scripts/subroutines
50         echo "00-dirtree" > ./distro/$hdw_target
51         create_buildorder '2 3 4' $max > ./distro/$hdw_target.~
52         grep -v '^#' ./distro/$hdw_target.~ | awk '{ print $4 }' >> \
53                 ./distro/$hdw_target
54         rm ./distro/$hdw_target.~
55         echo -en " done\n"
56 fi
57