1996-02-13 00:58:46 +03:00
|
|
|
#! /bin/sh
|
1997-02-18 10:06:00 +03:00
|
|
|
#
|
2003-05-10 10:07:26 +04:00
|
|
|
# $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.
|
1997-02-18 10:06:00 +03:00
|
|
|
#
|
1996-02-13 00:58:46 +03:00
|
|
|
|
2002-04-11 10:04:42 +04:00
|
|
|
: ${CKSUM=cksum}
|
|
|
|
|
2002-04-12 11:08:37 +04:00
|
|
|
GZIP=-9
|
1996-02-13 00:58:46 +03:00
|
|
|
export GZIP
|
|
|
|
|
2003-05-10 10:07:26 +04:00
|
|
|
if [ $# -ne 2 ]; then
|
|
|
|
echo "Usage: $0 srcdir setdir"
|
1996-02-13 00:58:46 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
2003-05-10 10:07:26 +04:00
|
|
|
srcdir=$1
|
|
|
|
setdir=$2
|
1996-02-13 00:58:46 +03:00
|
|
|
|
2003-05-10 10:07:26 +04:00
|
|
|
if [ ! -d "${setdir}" ]; then
|
|
|
|
echo "${setdir} is not a directory"
|
1996-02-13 00:58:46 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2003-05-10 10:07:26 +04:00
|
|
|
if ! cd "${srcdir}"; then
|
|
|
|
echo "Can't chdir to ${srcdir}"
|
|
|
|
exit 1
|
1996-02-13 00:58:46 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2003-05-10 10:07:26 +04:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
1996-02-13 00:58:46 +03:00
|
|
|
|
2003-05-10 10:07:26 +04:00
|
|
|
makeset src . \
|
|
|
|
! \( \( -path ./gnu -o -path ./share \) -prune \) \
|
|
|
|
! \( -path ./sys -prune \) \
|
|
|
|
! \( -path ./usr.sbin/config -prune \)
|
1997-12-30 02:31:06 +03:00
|
|
|
|
2003-05-10 10:07:26 +04:00
|
|
|
makeset gnusrc ./gnu
|
1996-02-13 00:58:46 +03:00
|
|
|
|
2003-05-10 10:07:26 +04:00
|
|
|
makeset syssrc ./sys ./usr.sbin/config \
|
|
|
|
! \( -path ./sys/arch/\*/compile/\* -type d \
|
|
|
|
! -name CVS -prune \)
|
1996-02-13 00:58:46 +03:00
|
|
|
|
2003-05-10 10:07:26 +04:00
|
|
|
makeset sharesrc ./share
|
1996-02-13 00:58:46 +03:00
|
|
|
|
1997-12-30 02:31:06 +03:00
|
|
|
|
2003-05-10 10:07:26 +04:00
|
|
|
(cd ${setdir}
|
2002-04-11 10:04:42 +04:00
|
|
|
${CKSUM} -o1 *.tgz > BSDSUM
|
|
|
|
${CKSUM} *.tgz > CKSUM
|
|
|
|
${CKSUM} -m *.tgz > MD5
|
|
|
|
${CKSUM} -o2 *.tgz > SYSVSUM
|
|
|
|
)
|