buildpkg.packaging.solaris: fixup add_file()

This commit is contained in:
Tom G. Christensen 2013-01-27 13:50:04 +01:00
parent a8454b7c03
commit d7d89b9209

View File

@ -212,28 +212,24 @@ add_scripts()
} }
# add_file(): add a file entry to the prototype file # add_file(): add a file entry to the prototype file
# params: $1 = owner $2 = group $3 = permissions $4 = filename # params: $1 = owner $2 = group $3 = permissions $4 = filename $5 = metafile suffix
# Additions will be done to the file $metadir/prototype # Additions will be done to the file $metadir/prototype
# $4 must be relative to $stagedir$prefix (or just $stagedir if using shortroot) # $4 must be relative to $stagedir$prefix (or just $stagedir if using shortroot)
# We will not check for the existence of $4
add_file() add_file()
{ {
local arg1=${1-'x'} if [ $# -lt 5 ]; then
if [ "$arg1" == "x" ]; then error $E_MISSING_ARGS add_file
error $E_MISSING_ARGS add_meta
fi fi
local arg2=${2-'x'} local owner=$1
if [ "$arg2" == "x" ]; then local group=$2
error $E_MISSING_ARGS add_meta local perms=$3
fi local file=$4
local arg3=${3-'x'} local secname=$5
if [ "$arg2" == "x" ]; then
error $E_MISSING_ARGS add_meta if [ -r "$file" ]; then
fi echo "f none $file $perms $owner $group" >> $metadir/prototype.$secname
if [ -r "$arg4" ]; then
echo "f none $arg4 $3 $1 $2" >> $metadir/prototype
else else
error $E_BAD_FILE add_meta_file error $E_BAD_FILE add_file
fi fi
} }