This is what I use to re-ports, re-src comfortably....
Both good for 1st and following times
I named it "re-portssrc"
---------------------------------------------------------------------------------------
#!/bin/sh
plain=$(echo '\033[0m')
redfg=$(echo '\033[1;31m')
greenfg=$(echo '\033[1;32m')
yellowfg=$(echo '\033[01;33m')
bluefg=$(echo '\033[1;34m')
magentafg=$(echo '\033[1;35m')
cyanfg=$(echo '\033[1;36m')
whitefg=$(echo '\033[1;37m')
UTENTE=`whoami`
if [ $UTENTE = root ]; then
echo $yellowfg"\n----> OpenBSD PORTS & SOURCES updater script 1.1
:)\n"$plain
else
echo $redfg"\nYou gotta be root to run this script :(\n"$plain
exit 1
fi
# Alternative automatic procedure, when dmesg gives correct version
#if [ `dmesg|grep OpenBSD|grep current` -n ] 2> /dev/null;
# then VER=`uname -r|tr '.' '_'`
# else VER="snapshots"
#fi
while :
do
echo
echo $yellowfg"Choose BUILD VERSION among the following:"$plain
echo
echo "s: snapshot"
echo `uname -r`": OpenBSD Stable version "`uname -r`
echo "q: quit script"
echo
echo -n 'Your choice ---> '
read CHOICE
case $CHOICE in
s) VER="snapshots"; break;;
`uname -r`) VER=`uname -r|tr '.' '_'`; break;;
q|Q) echo 'Bye.'; exit 2;;
*) echo 'Bad choice!';;
esac
done
while :
do
echo
echo $yellowfg"Choose the source server among the following:"$plain
echo
echo '1: (DE) [email protected]:/cvs'
echo '2: (LT) [email protected]:/cvs'
echo '3: (SI) [email protected]:/cvs'
echo '4: (CA) [email protected]:/cvs'
echo '5: (DE) [email protected]:/cvs'
echo '6: (US) [email protected]:/cvs'
echo '7: (FR) [email protected]:/cvs'
echo '8: (AT) [email protected]:/cvs'
echo '9: (SE) [email protected]:/cvs'
echo 'q: quit script'
echo
echo -n 'Your choice ---> '
read CHOICE
case $CHOICE in
1) ANON_SRV="[email protected]:/cvs"; break;;
2) ANON_SRV="[email protected]:/cvs"; break;;
3) ANON_SRV="[email protected]:/cvs"; break;;
4) ANON_SRV="[email protected]:/cvs"; break;;
5) ANON_SRV="[email protected]:/cvs"; break;;
6) ANON_SRV="[email protected]:/cvs"; break;;
7) ANON_SRV="[email protected]:/cvs"; break;;
8) ANON_SRV="[email protected]:/cvs"; break;;
9) ANON_SRV="[email protected]:/cvs"; break;;
q|Q) echo 'Bye.'; exit 2;;
*) echo 'Bad choice!';;
esac
done
if [ $VER = snapshots ]; then
cd /usr; cvs -qd $ANON_SRV get -P ports; cvs -qd $ANON_SRV get -P src
else
cd /usr; cvs -qd $ANON_SRV get -rOPENBSD_$VER -P ports; cvs -qd
$ANON_SRV get -rOPENBSD_$VER -P src
fi