pkgsrc/bootstrap/mkbootstrapkit
jlam 14acff2d68 Add a script to make a source bootstrap kit. By default, the "kitdir"
is ${TMPDIR}/bootstrap-kit-<today>, the resulting archive will extract
a directory tree rooted in "bootstrap-kit-<today>".
2004-08-15 20:06:39 +00:00

41 lines
929 B
Bash
Executable file

#! /bin/sh
#
# $NetBSD: mkbootstrapkit,v 1.1 2004/08/15 20:06:39 jlam Exp $
#
# Usage: mkbootstrapkit [kitdir]
#
# Make a source bootstrap kit. By default, the "kitdir" is
# ${TMPDIR}/bootstrap-kit-<today>, the resulting archive will extract
# a directory tree rooted in "bootstrap-kit-<today>".
date=`date +%Y%m%d`
kitdir=${1:-${TMPDIR:=/tmp}/bootstrap-kit-${date}}
kitfile=${1:-${TMPDIR:=/tmp}/bootstrap-kit-${date}.tgz}
bootstrapdir=`pwd`
pkgsrcdir=`dirname $bootstrapdir`
echo "Creating $kitdir."
rm -rf $kitdir
mkdir -p $kitdir
cd $pkgsrcdir
for dir in \
archivers/pax \
bootstrap \
net/tnftp \
pkgtools/digest \
pkgtools/libnbcompat \
pkgtools/mtree \
pkgtools/pkg_install \
textproc/nbsed
do
echo "Copying $dir."
tar hcf - $dir | ( cd $kitdir; tar xf - )
done
echo "Archiving to $kitfile."
rm -f $kitfile
cd `dirname $kitdir` && tar zcpf $kitfile `basename $kitdir`
echo "Removing $kitdir."
rm -rf $kitdir