version 1.72, 2015/01/18 03:41:33 |
version 1.77, 2015/05/03 01:11:52 |
|
|
#!/bin/sh |
#!/bin/sh |
# $AFresh1: update_openbsd,v 1.71 2015/01/18 03:01:08 andrew Exp $ |
# $AFresh1: update_openbsd,v 1.76 2015/05/02 23:27:53 andrew Exp $ |
# |
# |
# Copyright (c) 2012 Andrew Fresh <andrew@afresh1.com> |
# Copyright (c) 2012 Andrew Fresh <andrew@afresh1.com> |
# |
# |
|
|
local xserv=/usr/X11R6/bin/X |
local xserv=/usr/X11R6/bin/X |
local xshare=/usr/X11R6/bin/startx |
local xshare=/usr/X11R6/bin/startx |
|
|
|
local _nv=`echo $NEW_VER | sed -e 's/\.//'` |
local _c _d _e |
local _c _d _e |
echo -n base |
echo -n base |
echo -n ' etc' |
[ $_nv -lt 57 ] && echo -n ' etc' |
for _d in misc man comp game xbase xetc xfont xserv xshare; do |
for _d in misc man comp game xbase xetc xfont xserv xshare; do |
|
[ $_d = xetc -a $_nv -ge 57 ] && continue |
eval _e=\$${_d} |
eval _e=\$${_d} |
_c=`ls $_e 2> /dev/null | wc -l` |
_c=`ls $_e 2> /dev/null | wc -l` |
#echo $_c $_d $_e |
#echo $_c $_d $_e |
|
|
local _file=$1 |
local _file=$1 |
# This could go circular, but I dunno how to fix that. |
# This could go circular, but I dunno how to fix that. |
if [ -h $_file ]; then |
if [ -h $_file ]; then |
follow_symlink $( file $_file | |
follow_symlink $( readlink -f $_file ) |
grep 'symbolic link' | |
|
sed -e s/^.*\\\`// -e s/\\\'\$// ) |
|
else |
else |
echo $_file |
echo $_file |
fi |
fi |
|
|
fi |
fi |
signify -V -e -p $_keyfile -x $_type -m - | grep -f index | sha256 -c - |
signify -V -e -p $_keyfile -x $_type -m - | grep -f index | sha256 -c - |
else |
else |
grep -f index $_type | sum -c |
grep -f index $_type | sha256 -c |
fi |
fi |
|
|
if [ $? -ne 0 ]; then |
if [ $? -ne 0 ]; then |
|
|
|
|
local _type |
local _type |
for _type in $CHECKSUM_TYPES; do |
for _type in $CHECKSUM_TYPES; do |
|
[ -n "$NO_SIGNIFY" -a "$_type" != "${_type%.sig}" ] && continue |
if [ -e $_type ]; then |
if [ -e $_type ]; then |
check_sum $_type && break |
check_sum $_type && break |
[ -z "$IGNORE_CHECKSUM_ERROR" ] && exit 1 |
[ -z "$IGNORE_CHECKSUM_ERROR" ] && exit 1 |
|
|
FTP_CMD=${FTP_CMD:=ftp -V} |
FTP_CMD=${FTP_CMD:=ftp -V} |
PKG_PATH=${PKG_PATH:=/usr/ports/packages/`machine`/all/:${MIRROR}/`uname -r`/packages/`machine`/} |
PKG_PATH=${PKG_PATH:=/usr/ports/packages/`machine`/all/:${MIRROR}/`uname -r`/packages/`machine`/} |
|
|
|
set_version |
|
|
DESTDIR=${DESTDIR:=/} |
DESTDIR=${DESTDIR:=/} |
SYSMERGE=${SYSMERGE:=/usr/sbin/sysmerge} |
SYSMERGE=${SYSMERGE:=/usr/sbin/sysmerge} |
FORCE_DIR=${FORCE_DIR:=No} |
FORCE_DIR=${FORCE_DIR:=No} |
|
|
|
|
CHECKSUM_TYPES=${CHECKSUM_TYPES:=SHA256.sig SHA256} |
CHECKSUM_TYPES=${CHECKSUM_TYPES:=SHA256.sig SHA256} |
|
|
set_version |
|
local _error=$? |
local _error=$? |
|
|
echo |
echo |
|
|
fi |
fi |
update_etc |
update_etc |
|
|
echo '==> UPDATING PACKAGES' |
OPENUP=$( which openup ) |
pkg_add -ui -F update -F updatedepends |
if [ -n "$OPENUP" ]; then |
|
echo "==> UPDATING WITH $OPENUP" |
|
$OPENUP |
|
else |
|
echo '==> UPDATING PACKAGES' |
|
pkg_add -ui -F update -F updatedepends |
|
fi |
|
|
echo '==> UPDATING FIRMWARE' |
echo '==> UPDATING FIRMWARE' |
fw_update |
fw_update |