#!/bin/sh
# $Id: upfrom40,v 1.4.12.1 2004/09/10 17:48:13 jp148923 Exp $

#    SAM-QFS_notice_begin
#
#      Solaris 2.x Sun Storage & Archiving Management File System
#
#      Copyright (c) 2004 Sun Microsystems, Inc.
#      All Rights Reserved.
#
#      Government Rights Notice
#      Use, duplication, or disclosure by the U.S. Government is
#      subject to restrictions set forth in the Sun Microsystems,
#      Inc. license agreements and as provided in DFARS 227.7202-1(a)
#      and 227.7202-3(a) (1995), DRAS 252.227-7013(c)(ii) (OCT 1988),
#      FAR 12.212(a)(1995), FAR 52.227-19, or FAR 52.227-14 (ALT III),
#      as applicable.  Sun Microsystems, Inc.
#
#    SAM-QFS_notice_end

#
#  upfrom40  - convert files and paths from SAM-FS 4.0 style
#

#echo ENTERING upfrom40
#echo "ALT_ROOT=|$PKG_INSTALL_ROOT|"

ETCDIR=$PKG_INSTALL_ROOT/etc/opt/SUNWsamfs
EXEDIR=$PKG_INSTALL_ROOT/opt/SUNWsamfs/sbin
SCRIPTS=$PKG_INSTALL_ROOT/etc/opt/SUNWsamfs/scripts


#  Function definitions.


#  main script.

# rename ftp.cmd to rft.cmd

if [ ! -f ${ETCDIR}/rft.cmd ] ; then
    if [ -f ${ETCDIR}/ftp.cmd ] ; then
        /bin/cp ${ETCDIR}/ftp.cmd ${ETCDIR}/rft.cmd
    fi
fi

# copy scripts from 4.0 location

SH_LIST="ssi.sh"
for object in $SH_LIST; do
    if [ -f ${ETCDIR}/${object} ]; then
        /bin/cp ${ETCDIR}/${object} ${SCRIPTS}/${object}
    fi
done

# copy scripts from 4.0 location

SH_LIST="archiver.sh recycler.sh save_core.sh dev_down.sh load_notify.sh"
for object in $SH_LIST; do
	if [ -f ${EXEDIR}/${object} ]; then
		/bin/cp ${EXEDIR}/${object} ${SCRIPTS}/${object}
	fi
done

# Create 4.2 License file

/bin/cp ${ETCDIR}/LICENSE.4.0 ${ETCDIR}/LICENSE.4.2
