NetBSD/distrib/sets/makesrctars
lukem ce860f79b6 - change so that the source directory and sets directory are now
command-line arguments, rather than ${SRCDIR} and ${DESTDIR}/sets
- when building syssrc.tgz, only skip subdirs of sys/arch/*/compile
  which are not named "CVS"
- improve method that sets are built
- don't bother chmodding results as it makes it difficult to re-run this
2003-05-10 06:07:26 +00:00

68 lines
1.1 KiB
Bash
Executable File

#! /bin/sh
#
# $NetBSD: makesrctars,v 1.15 2003/05/10 06:07:26 lukem Exp $
#
# makesrctars srcdir setdir
# Create source tarballs in setdir from the source under srcdir.
#
: ${CKSUM=cksum}
GZIP=-9
export GZIP
if [ $# -ne 2 ]; then
echo "Usage: $0 srcdir setdir"
exit 1
fi
srcdir=$1
setdir=$2
if [ ! -d "${setdir}" ]; then
echo "${setdir} is not a directory"
exit 1
fi
if ! cd "${srcdir}"; then
echo "Can't chdir to ${srcdir}"
exit 1
fi
makeset()
{
set=$1.tgz
shift
echo "Creating ${set}"
set -f
find -s $* \
! \( \( -name obj -o -name 'obj.*' \) \( -type l -o -type d \) \) \
-print \
| pax -w -d -s'|^\.|usr/src|' \
| gzip \
> "${setdir}/${set}"
set +f
}
makeset src . \
! \( \( -path ./gnu -o -path ./share \) -prune \) \
! \( -path ./sys -prune \) \
! \( -path ./usr.sbin/config -prune \)
makeset gnusrc ./gnu
makeset syssrc ./sys ./usr.sbin/config \
! \( -path ./sys/arch/\*/compile/\* -type d \
! -name CVS -prune \)
makeset sharesrc ./share
(cd ${setdir}
${CKSUM} -o1 *.tgz > BSDSUM
${CKSUM} *.tgz > CKSUM
${CKSUM} -m *.tgz > MD5
${CKSUM} -o2 *.tgz > SYSVSUM
)