head	1.3;
access;
symbols
	RELENG_9_1_0_RELEASE:1.2.2.1.4.2
	RELENG_9_1:1.2.2.1.0.4
	RELENG_9_1_BP:1.2.2.1
	RELENG_9_0_0_RELEASE:1.2.2.1.2.1
	RELENG_9_0:1.2.2.1.0.2
	RELENG_9_0_BP:1.2.2.1
	RELENG_9:1.2.0.2
	RELENG_9_BP:1.2;
locks; strict;
comment	@# @;


1.3
date	2012.11.17.01.54.40;	author svnexp;	state Exp;
branches;
next	1.2;

1.2
date	2011.08.18.16.00.32;	author nwhitehorn;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2011.07.09.23.01.54;	author nwhitehorn;	state Exp;
branches;
next	;

1.2.2.1
date	2011.09.23.00.51.37;	author kensmith;	state Exp;
branches
	1.2.2.1.2.1
	1.2.2.1.4.1;
next	1.2.2.2;

1.2.2.2
date	2012.11.17.11.37.43;	author svnexp;	state Exp;
branches;
next	1.2.2.3;

1.2.2.3
date	2014.03.31.02.01.46;	author svnexp;	state Exp;
branches;
next	1.2.2.4;

1.2.2.4
date	2014.04.18.01.01.43;	author svnexp;	state Exp;
branches;
next	;

1.2.2.1.2.1
date	2011.11.11.04.20.22;	author kensmith;	state Exp;
branches;
next	1.2.2.1.2.2;

1.2.2.1.2.2
date	2012.11.17.08.37.39;	author svnexp;	state Exp;
branches;
next	;

1.2.2.1.4.1
date	2012.08.05.23.54.33;	author kensmith;	state Exp;
branches;
next	1.2.2.1.4.2;

1.2.2.1.4.2
date	2012.11.17.08.48.31;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.3
log
@Switching exporter and resync
@
text
@#!/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: head/usr.sbin/bsdinstall/scripts/docsinstall 224972 2011-08-18 16:00:32Z nwhitehorn $


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_add 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

for i in $DOCS; do
    pkg_add -C ${BSDINSTALL_CHROOT} -r ${i}-freebsd-doc || error $i-freebsd-doc
done
@


1.2
log
@SVN rev 224972 on 2011-08-18 16:00:32Z by nwhitehorn

Fix a bug that prevented docsinstall from being able to use DNS in most
cases and provide a better error handling mechanism during package
installation.

Approved by:	re (kib)
@
text
@d27 1
a27 1
# $FreeBSD$
@


1.2.2.1
log
@SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.2.2.2
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242902
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242902 | dteske | 2012-11-11 23:29:45 +0000 (Sun, 11 Nov 2012) | 10 lines
## SVN ##
## SVN ## Fix a regression introduced by SVN r211417 that saw the breakage of a feature
## SVN ## documented in usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):
## SVN ##
## SVN ## If /usr/sbin/sysinstall is linked to another filename, say
## SVN ## `/usr/local/bin/configPackages', then the basename will be used
## SVN ## as an implicit command name.
## SVN ##
## SVN ## Reviewed by:	adrian (co-mentor)
## SVN ## Approved by:	adrian (co-mentor)
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d27 1
a27 1
# $FreeBSD: stable/9/usr.sbin/bsdinstall/scripts/docsinstall 224972 2011-08-18 16:00:32Z nwhitehorn $
@


1.2.2.3
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/263956
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a3 1
# Copyright (c) 2013 Devin Teske
d27 1
a27 3
# $FreeBSD: stable/9/usr.sbin/bsdinstall/scripts/docsinstall 263956 2014-03-31 01:04:40Z dteske $
#
############################################################ INCLUDES
a28 6
BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
f_dprintf "%s: loading includes..." "$0"
f_include $BSDCFG_SHARE/dialog.subr
f_include $BSDCFG_SHARE/mustberoot.subr
f_include $BSDCFG_SHARE/packages/packages.subr
d30 31
a60 1
############################################################ CONFIGURATION
d62 2
a63 8
#
# List of languages to display (descriptions pulled from $msg_{lang}doc_desc)
#
: ${DOCSINSTALL_LANGS:=\
	bn da de el en es fr hu it ja mn nl pl pt ru sr tr zh_cn zh_tw \
}

