Cache build info. Makes regpkgset more tolerable on my slow 500MHz

AMD K6-2 workstation with its slow IDE disks.
This commit is contained in:
dyoung 2004-01-16 10:05:10 +00:00
parent 58987a0a55
commit 624b44bb1b
2 changed files with 34 additions and 9 deletions

View File

@ -1,6 +1,6 @@
#! /bin/sh
#
# $NetBSD: regpkg,v 1.4 2003/06/23 09:25:34 dyoung Exp $
# $NetBSD: regpkg,v 1.5 2004/01/16 10:05:10 dyoung Exp $
#
# Copyright (c) 2003 Alistair G. Crooks. All rights reserved.
#
@ -170,18 +170,22 @@ echo "$descr" > ${SYSPKGDIR}/+DESC
printf "\nHomepage:\nhttp://www.NetBSD.org/\n" >> ${SYSPKGDIR}/+DESC
# create the build information
{
echo "OPSYS=`uname -s`"
echo "OS_VERSION=`uname -r`"
make -f- all <<EOF
if [ x${BUILD_INFO_CACHE} = x ]; then
{
echo "OPSYS=`uname -s`"
echo "OS_VERSION=`uname -r`"
make -f- all <<EOF
.include <bsd.own.mk>
all:
@echo OBJECT_FMT=${OBJECT_FMT}
@echo MACHINE_ARCH=${MACHINE_ARCH}
@echo MACHINE_GNU_ARCH=${MACHINE_GNU_ARCH}
EOF
echo "_PKGTOOLS_VER=`pkg_create -V`"
} > ${SYSPKGDIR}/+BUILD_INFO
echo "_PKGTOOLS_VER=`pkg_create -V`"
} > ${SYSPKGDIR}/+BUILD_INFO
else
cp ${BUILD_INFO_CACHE} ${SYSPKGDIR}/+BUILD_INFO
fi
# test for attributes
args=""
@ -199,7 +203,7 @@ pkg_create -v -c ${SYSPKGDIR}/+COMMENT \
-d ${SYSPKGDIR}/+DESC \
$args \
-f $PLIST -l -b /dev/null -B ${SYSPKGDIR}/+BUILD_INFO \
-s /dev/null -S /dev/null -O $pkg-$t \
-s /dev/null -S /dev/null -O $pkg-$t.tgz \
> ${SYSPKGDIR}/+CONTENTS
rm $PLIST

View File

@ -1,6 +1,6 @@
#! /bin/sh
#
# $NetBSD: regpkgset,v 1.1 2003/06/12 20:04:00 agc Exp $
# $NetBSD: regpkgset,v 1.2 2004/01/16 10:05:10 dyoung Exp $
#
# Copyright (c) 2003 Alistair G. Crooks. All rights reserved.
#
@ -36,10 +36,12 @@
# Usage: regpkgset set
verbose=""
cache=""
while [ $# -gt 1 ]; do
case $1 in
-v) verbose=$1 ;;
-c) cache=$1 ;;
*) break ;;
esac
shift
@ -55,10 +57,29 @@ all) list="base comp etc games man misc text" ;;
*) list=$@ ;;
esac
if [ x${cache} != x ]; then
BUILD_INFO_CACHE=$(mktemp /var/tmp/$(basename $0)-BUILD_INFO.XXXXXX)
export BUILD_INFO_CACHE
{
echo "OPSYS=`uname -s`"
echo "OS_VERSION=`uname -r`"
make -f- all <<EOF
.include <bsd.own.mk>
all:
@echo OBJECT_FMT=${OBJECT_FMT}
@echo MACHINE_ARCH=${MACHINE_ARCH}
@echo MACHINE_GNU_ARCH=${MACHINE_GNU_ARCH}
EOF
echo "_PKGTOOLS_VER=`pkg_create -V`"
} > ${BUILD_INFO_CACHE}
fi
for pkgset in $list; do
for pkg in `./listpkgs $pkgset`; do
./regpkg $verbose $pkgset $pkg
done
done
[ x${BUILD_INFO_CACHE} != x ] && rm -f ${BUILD_INFO_CACHE}
exit 0