summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdinstall/scripts/docsinstall
blob: 46d731f248fca997bd68f63d0e515c34ed931d3c (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh
#-
# Copyright (c) 2011 Marc Fonvieille
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD$


exec 3>&1
DOCS=$(dialog --backtitle "FreeBSD Installer" \
    --title "FreeBSD Documentation Installation" --separate-output \
    --checklist "This menu will allow you to install the whole documentation set
from the FreeBSD Documentation Project: Handbook, FAQ and articles.\n\n
Please select the language versions you wish to install.  At minimum,
you should install the English version, this is the original version
of the documentation.\n\n
NB: This requires a working, configured network connection." 0 0 0 \
	bn	"Bengali Documentation" ${DIST_DOC_BN:-off} \
	da	"Danish Documentation" ${DIST_DOC_DA:-off} \
	de	"German Documentation" ${DIST_DOC_DE:-off} \
	el	"Greek Documentation" ${DIST_DOC_EL:-off} \
	en	"English Documentation (recommended)" ${DIST_DOC_EN:-on} \
	es	"Spanish Documentation" ${DIST_DOC_ES:-off} \
	fr	"French Documentation" ${DIST_DOC_FR:-off} \
	hu	"Hungarian Documentation" ${DIST_DOC_HU:-off} \
	it	"Italian Documentation" ${DIST_DOC_IT:-off} \
	ja	"Japanese Documentation" ${DIST_DOC_JA:-off} \
	mn	"Mongolian Documentation" ${DIST_DOC_MN:-off} \
	nl	"Dutch Documentation" ${DIST_DOC_NL:-off} \
	pl	"Polish Documentation" ${DIST_DOC_PL:-off} \
	pt	"Portuguese Documentation" ${DIST_DOC_PT:-off} \
	ru	"Russian Documentation" ${DIST_DOC_RU:-off} \
	sr	"Serbian Documentation" ${DIST_DOC_SR:-off} \
	tr	"Turkish Documentation" ${DIST_DOC_TR:-off} \
	zh_cn	"Simplified Chinese Documentation" ${DIST_DOC_ZH_CN:-off} \
	zh_tw	"Traditional Chinese Documentation" ${DIST_DOC_ZH_TW:-off} \
2>&1 1>&3)
test $? -eq 0 || exit 0
exec 3>&-

# Let pkg(8) be able to use name servers
cp ${BSDINSTALL_TMPETC}/resolv.conf ${BSDINSTALL_CHROOT}/etc

error() {
	dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
	    "Could not install package $1 (`tail -n 1 ${BSDINSTALL_LOG}`)" 0 0
	exit 1
}


clear
echo "FreeBSD Installer"
echo "========================"
echo

echo "Please wait while the repository metadata is fetched."
echo "This may take a few moments."

env ASSUME_ALWAYS_YES=1 pkg -c ${BSDINSTALL_CHROOT} install pkg \
	|| error pkg

for i in $DOCS; do
    env ASSUME_ALWAYS_YES=1 pkg -c ${BSDINSTALL_CHROOT} install ${i}-freebsd-doc \
	|| error $i-freebsd-doc
done
OpenPOWER on IntegriCloud