#!/bin/ksh #################################################################### # Packge productline to copy between different environments/machines # J. David Schronce - Thu May 22 11:10:41 CDT 2003 #################################################################### #################################################################### # Special Local Configuration here #################################################################### # Non-standard directories below $LAWDIR/ - # one line separated by spaces NONSTD_DIRS=./scripts #################################################################### # End of Special Local Configuration #################################################################### # Must be run by user 'lawadm' #if [ $LOGNAME != "lawadm" ]; then #echo "\n\nOnly executable by 'lawadm'\n\n" #exit #fi if [ $# -gt 0 ]; then clear echo " . cv into the source environment execute pkg_pline.sh with no parameters Required knowledge: A temporary workspace is required with approximately 500 MB of free space. This is where the package file will be created. Typical installations create a compressed package file less than 125 MB but require more during the creation process. You will be expected to provide the full path to this directory at the File Storage Directory > prompt. You will then be asked to provide the Source Productline name at the Name of SOURCE Product Line > prompt. This is the end of your active involvement until the process is completed. As a way of tracking the program's progress you will see the following informational messages as the productline is copied and compressed: Copying SOURCE Product Line Copying Menus Copying Source Code Copying Libraries... Copying Admin... Copying NONSTDLIB.cfg.. Copying NONSTD_DIRS... Press for more...\c" read dummy echo " At this point final package file is created and all the ancillary files removed. You will see the last message of the program, telling you where the package is saved. The package of is in //.pkg.tar.yyyymmdd where yyyymmdd is today's date. The package can now be used to create another productline in the current environment, another environment locally or copied to a remote system where it can be used to build a productline in any existing environment. J. David Schronce Lawson Software June 6, 2003 " exit fi # 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 "\nThis process will create temporary files approximately 500MB" echo "in size. Enter the full path to a directory with sufficient" echo "available space to hold these files." echo "\nFile Storage Directory > \c" read WorkDir if [ "X$WorkDir" = "X" ]; then echo "Cannot be null..." exit 4 fi # See if Directory exists if [ -d $WorkDir ]; then : else echo "$WorkDir does not exist..." exit 2 fi echo "Name of SOURCE Product Line > \c" read CurrentPLName if [ "X$CurrentPLName" = "X" ]; then echo "Cannot be null..." exit 4 fi echo "Copying SOURCE Product Line $CurrentPLName..." sysdump -e $CurrentPLName $WorkDir/$CurrentPLName.exp echo "Compressing $CurrentPLName.exp..." cd $WorkDir compress $CurrentPLName.exp echo "Copying Menus from $CurrentPLName..." dmpprodmenus $CurrentPLName $WorkDir/$CurrentPLName.menus echo "Compressing $CurrentPLName.menus..." cd $WorkDir compress $CurrentPLName.menus cd $LAWDIR/$CurrentPLName echo "Copying Source Code ..." tar cvf $WorkDir/$CurrentPLName.src.tar ./??src ./backup ./metadata echo "Compressing $CurrentPLName.src.tar..." cd $WorkDir compress $CurrentPLName.src.tar cd $LAWDIR/$CurrentPLName echo "Copying Libraries..." tar cvf $WorkDir/$CurrentPLName.lib.tar ./[pw][ds]lib echo "Compressing $CurrentPLName.lib.tar..." cd $WorkDir compress $CurrentPLName.lib.tar echo "Building User Exit Messages..." cd $LAWDIR/$CurrentPLName # Create msg dumps for User Exits > ./Admin/usrexits.msg for x in `ls ??src/*[0-9][BME]PD` do sc=`echo $x | cut -d"/" -f1 | sed 's/src//g'` pgm=`echo $x | cut -d"/" -f2 | sed 's/PD$//g'` echo "bldmsg $LAWENVNAME $sc $pgm >> ./Admin/usrexits.msg" bldmsg $LAWENVNAME $sc $pgm >> ./Admin/usrexits.msg done echo "Copying Admin..." cd $LAWDIR/$CurrentPLName tar cvf $WorkDir/$CurrentPLName.admin.tar ./Admin echo "Compressing $CurrentPLName.admin.tar..." cd $WorkDir compress $CurrentPLName.admin.tar cd $LAWDIR/$CurrentPLName if [ -f NONSTDLIB.cfg ]; then echo "Copying NONSTDLIB.cfg..." tar cvf $WorkDir/$CurrentPLName.NONSTDLIB.cfg.tar ./NONSTDLIB.cfg echo "Compressing $CurrentPLName.NONSTDLIB.cfg.tar..." cd $WorkDir compress $CurrentPLName.NONSTDLIB.cfg.tar fi # Add Non-Standard directories here cd $LAWDIR/$CurrentPLName if [ "$NONSTD_DIRS" ]; then echo "Copying NONSTD_DIRS..." tar cvf $WorkDir/$CurrentPLName.NONSTD_DIRS.tar $NONSTD_DIRS echo "Compressing $CurrentPLName.NONSTD_DIRS.tar..." cd $WorkDir compress $CurrentPLName.NONSTD_DIRS.tar fi # Package files cd $WorkDir tar cvf $CurrentPLName.pkg.tar.`date +%Y%m%d` $CurrentPLName.exp.Z $CurrentPLName.menus.Z $CurrentPLName.src.tar.Z $CurrentPLName.lib.tar.Z $CurrentPLName.admin.tar.Z $CurrentPLName.NONSTDLIB.cfg.tar.Z $CurrentPLName.NONSTD_DIRS.tar.Z #Cleanup for pkg_ext in exp menus src.tar lib.tar admin.tar NONSTDLIB.cfg.tar NONSTD_DIRS.tar do if [ -f $CurrentPLName.$pkg_ext.Z ]; then rm $CurrentPLName.$pkg_ext.Z fi done echo "The package of $CurrentPLName is in $WorkDir/$CurrentPLName.pkg.tar.`date +%Y%m%d` "