Annotation of elwix/config/rc.subr, revision 1.1.1.1

1.1       misho       1: #
                      2: # ELWIX project build helper subroutines
                      3: #
                      4: # (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
                      5: #    by Michael Pounov <misho@elwix.org>
                      6: #
                      7: # $Id:$
                      8: #
                      9: 
                     10: ### Dont edit this file !!!
                     11: 
                     12: CheckVer()
                     13: {
                     14:        [ -z "$1" -o ! -r "$1" ] && return 1
                     15: 
                     16:        cat $1 | awk '($1 == "ELWIX") { split($3, arr, ":"); printf("%s", arr[2]); }'
                     17:        return 0
                     18: }
                     19: 
                     20: SnitVer()
                     21: {
                     22:        install -d ${TOPDIR}
                     23: 
                     24:        V=$(CheckVer $1)
                     25: 
                     26:        if [ $? -ne 0 ]; then
                     27: # file not found
                     28:                return 1
                     29:        elif [ X"$V" != X"${VERSION}" ]; then
                     30: # different ELWIX version
                     31:                return 2
                     32:        fi
                     33: 
                     34: # already present file with same version
                     35:        return 0
                     36: }
                     37: 
                     38: # $1 = ELWIX install list config
                     39: # $2 = From World dir
                     40: # $3 = To Dest dir
                     41: InstallList()
                     42: {
                     43:        sed -nE -e 's/^ *([^ #]+) */\1/p' < $1 | tr ':' '\n' | 
                     44:                tar -C $2 -cvf - -T - | tar -C $3 -x -f -
                     45: }
                     46: 
                     47: # $1 = From dir
                     48: # $2 = To dir
                     49: InstallFiles()
                     50: {
                     51:        cd $1
                     52:        pax -rw -pe -X . $2
                     53:        cd -
                     54: }
                     55: 
                     56: # $* = Program arguments for install tool
                     57: InstallProg()
                     58: {
                     59:        install -c $*
                     60: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>