#!/bin/sh

# Copyright (c) 2005- Storey Lab
# 
# Script to copy packages to abacus
# on various operating systems
#
if test "$1" = "-s"
then
    SRC=1
    shift
fi

FROMURL=$*
if test "$FROMURL" = ""
then
	echo "Please specify filename to copy" 1>&2
	exit 1
fi

MACHINE=markov
TOURL=$MACHINE.biostat.washington.edu:/misc/web/www/html/software/jstorey/edge/download

if test "$SRC"
then
    TOURL=$TOURL/linux/
else

    OS=`uname -s`
    case $OS in 
	CYGWIN* | MINGW*)
	    TOURL=$TOURL/windows/
	    ;;
	Darwin*)
	    TOURL=$TOURL/mac/
	    ;;
	Linux*)
	    TOURL=$TOURL/linux/
	    ;;
	*)
	    echo "Unsupported OS: $OS" 1>&2
	    exit 1
	    ;;
    esac
fi

CMD="scp $FROMURL $TOURL"
echo $CMD
$CMD

