]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - usr.sbin/bsdinstall/scripts/docsinstall
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / usr.sbin / bsdinstall / scripts / docsinstall
1 #!/bin/sh
2 #-
3 # Copyright (c) 2011 Marc Fonvieille
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
8 # are met:
9 # 1. Redistributions of source code must retain the above copyright
10 #    notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 #    notice, this list of conditions and the following disclaimer in the
13 #    documentation and/or other materials provided with the distribution.
14 #
15 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 # ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 # SUCH DAMAGE.
26 #
27 # $FreeBSD$
28
29
30 exec 3>&1
31 DOCS=$(dialog --backtitle "FreeBSD Installer" \
32     --title "FreeBSD Documentation Installation" --separate-output \
33     --checklist "This menu will allow you to install the whole documentation set
34 from the FreeBSD Documentation Project: Handbook, FAQ and articles.\n\n
35 Please select the language versions you wish to install.  At minimum,
36 you should install the English version, this is the original version
37 of the documentation.\n\n
38 NB: This requires a working, configured network connection." 0 0 0 \
39         bn      "Bengali Documentation" ${DIST_DOC_BN:-off} \
40         da      "Danish Documentation" ${DIST_DOC_DA:-off} \
41         de      "German Documentation" ${DIST_DOC_DE:-off} \
42         el      "Greek Documentation" ${DIST_DOC_EL:-off} \
43         en      "English Documentation (recommended)" ${DIST_DOC_EN:-on} \
44         es      "Spanish Documentation" ${DIST_DOC_ES:-off} \
45         fr      "French Documentation" ${DIST_DOC_FR:-off} \
46         hu      "Hungarian Documentation" ${DIST_DOC_HU:-off} \
47         it      "Italian Documentation" ${DIST_DOC_IT:-off} \
48         ja      "Japanese Documentation" ${DIST_DOC_JA:-off} \
49         mn      "Mongolian Documentation" ${DIST_DOC_MN:-off} \
50         nl      "Dutch Documentation" ${DIST_DOC_NL:-off} \
51         pl      "Polish Documentation" ${DIST_DOC_PL:-off} \
52         pt      "Portuguese Documentation" ${DIST_DOC_PT:-off} \
53         ru      "Russian Documentation" ${DIST_DOC_RU:-off} \
54         sr      "Serbian Documentation" ${DIST_DOC_SR:-off} \
55         tr      "Turkish Documentation" ${DIST_DOC_TR:-off} \
56         zh_cn   "Simplified Chinese Documentation" ${DIST_DOC_ZH_CN:-off} \
57         zh_tw   "Traditional Chinese Documentation" ${DIST_DOC_ZH_TW:-off} \
58 2>&1 1>&3)
59 test $? -eq 0 || exit 0
60 exec 3>&-
61
62 # Let pkg_add be able to use name servers
63 cp ${BSDINSTALL_TMPETC}/resolv.conf ${BSDINSTALL_CHROOT}/etc
64
65 error() {
66         dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \
67             "Could not install package $1 (`tail -n 1 ${BSDINSTALL_LOG}`)" 0 0
68         exit 1
69 }
70
71
72 clear
73 echo "FreeBSD Installer"
74 echo "========================"
75 echo
76
77 for i in $DOCS; do
78     pkg_add -C ${BSDINSTALL_CHROOT} -r ${i}-freebsd-doc || error $i-freebsd-doc
79 done