Initial import from FreeBSD RELENG_4:
[dragonfly.git] / release / scripts / src-install.sh
1 #!/bin/sh
2 #
3 # $FreeBSD: src/release/scripts/src-install.sh,v 1.6.6.2 2002/08/08 08:23:53 ru Exp $
4 #
5
6 if [ "`id -u`" != "0" ]; then
7         echo "Sorry, this must be done as root."
8         exit 1
9 fi
10 if [ $# -lt 1 ]; then
11         echo "You must specify which components of src to extract"
12         echo "possible subcomponents are:"
13         echo
14         echo "base bin contrib etc games gnu include lib libexec"
15         echo "release sbin share sys tools ubin usbin"
16         echo
17         echo "You may also specify all to extract all subcomponents."
18         exit 1
19 fi
20
21 if [ "$1" = "all" ]; then
22         dists="base bin contrib etc games gnu include lib libexec release sbin share sys tools ubin usbin"
23 else
24         dists="$*"
25 fi
26
27 echo "Extracting sources into ${DESTDIR}/usr/src..."
28 for i in $dists; do
29         echo "  Extracting source component: $i"
30         cat s${i}.?? | tar --unlink -xpzf - -C ${DESTDIR}/usr/src
31 done
32 echo "Done extracting sources."
33 exit 0