############################################################ GLOBALS
d65 4
a68 83
#
# Strings that should be moved to an i18n file and loaded with f_include_lang()
#
hline_arrows_space_tab_enter="Use arrows, SPACE, TAB or ENTER"
msg_bndoc_desc="Bengali Documentation"
msg_cancel="Cancel"
msg_dadoc_desc="Danish Documentation"
msg_dedoc_desc="German Documentation"
msg_docsinstall_menu_text="This menu allows you to install the whole documentation set from\nthe FreeBSD Documentation Project: Handbook, FAQ, and articles.\n\nPlease select the language versions you wish to install. At\nminimum, you should install the English version, the original\nversion of the documentation."
msg_eldoc_desc="Greek Documentation"
msg_endoc_desc="English Documentation (recommended)"
msg_esdoc_desc="Spanish Documentation"
msg_frdoc_desc="French Documentation"
msg_freebsd_documentation_installation="FreeBSD Documentation Installation"
msg_freebsd_installer="FreeBSD Installer"
msg_hudoc_desc="Hungarian Documentation"
msg_itdoc_desc="Italian Documentation"
msg_jadoc_desc="Japanese Documentation"
msg_mndoc_desc="Mongolian Documentation"
msg_nldoc_desc="Dutch Documentation"
msg_ok="OK"
msg_pldoc_desc="Polish Documentation"
msg_ptdoc_desc="Portuguese Documentation"
msg_rudoc_desc="Russian Documentation"
msg_srdoc_desc="Serbian Documentation"
msg_trdoc_desc="Turkish Documentation"
msg_zh_cndoc_desc="Simplified Chinese Documentation"
msg_zh_twdoc_desc="Traditional Chinese Documentation"

############################################################ FUNCTIONS

# dialog_menu_main
#
# Display the dialog(1)-based application main menu.
#
dialog_menu_main()
{
	local title="$DIALOG_TITLE"
	local btitle="$DIALOG_BACKTITLE"
	local prompt="$msg_docsinstall_menu_text"
	local check_list= # Calculated below
	local hline="$hline_arrows_space_tab_enter"

	local lang desc upper status
	for lang in $DOCSINSTALL_LANGS; do
		# Fetch the i18n description to display
		f_getvar msg_${lang}doc_desc desc
		f_shell_escape "$desc" desc

		# Get default status for each language
		upper=$( echo "$lang" | awk '{print toupper($0)}' )
		case "$lang" in
		en) f_getvar DIST_DOC_$upper:-on status ;;
		 *) f_getvar DIST_DOC_$upper:-off status
		esac

		check_list="$check_list
			'$lang' '$desc' '$status'
		" # END-QUOTE
	done

	local height width rows
	eval f_dialog_checklist_size height width rows \
	                             \"\$title\"  \
	                             \"\$btitle\" \
	                             \"\$prompt\" \
	                             \"\$hline\"  \
	                             $check_list
	local selected
	selected=$( eval $DIALOG \
		--title \"\$title\"             \
		--backtitle \"\$btitle\"        \
		--hline \"\$hline\"             \
		--ok-label \"\$msg_ok\"         \
		--cancel-label \"\$msg_cancel\" \
		--checklist \"\$prompt\"        \
		$height $width $rows            \
		$check_list                     \
		2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
	)
	local retval=$?
	f_dialog_menutag_store -s "$selected"
	return $retval
a70 8
############################################################ MAIN

#
# Initialize
#
f_dialog_title "$msg_freebsd_documentation_installation"
f_dialog_backtitle "$msg_freebsd_installer"
f_mustberoot_init
d72 4
a75 5
#
# Launch application main menu
#
dialog_menu_main || f_die
f_dialog_menutag_fetch selected
d77 2
a78 8
# Let pkg_add be able to use name servers
f_quietly cp -f $BSDINSTALL_TMPETC/resolv.conf $BSDINSTALL_CHROOT/etc/

#
# Install each of the selected packages
#
for lang in $selected; do
	f_package_add $lang-freebsd-doc || return $FAILURE
a79 4

################################################################################
# END
################################################################################
@


1.2.2.4
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/264633
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@d28 1
a28 1
# $FreeBSD: stable/9/usr.sbin/bsdinstall/scripts/docsinstall 264633 2014-04-18 00:53:35Z dteske $
a121 1
		--separate-output               \
@


1.2.2.1.4.1
log
@SVN rev 239080 on 2012-08-05 23:54:33Z by kensmith

Copy stable/9 to releng/9.1 as part of the 9.1-RELEASE release process.

Approved by:	re (implicit)
@
text
@@


1.2.2.1.4.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: releng/9.1/usr.sbin/bsdinstall/scripts/docsinstall 224972 2011-08-18 16:00:32Z nwhitehorn $
@


1.2.2.1.2.1
log
@SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)
@
text
@@


1.2.2.1.2.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: releng/9.0/usr.sbin/bsdinstall/scripts/docsinstall 224972 2011-08-18 16:00:32Z nwhitehorn $
@


1.1
log
@SVN rev 223897 on 2011-07-09 23:01:54Z by nwhitehorn

Per request of the docs team, install docs as packages, instead of via
the normal distfile mechanism. Thanks to Marc Fonvieille for the patch and
for putting up with me taking entirely too long to commit this!

Submitted by:	blackend
@
text
@d62 10
d78 1
a78 1
    pkg_add -C ${BSDINSTALL_CHROOT} -r ${i}-freebsd-doc
@

