Clean up index generation:

* Don't assume the script will be called from the ports directory

* Use buildenv to set environment variables

* Set LOCALBASE and X11BASE to dummy variables to prevent the ports tree
  from picking up packages installed on the host system, and patch up
  the generated index at the end
This commit is contained in:
Kris Kennaway 2002-03-11 11:54:40 +00:00
parent 530ba84e62
commit 5826701f06
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=55859

View file

@ -1,60 +1,57 @@
#!/bin/sh
# usage: $0 branch
#### -j# to make index
###INDEXJOBS=1
# -j# to make index
# XXX corrupts index file because of lack of synchronization?
#INDEXJOBS=1
pb=/var/portbuild
. ${pb}/portbuild.conf
. ${pb}/scripts/buildenv
usage () {
echo "usage: makeindex branch"
exit 1
}
if [ $# != 1 ]; then
usage
fi
case "x$1" in
x4)
branch=4
export PORTOBJFORMAT=elf
export OSREL=4.5
export OSVERSION=450000
;;
x4-exp)
branch=4-exp
export PORTOBJFORMAT=elf
export OSREL=4.5
export OSVERSION=450000
;;
x5)
branch=5
export PORTOBJFORMAT=elf
export OSREL=5.0
export OSVERSION=500027
;;
*)
usage
;;
esac
export PORTSDIR=$(pwd)
# Set up the build env variables
buildenv $branch
if [ "x$NODUMMY" = "x" ]; then
unset XFREE86_VERSION
unset MOTIF_OPEN
else
export XFREE86_VERSION=4
export MOTIF_OPEN=t
fi
#if [ "x$NODUMMY" = "x" ]; then
# unset XFREE86_VERSION
# unset MOTIF_OPEN
#fi
unset DISPLAY
export BATCH=t
export HAVE_MOTIF=t
export PACKAGE_BUILDING=t
export PARALLEL_PACKAGE_BUILD=t
export SRCBASE=/var/portbuild/${branch}/src
#export NO_RESTRICTED=t
#export FOR_CDROM=t
#export INDEX_NOSORT=t
# Don't pick up installed packages from the host
export LOCALBASE=/nonexistentlocal
export X11BASE=/nonexistentx
cd ${PORTSDIR}
make index
# remove extra spaces in dependency list -- this could cause problems
sed -e 's/ */ /g' -e 's/| */|/g' -e 's/ *|/|/g' INDEX > INDEX.tmp
# remove extra spaces in dependency list -- this causes problems
# Also transform the dummy paths to their canonical locations
sed -e 's/ */ /g' -e 's/| */|/g' -e 's/ *|/|/g' -e "s,${LOCALBASE},/usr/local," -e "s,${X11BASE},/usr/X11R6," INDEX > INDEX.tmp
mv -f INDEX.tmp INDEX