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.03.23.13.43.56;	author nwhitehorn;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2011.03.13.17.15.31;	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.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 Nathan Whitehorn
# 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/checksum 219903 2011-03-23 13:43:56Z nwhitehorn $

test -f $BSDINSTALL_DISTDIR/MANIFEST || exit 0

percentage=0
for dist in $DISTRIBUTIONS; do
	distname=$(basename $dist .txz)
	eval "status_$distname=7"
	
	items=""
	for i in $DISTRIBUTIONS; do
		items="$items $i `eval echo \\\${status_$(basename $i .txz):-Pending}`"
	done
	dialog --backtitle "FreeBSD Installer" --title "Checksum Verification" \
	    --mixedgauge "Verifying checksums of selected distributions." \
	    0 0 $percentage $items

	CK=`sha256 -q $BSDINSTALL_DISTDIR/$dist`
	awk -v checksum=$CK -v dist=$dist -v found=0 '{
		if (dist == $1) {
			found = 1
			if (checksum == $2)
				exit(0)
			else
				exit(2)
		}
	} END {if (!found) exit(1);}' $BSDINSTALL_DISTDIR/MANIFEST

	CK_VALID=$?
	if [ $CK_VALID -le 1 ]; then
		if [ $CK_VALID -eq 0 ]; then
			eval "status_$distname=2"
		else
			eval "status_$distname=6"
		fi
		percentage=$(echo $percentage + 100/`echo $DISTRIBUTIONS | wc -w` | bc)
	else
		eval "status_$distname=1"
		dialog --backtitle "FreeBSD Installer" --title "Error" \
		    --msgbox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0
		exit 1
	fi
done

exit 0
@


1.2
log
@SVN rev 219903 on 2011-03-23 13:43:56Z by nwhitehorn

Mark any distfiles with no checksum entries in the manifest "Skipped"
instead of "Passed".
@
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/checksum 219903 2011-03-23 13:43:56Z nwhitehorn $
@


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/checksum 219903 2011-03-23 13:43:56Z 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/checksum 219903 2011-03-23 13:43:56Z nwhitehorn $
@


1.1
log
@SVN rev 219615 on 2011-03-13 17:15:31Z by nwhitehorn

Add generation of an installation manifest containing SHA256 checksums as
well as package descriptions and add code in the installer to check the
checksums.
@
text
@d45 1
a45 1
	awk -v checksum=$CK -v dist=$dist '{
d47 1
d51 1
a51 1
				exit(1)
d53 1
a53 1
	}' $BSDINSTALL_DISTDIR/MANIFEST
d55 7
a61 2
	if [ $? -eq 0 ]; then
		eval "status_$distname=2"
@

