#!C:/MKS/mksnt/ksh.exe #################################################################### # Package productline to copy between different environments/machines # J. David Schronce - Thu May 22 11:10:41 CDT 2003 # C. Conover - Mon Nov 17 11:10:41 EST 2003 #################################################################### #################################################################### # Special Local Configuration here #################################################################### # Non-standard directories below $LAWDIR/ NONSTD_DIRS=./scripts #################################################################### # End of Special Local Configuration #################################################################### # Must be run by user 'Administrator' if [ $LOGNAME != "Administrator" ]; then echo "\n\nOnly executable by 'Administrator'\n\n" exit fi if [ $# -gt 0 ]; then clear echo " The program must be executed by user 'Administrator' and has the logic to exit gracefully if that is not the case. execute $GENDIR/bin/setenv.bat execute $GENDIR/bin/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 C. Conover Lawson Software Nov 17 2003 " exit fi # Make sure there is an environment if [ "X$LAWENVNAME" = "X" ]; then echo "\nNo Environment: Run setenv.bat to Set Environment Variables...\n" exit 1 fi echo "\nNOTICE :Currently in * $LAWENVNAME * environment. If this is not the" echo "SOURCE environment then press and run setenv.bat to correct the variables." 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 mkszip $CurrentPLName.exp echo "Copying Menus from $CurrentPLName..." dmpprodmenus $CurrentPLName $WorkDir/$CurrentPLName.menus echo "Compressing $CurrentPLName.menus..." cd $WorkDir mkszip $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 mkszip $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 mkszip $CurrentPLName.lib.tar echo "Copying Admin..." cd $LAWDIR/$CurrentPLName tar cvf $WorkDir/$CurrentPLName.admin.tar $LAWDIR/$CurrentPLName/Admin echo "Compressing $CurrentPLName.admin.tar..." cd $WorkDir mkszip $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 mkszip $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 mkszip $CurrentPLName.NONSTD_DIRS.tar fi # Package files cd $WorkDir tar cvf $CurrentPLName.pkg.tar.`date +%Y%m%d` $CurrentPLName.exp.gz $CurrentPLName.menus.gz $CurrentPLName.src.tar.gz $CurrentPLName.lib.tar.gz $CurrentPLName.admin.tar.gz $CurrentPLName.NONSTDLIB.cfg.tar.gz $CurrentPLName.NONSTD_DIRS.tar.gz #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.gz ]; then rm $CurrentPLName.$pkg_ext.gz fi done echo "The package of $CurrentPLName is in $WorkDir/$CurrentPLName.pkg.tar.`date +%Y%m%d` "