#!/bin/bash

# tupgrade.sh
# Quick hack to bring a devbox up to date.
# stuart@armedslack.org

# autoconf needs a reinstall if we've had v2.13 installed as well.
#removepkg autoconf
#removepkg autoconf2.13

# We only want to install the relevant Kernel packages:
if grep -qi riscpc /proc/cpuinfo ; then
   upgradepkg a/kernel*riscpc*tgz
fi
if grep -qi iyonix /proc/cpuinfo ; then
   upgradepkg a/kernel*iyonix*tgz
fi
if grep -qi arm-versatile /proc/cpuinfo ; then
   upgradepkg a/kernel*versatile*tgz
fi

# I'm not interested in having autoconf2.13 installed.
( find . -name '*.tgz' -not -name '*kernel*' \( -not -name 'autoconf2.13*' -prune \) | while read pkg ; do
    upgradepkg --install-new $pkg
 done ) 2>&1 | tee /tmp/upgrade.log

cd ../
