diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 3c2ec9d83ad6..6fd8bde77d53 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -1,7 +1,7 @@ #!/bin/sh #- -# Copyright 2004-2006 Colin Percival +# Copyright 2004-2007 Colin Percival # All rights reserved # # Redistribution and use in source and binary forms, with or without @@ -538,6 +538,13 @@ install_check_params () { exit 1 fi + # Check that securelevel <= 0. Otherwise we can't update schg files. + if [ `sysctl -n kern.securelevel` -gt 0 ]; then + echo "Updates cannot be installed when the system securelevel" + echo "is greater than zero." + exit 1 + fi + # Check that we have a working directory _WORKDIR_bad="Directory does not exist or is not writable: " if ! [ -d "${WORKDIR}" -a -w "${WORKDIR}" ]; then @@ -1356,7 +1363,12 @@ fetch_files_prepare () { # List of files wanted cut -f 2 -d '|' < $3.hashes | - sort -u > files.wanted + sort -u | + while read HASH; do + if ! [ -f files/${HASH}.gz ]; then + echo ${HASH} + fi + done > files.wanted # Generate a list of unmodified files comm -12 $1.hashes $2.hashes |