summaryrefslogtreecommitdiff
path: root/bootstrap/mkbootstrapkit
blob: 3ed381ba2ae78dc8986d50668937a518ac50c4fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/sh
#
# $NetBSD: mkbootstrapkit,v 1.7 2006/07/17 14:30:05 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 \
	devel/bmake \
	lang/nawk \
	mk \
	net/tnftp \
	pkgtools/bootstrap-extras \
	pkgtools/bootstrap-mk-files \
	pkgtools/digest \
	pkgtools/libnbcompat \
	pkgtools/mtree \
	pkgtools/pax \
	pkgtools/pkg_install \
	pkgtools/pkgmanpages \
	pkgtools/tnftp \
	sysutils/install-sh \
	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