#!/usr/bin/perl
#
# @(#)r3cpc		1997-11-18
#
# G. Großmann, SAP AG
#
# 1998/04/22 cba: ntr3cpc.pl.tt und rc3cpc.r3t als r3cpc.pl.tt
#                 wieder zusammengeführt
#
#
#    ========== licence begin  GPL
#    Copyright (C) 2001 SAP AG
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of the GNU General Public License
#    as published by the Free Software Foundation; either version 2
#    of the License, or (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#    ========== licence end
#

package r3cpc;
use Env;
use Carp;


use File::Copy;
do "$TOOLVARS";
if ( $@ ) { print "$@"; exit }
ToolTrace("ntr3cpc called with @ARGV\n");

chdir($TMP) || die "Can't change to directory $TMP: $!";

copy("$DBROOT/sap/altkey.cpc", "./altkey.cpc") || warn "Can't copy $DBROOT/sap/altkey.cpc to ./altkey.cpc: $!";

@ARGV = ( "altkey" );
do "$TOOL/bin/ntcpclnk$TOOLEXT" || die "Can't execute $TOOL/bin/ntcpclnk$TOOLEXT: $!";
if ( $@ ) { warn "Error while executing ntcpclnk:\n", "$@"; exit }

unlink "$DBROOT/sap/altkey.exe";
rename("./altkey.exe", "$DBROOT/sap/altkey.exe") || warn "Can't rename ./altkey.exe to $DBROOT/sap/altkey.exe: $!";
unlink <altkey.*>, "$DBROOT/sap/altkey.cpc";



__END__
