#!/usr/bin/ksh ##################################################################### # la_pgmmove.sh - create package for program moves # J. David Schronce Fri Sep 6 10:25:41 CDT 2002 ##################################################################### # Constants PKGTARGETDIR=/tmp SRC=src STAR="*" ############################################ # Make sure there is an environment if [ "X$LAWENVNAME" = "X" ]; then echo "\nNo Environment: . cv to SOURCE Environment...\n" exit 1 fi echo "\nNOTICE :Currently in * $LAWENVNAME * environment. If this is not the" echo "SOURCE environment then press and cv to the correct one." echo "Otherwise, press to continue >\c" read dummy # Get parms echo "\nName of SOURCE ProductLine > \c" read SourcePL if [ "X$SourcePL" = "X" ]; then echo "Cannot be null..." exit 4 fi # See if ProductLine exists if [ -f $LAWDIR/$SourcePL/ifsrc ]; then : else echo "$SourcePL does not exist..." exit 2 fi echo "\n\nThis program requires that a list already be made that contains 2 columns." echo "In the first column the System Code - in the second, separated by a " echo "space, the Program Name." echo \nExample: AC AC762" echo "\nFull path to System Code/Program list > \c" read WorkFile if [ "X$WorkFile" = "X" ]; then echo "Cannot be null..." exit 4 f/ifsrci # See if Directory exists if [ -f $WorkFile ]; then : else echo "$WorkFile does not exist..." exit 2 fi echo "Do these programs require a pgmdump and pgmload? > Y/N\b\b\b\b\b\c" read pgmload case $pgmload in Y|y) pgmload="Y";echo "\npgmdumps and pgmloads will be performed.";; N|n) pgmload="N";echo "\npgmdumps and pgmloads will not be performed.";; *) echo "\nMust answer with Y or N...\n";exit ;; esac while read sc pgm do # Convert to correct case PGM=`echo $pgm | tr [:lower:] [:upper:]` SC=`echo $sc | tr [:upper:] [:lower:]` # Create listing for tar echo "$SC$SRC/$PGM$STAR" >> /tmp/tarlist # Create shell script to run qcompile echo "qcompile \$SourcePL $SC $PGM" >> /tmp/cmplist chmod 755 /tmp/cmplist if [ $pgmload = "Y" ]; then # Create shell script to run pgmload echo "pgmload -p $SC$SRC/$PGM.dmp \$SourcePL" >> /tmp/pgmloadlist chmod 755 /tmp/pgmloadlist pgmdump $SourcePL $SC $LAWDIR/$SourcePL/$SC$SRC/$PGM.dmp $PGM fi done < $WorkFile if [ $pgmload = "Y" ]; then cd $LAWDIR/$SourcePL tar cvf $PKGTARGETDIR/pgmmove.tar `cat /tmp/tarlist` \ /tmp/cmplist /tmp/pgmloadlist rm /tmp/pgmloadlist else cd $LAWDIR/$SourcePL tar cvf $PKGTARGETDIR/pgmmove.tar `cat /tmp/tarlist` /tmp/cmplist fi echo "\n\nProgram package is in $PKGTARGETDIR/pgmmove.tar...\n\n" # Cleanup rm /tmp/tarlist rm /tmp/cmplist