File:  [ELWIX - Embedded LightWeight unIX -] / elwix / config / rc.subr
Revision 1.1.1.1.2.1: download - view: text, annotated - select for diffs - revision graph
Thu Jul 21 08:32:21 2011 UTC (13 years, 3 months ago) by misho
Branches: elwix1_4
CVS tags: Patch1
Diff to: branchpoint 1.1.1.1: preferred, unified
finish function in romfs
and add new feature in rc.subr

#
# ELWIX project build helper subroutines
#
# (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
#    by Michael Pounov <misho@elwix.org>
#
# $Id: rc.subr,v 1.1.1.1.2.1 2011/07/21 08:32:21 misho Exp $
#

### Dont edit this file !!!

CheckVer()
{
	[ -z "$1" -o ! -r "$1" ] && return 1

	cat $1 | awk '($1 == "ELWIX") { split($3, arr, ":"); printf("%s", arr[2]); }'
	return 0
}

SnitVer()
{
	install -d ${TOPDIR}

	V=$(CheckVer $1)

	if [ $? -ne 0 ]; then
# file not found
		return 1
	elif [ X"$V" != X"${VERSION}" ]; then
# different ELWIX version
		return 2
	fi

# already present file with same version
	return 0
}

# $1 = ELWIX install list config
# $2 = From World dir
# $3 = To Dest dir
InstallList()
{
	sed -nE -e 's/^ *([^ #]+) */\1/p' < $1 | tr ':' '\n' | 
		tar -C $2 -cvf - -T - | tar -C $3 -x -f -
}

# $1 = From dir
# $2 = To dir
InstallDir()
{
	cd $1
	pax -rw -pe -X . $2
	cd -
}

# $* = Program arguments for install tool
InstallProg()
{
	install -c $*
}

# $1 = file_pattern
# $2 = To dir
# $3 = From dir
InstallFiles()
{
	cd $2
	find . -type f -name "$1" | 
		tar -cvf - -T - | tar -C $3 -xf -
	cd -
}

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