Add 'nice' os tagging to PSTAMP

Default permissions weren't being used when generating prototype files
Keep track of packages and make each one gets the proper pkginfo file added
to the prototype file.
pkgdef entries should now be relative to $topinstalldir.
This commit is contained in:
Tom G. Christensen 2005-12-19 08:58:56 +00:00
parent 8de6f05906
commit 82dcedd482

View File

@ -31,7 +31,18 @@ pkgvendor="http://change/me/please"
pkgdesc="mumble mubmle... hmm someone forgot to fill this out!" pkgdesc="mumble mubmle... hmm someone forgot to fill this out!"
cpu=sparcv9 cpu=sparcv9
os=sol`$UNAME -r` os=`$UNAME -r`
# Courtesy of nba (see dm2conv/solaris/mkpkg.sh)
case $os in
5.[0123456]|5.5.1)
os=sol`echo $os | sed s/5./2./`
;;
5.*)
os=sol`echo $os | sed s/5.//`
;;
*)
echo I do not know how; exit 1;;
esac
# Default pkginfo.in file # Default pkginfo.in file
pkginfo=$buildpkgbase/scripts/pkginfo.in pkginfo=$buildpkgbase/scripts/pkginfo.in
@ -212,6 +223,8 @@ add_proto()
if [ "$defperm" == "-" ]; then if [ "$defperm" == "-" ]; then
permlist=$($LS -l "$i" | $CUT -d " " -f 1) permlist=$($LS -l "$i" | $CUT -d " " -f 1)
perm=$(compute_octal $permlist) perm=$(compute_octal $permlist)
else
perm=$defperm
fi fi
echo "f none $i $perm $owner $group" >> $metadir/prototype.$secname echo "f none $i $perm $owner $group" >> $metadir/prototype.$secname
done done
@ -244,6 +257,8 @@ add_proto()
if [ "$defperm" == "-" ]; then if [ "$defperm" == "-" ]; then
permlist=$($LS -ld "$i" | $CUT -d " " -f 1) permlist=$($LS -ld "$i" | $CUT -d " " -f 1)
perm=$(compute_octal $permlist) perm=$(compute_octal $permlist)
else
perm=$defperm
fi fi
echo "d none $i $perm $owner $group" >> $metadir/prototype.$secname echo "d none $i $perm $owner $group" >> $metadir/prototype.$secname
done done
@ -267,6 +282,8 @@ add_dir()
if [ "$defperm" == "-" ]; then if [ "$defperm" == "-" ]; then
permlist=$($LS -ld "$dir" | $CUT -d " " -f 1) permlist=$($LS -ld "$dir" | $CUT -d " " -f 1)
perm=$(compute_octal $permlist) perm=$(compute_octal $permlist)
else
perm=$defperm
fi fi
echo "d none $dir $perm $owner $group" >> $metadir/prototype.$secname echo "d none $dir $perm $owner $group" >> $metadir/prototype.$secname
echo "$dir" >> $metadir/files.tmp echo "$dir" >> $metadir/files.tmp
@ -285,6 +302,7 @@ parse_def()
local secname="" local secname=""
local secpos=0 local secpos=0
local legalend=0 local legalend=0
local hasaddedpkginfo=0
while read line while read line
do do
@ -306,6 +324,7 @@ parse_def()
section=0 # Finished this section section=0 # Finished this section
foundfiles=0 # foundfiles=0 #
legalend=1 # We encountered a syntacticly correct section end legalend=1 # We encountered a syntacticly correct section end
hasaddedpkginfo=0
# Add scripts if requested # Add scripts if requested
add_scripts $secname add_scripts $secname
fi fi
@ -340,9 +359,13 @@ parse_def()
defaultuid=$(echo $triplet | $AWK -F, '{ print $2 }') defaultuid=$(echo $triplet | $AWK -F, '{ print $2 }')
defaultgid=$(echo $triplet | $AWK -F, '{ print $3 }') defaultgid=$(echo $triplet | $AWK -F, '{ print $3 }')
foundfiles=1 foundfiles=1
if [ $hasaddedpkginfo -eq 0 ]; then
# start a new package
pack_info $secname # Create pkginfo pack_info $secname # Create pkginfo
# Start the prototype file by adding the pkginfo file # Start the prototype file by adding the pkginfo file
add_meta_file pkginfo "$metadir/pkginfo.$secname" $secname add_meta_file pkginfo "$metadir/pkginfo.$secname" $secname
hasaddedpkginfo=1
fi
else else
if [ $foundfiles -eq 1 ]; then # We already found the 'files' line so this must be the filelist if [ $foundfiles -eq 1 ]; then # We already found the 'files' line so this must be the filelist
if [ "${line:0:4}" == "dir " ]; then if [ "${line:0:4}" == "dir " ]; then
@ -485,7 +508,9 @@ generic_pack()
setdir ${stagedir}${topinstalldir}${dir_prefix}/${_infodir} setdir ${stagedir}${topinstalldir}${dir_prefix}/${_infodir}
[ "$gzinfo" -eq 1 ] && compress_info [ "$gzinfo" -eq 1 ] && compress_info
fi fi
setdir "${stagedir}${prefix}" #setdir "${stagedir}${prefix}"
# pkgdef should list files relative to topinstalldir
setdir "${stagedir}${topinstalldir}"
parse_def parse_def
check_unpackaged check_unpackaged
# Create a list of all the packages that we are going to build # Create a list of all the packages that we are going to build