bsdinstall checksum: Replace dialog with bsddialog

Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.

Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34660
This commit is contained in:
Alfonso S. Siciliano 2022-03-26 01:36:13 +01:00
parent bbddd8888a
commit 0868f62176
No known key found for this signature in database
GPG Key ID: 3F9EEFACFD371E37

View File

@ -31,15 +31,15 @@ test -f $BSDINSTALL_DISTDIR/MANIFEST || exit 0
percentage=0 percentage=0
for dist in $DISTRIBUTIONS; do for dist in $DISTRIBUTIONS; do
distname=$(basename $dist .txz) distname=$(basename $dist .txz)
eval "status_$distname=7" eval "status_$distname=-8"
items="" items=""
for i in $DISTRIBUTIONS; do for i in $DISTRIBUTIONS; do
items="$items $i `eval echo \\\${status_$(basename $i .txz):-Pending}`" items="$items $i `eval echo \\\${status_$(basename $i .txz):--11}`"
done done
dialog --backtitle "FreeBSD Installer" --title "Checksum Verification" \ bsddialog --backtitle "FreeBSD Installer" --title "Checksum Verification" \
--mixedgauge "Verifying checksums of selected distributions." \ --mixedgauge "\nVerifying checksums of selected distributions.\n" \
0 0 $percentage $items 0 0 $percentage -- $items
CK=`sha256 -q $BSDINSTALL_DISTDIR/$dist` CK=`sha256 -q $BSDINSTALL_DISTDIR/$dist`
awk -v checksum=$CK -v dist=$dist -v found=0 '{ awk -v checksum=$CK -v dist=$dist -v found=0 '{
@ -55,20 +55,20 @@ for dist in $DISTRIBUTIONS; do
CK_VALID=$? CK_VALID=$?
if [ $CK_VALID -le 1 ]; then if [ $CK_VALID -le 1 ]; then
if [ $CK_VALID -eq 0 ]; then if [ $CK_VALID -eq 0 ]; then
eval "status_$distname=2" eval "status_$distname=-3"
else else
eval "status_$distname=6" eval "status_$distname=-7"
fi fi
percentage=$(echo $percentage + 100/`echo $DISTRIBUTIONS | wc -w` | bc) percentage=$(echo $percentage + 100/`echo $DISTRIBUTIONS | wc -w` | bc)
else else
eval "status_$distname=1" eval "status_$distname=-2"
case $(/bin/freebsd-version -u) in case $(/bin/freebsd-version -u) in
*-ALPHA*|*-CURRENT|*-STABLE|*-PRERELEASE) *-ALPHA*|*-CURRENT|*-STABLE|*-PRERELEASE)
dialog --backtitle "FreeBSD Installer" --title "Error" \ bsddialog --backtitle "FreeBSD Installer" --title "Error" \
--msgbox "The checksum for $dist does not match. It may have become corrupted, or it may be from a newer version of FreeBSD. Please check for a newer snapshot." 0 0 --msgbox "The checksum for $dist does not match. It may have become corrupted, or it may be from a newer version of FreeBSD. Please check for a newer snapshot." 0 0
;; ;;
*) *)
dialog --backtitle "FreeBSD Installer" --title "Error" \ bsddialog --backtitle "FreeBSD Installer" --title "Error" \
--msgbox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0 --msgbox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0
;; ;;
esac esac