2
0

build_id 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. #!/bin/ksh
  2. #
  3. # build_id
  4. #
  5. ########################################################################
  6. # set -x
  7. ##########################################################################
  8. #
  9. # Script setup: THIS NEEDS TO BE FIRST
  10. #
  11. SCRIPTS_DIR="`dirname $0`"
  12. if [ "" = "$SCRIPTS_DIR" ]; then
  13. SCRIPTS_DIR=/project/dt/scripts
  14. fi
  15. ##########################################################################
  16. ##########################################################################
  17. #
  18. # Script specific global variables
  19. #
  20. ##########################################################################
  21. ##########################################################################
  22. PROG_NAME="$0"
  23. LOG_DIR="/project/dt/admin/mkid"
  24. LOG_FILE="cdeID"
  25. LOG_PATH=""
  26. DO_X_BUILD="False"
  27. DO_MOTIF_BUILD="False"
  28. DO_CDE_BUILD="False"
  29. DO_CDEDOC_BUILD="False"
  30. DO_CDETEST_BUILD="False"
  31. DO_DEBUG="False"
  32. ##########################################################################
  33. usage ()
  34. {
  35. cat <<eof
  36. USAGE: $1
  37. [-e | -dev] # Default: build x11, motif and cde
  38. [-x | -x11] # Build x11 only
  39. [-m | -motif] # Build motif only
  40. [-c | -cde] # Build cde only
  41. [-t | -cdetest] # Build cde tests only
  42. [-a | -all] # Build x11, motif, cde, cdedoc and cdetest
  43. [-debug] # Debugging output
  44. [{-ld | -log_dir} <dirpath>]
  45. # Specify an alternate log directory.
  46. # Default: $LOG_DIR
  47. [{-lf | -log_file} <filename>]
  48. # Specify an alternate log file relative to $LOG_DIR.
  49. # Default: $LOG_FILE
  50. [{-lp | -log_path} <path>]
  51. # Specify an alternate log directory.
  52. # Default: $LOG_DIR/$LOG_FILE
  53. [-h | -? | -help] # Print usage and exit
  54. eof
  55. }
  56. ##########################################################################
  57. while [ $# -gt 0 ]; do
  58. case $1 in
  59. -e | -dev) DO_X_BUILD="True"
  60. DO_MOTIF_BUILD="True"
  61. DO_CDE_BUILD="True"
  62. shift 1 ;;
  63. -x | -x11) DO_X_BUILD="True"
  64. shift 1 ;;
  65. -m | -motif) DO_MOTIF_BUILD="True"
  66. shift 1 ;;
  67. -c | -cde) DO_CDE_BUILD="True"
  68. shift 1 ;;
  69. -t | -cdetest) DO_CDETEST_BUILD="True";
  70. shift 1 ;;
  71. -a | -all) DO_X_BUILD="True"
  72. DO_MOTIF_BUILD="True"
  73. DO_CDE_BUILD="True"
  74. DO_CDEDOC_BUILD="True"
  75. DO_CDETEST_BUILD="True"
  76. shift 1 ;;
  77. -debug) DO_DEBUG="True"
  78. shift 1 ;;
  79. -ld | -log_dir) LOG_DIR=$2; shift 2 ;;
  80. -lf | -log_file) LOG_FILE=$2; shift 2 ;;
  81. -lp | -log_path) LOG_PATH=$2; shift 2 ;;
  82. -h | "-?" | -help | *) usage $PROG_NAME;
  83. exit 1;
  84. esac
  85. done
  86. ##########################################################################
  87. #
  88. # Script setup: Do this after the command line parsing to pick up
  89. # an alternate setting of SCRIPTS_DIR
  90. #
  91. if [ ! -f $SCRIPTS_DIR/script_setup.ksh ]; then
  92. print -u2 "$PRG: File '$SCRIPTS_DIR/script_setup.ksh' NOT found!"
  93. print -u2 "$PRG: Exiting ..."
  94. exit 1
  95. fi
  96. . $SCRIPTS_DIR/script_setup.ksh
  97. ##########################################################################
  98. #
  99. # If no project was selected, then build the 'dev' projects
  100. #
  101. PROJECTS=""
  102. if [ "True" = $DO_X_BUILD ]; then
  103. PROJECTS="$PROJECTS $X_TOP"
  104. fi
  105. if [ "True" = $DO_MOTIF_BUILD ]; then
  106. PROJECTS="$PROJECTS $MOTIF_TOP"
  107. fi
  108. if [ "True" = $DO_CDE_BUILD ]; then
  109. PROJECTS="$PROJECTS $CDE_TOP"
  110. fi
  111. if [ "True" = $DO_CDETEST_BUILD ]; then
  112. PROJECTS="$PROJECTS $CDETEST_TOP"
  113. fi
  114. if [ -z "$PROJECTS" ]; then
  115. PROJECTS="$X_TOP $MOTIF_TOP $CDE_TOP"
  116. fi
  117. ##########################################################################
  118. #
  119. # Set the log path
  120. #
  121. if [ -z "$LOG_PATH" ]; then
  122. LOG_PATH=$LOG_DIR/$LOG_PATH
  123. fi
  124. /usr/local/bin/mkid -o$LOG_PATH $PROJECTS
  125. #
  126. # Clean up temporary files and exit
  127. #
  128. do_exit 0