Changeset 3e7ceed for common


Ignore:
Timestamp:
12/15/2006 10:53:10 AM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
2.3, 2.3.x, 2.4, ablfs, ablfs-more, legacy, new_features, trunk
Children:
fcb540b
Parents:
830f28d
Message:

Ported CUSTOM_TOOLS support to all books.

Location:
common
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • common/libs/func_blfs_deps

    r830f28d r3e7ceed  
    118118wrt_blfs_tool_targets() {          #
    119119#----------------------------------#
     120  PREV=""
    120121
    121122  echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}"
  • common/libs/func_custom_pkgs

    r830f28d r3e7ceed  
    44
    55#----------------------------------#
    6 add_CustomTools() {                # Add any users supplied scripts
     6wrt_CustomTools_target() {         # Add any users supplied scripts
    77#----------------------------------#
    8   PREV_SCRIPT=""
    9   CUSTOM_LIST=""
     8  PREV=""
    109
    11   echo "Adding custom packages... ${BOLD}START${OFF}"
     10  echo "  Adding custom packages... ${BOLD}START${OFF}"
    1211
    13   cd $JHALFSDIR
    14   > ${MKFILE}.tmp2
     12  # Create the custom_tools scripts directory
     13  mkdir -p custom-tools
    1514
    16   # First some build commands and a placeholder for the build list.
    17   # This will not cause problems if there are no custom scripts.
    18 ( cat << xEOFx
    19 
    20 
    21 mk_CUSTOM_TOOLS:
    22         @\$(call echo_CHROOT_request)
    23         @ sudo mkdir -p ${BUILDDIR}${TRACKING_DIR}
    24         @( sudo \$(CHROOT2) "cd \$(SCRIPT_ROOT) && make CUSTOM_TOOLS")
    25         @touch \$@
    26 
    27 CUSTOM_TOOLS:
    28 xEOFx
    29 ) >> ${MKFILE}.tmp2
    30 
    31 
    32   for this_script in custom-commands/config/*; do
    33     if [[ `basename ${this_script}` = "*" ]]; then
     15  for file in $JHALFSDIR/custom-commands/*; do
     16    if [[ `basename ${file}` = "*" ]]; then
    3417      break
    3518    fi
    36     source $this_script
    37     THIS_SCRIPT=$(basename ${this_script})
    38     echo "$tab_${GREEN}Adding${OFF} ${THIS_SCRIPT}"
     19    source $file
     20    this_script=$(basename ${file})
     21    echo "$tab_${GREEN}Adding${OFF} ${this_script}"
    3922
    4023      # Create a Makefile entry
    4124    if [[ "x${PKG}" = "x" ]]; then
    42     # Create an entry for a self contained cmd script that does not reference a package tarball
    43 ( cat << EOF
    44 
    45 ${THIS_SCRIPT}: ${PREV_SCRIPT}
    46         @\$(call echo_message, Building)
    47         @./progress_bar.sh \$@ \$\$PPID &
    48         @( time { source envars && /\$(SCRIPT_ROOT)/custom-commands/scripts/${THIS_SCRIPT} >>logs/${THIS_SCRIPT} 2>&1 ; } ) 2>>logs/${THIS_SCRIPT}
    49         @touch \$@
    50         @\$(call housekeeping)
    51 EOF
    52 ) >> ${MKFILE}.tmp2
     25    # Create an entry for a self contained cmd script that does not
     26    # reference a package tarball
     27      case $PROGNAME in
     28        clfs2 | clfs3 )
     29          LUSER_wrt_target "${this_script}" "$PREV"
     30          LUSER_wrt_RunAsUser "custom-tools/${this_script}"
     31          ;;
     32        *)
     33          CHROOT_wrt_target "${this_script}" "$PREV"
     34          CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
     35          ;;
     36      esac
     37      wrt_touch
    5338
    5439    # Create the build script file
     
    6045exit
    6146xEOFx
    62 ) > custom-commands/scripts/$THIS_SCRIPT
     47) > custom-tools/${this_script}
    6348
    6449    else
    6550    # Create an entry for package
    66 ( cat << EOF
    67 
    68 ${THIS_SCRIPT}: ${PREV_SCRIPT}
    69         @\$(call echo_message, Building)
    70         @./progress_bar.sh \$@ \$\$PPID &
    71         @\$(call remove_existing_dirs2,${PKG_FILE})
    72         @\$(call unpack2,${PKG_FILE})
    73         @\$(call get_pkg_root2)
    74         @( time { source envars && /\$(SCRIPT_ROOT)/custom-commands/scripts/${THIS_SCRIPT} >>logs/${THIS_SCRIPT} 2>&1 ; } ) 2>>logs/${THIS_SCRIPT}
    75         @\$(call remove_build_dirs2,${PKG})
    76         @touch \$@
    77         @touch ${TRACKING_DIR}/${PKG}-${PKG_VERSION}
    78         @\$(call housekeeping)
    79 EOF
    80 ) >> ${MKFILE}.tmp2
     51      case $PROGNAME in
     52        clfs2 | clfs3 )
     53          LUSER_wrt_target "${this_script}" "$PREV"
     54          LUSER_wrt_unpack "${PKG_FILE}"
     55          LUSER_wrt_RunAsUser "custom-tools/${this_script}"
     56          LUSER_RemoveBuildDirs "${PKG}"
     57          echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${PKG}-${PKG_VERSION}" >>  $MKFILE.tmp
     58          ;;
     59        *)
     60          CHROOT_wrt_target "${this_script}" "$PREV"
     61          CHROOT_Unpack "${PKG_FILE}"
     62          CHROOT_wrt_RunAsRoot "custom-tools/${this_script}"
     63          CHROOT_wrt_RemoveBuildDirs "${PKG}"
     64          echo -e "\t@touch $TRACKING_DIR/${PKG}-${PKG_VERSION}" >>  $MKFILE.tmp
     65          ;;
     66      esac
     67      wrt_touch
    8168
    8269    # Create the build script file
     
    8976exit
    9077xEOFx
    91 ) > custom-commands/scripts/$THIS_SCRIPT
     78) > custom-tools/$this_script
    9279    fi
    9380
    94     chmod 755 custom-commands/scripts/$THIS_SCRIPT
    9581    rm -f tmp
    96     PREV_SCRIPT=$THIS_SCRIPT
    97     CUSTOM_LIST="${CUSTOM_LIST}${THIS_SCRIPT} "
     82    PREV=$this_script
     83    custom_list="${custom_list} ${this_script}"
    9884  done
    9985
    100   # Add the dependancy list.
    101   sed "s|^CUSTOM_TOOLS:|CUSTOM_TOOLS: ${CUSTOM_LIST}|" -i ${MKFILE}.tmp2
    102   cat ${MKFILE}.tmp2 >> ${MKFILE}
    103   rm  ${MKFILE}.tmp2
    104   echo "Adding custom packages... ${BOLD}DONE${OFF}"
     86  # Make the scripts executable.
     87  chmod +x custom-tools/*
     88
     89  echo "  Adding custom packages... ${BOLD}DONE${OFF}"
    10590}
    106 
    10791
    10892
     
    11599
    116100  > urls.lst.tmp
    117   for this_script in $JHALFSDIR/custom-commands/config/*; do
     101  for this_script in $JHALFSDIR/custom-commands/*; do
    118102    if [[ `basename ${this_script}` = "*" ]]; then
    119103      CUSTOM_TOOLS="n"
  • common/libs/func_validate_configs.sh

    r830f28d r3e7ceed  
    2121
    2222  # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
    23   local -r  hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL  GRSECURITY_HOST        TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL         PAGE TIMEZONE LANG LC_ALL LUSER LGROUP BLFS_TOOL             REBUILD_MAKEFILE"
    24   local -r  clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TARGET32   TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL             REBUILD_MAKEFILE"
    25   local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE        ARCH TARGET                                    REPORT                                      STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL             REBUILD_MAKEFILE"
    26   local -r clfs3_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE        ARCH TARGET MIPS_LEVEL                         REPORT                                      STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP                       REBUILD_MAKEFILE"
     23  local -r  hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL  GRSECURITY_HOST        TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL         PAGE TIMEZONE LANG LC_ALL LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
     24  local -r  clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TARGET32   TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
     25  local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE        ARCH TARGET                                    REPORT                                      STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
     26  local -r clfs3_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE        ARCH TARGET MIPS_LEVEL                         REPORT                                      STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP           CUSTOM_TOOLS REBUILD_MAKEFILE"
    2727  local -r   lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE                               TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
    2828  local -r  blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR"
    2929
    30   local -r  blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR DEP_LIBXML DEP_LIBXSLT DEP_TIDY DEP_UNZIP DEP_DBXML DEP_DBXSL DEP_LINKS DEP_SUDO DEP_WGET DEP_SVN DEP_GPM"
     30  local -r blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR DEP_LIBXML DEP_LIBXSLT DEP_TIDY DEP_UNZIP DEP_DBXML DEP_DBXSL DEP_LINKS DEP_SUDO DEP_WGET DEP_SVN DEP_GPM"
    3131  local -r custom_tool_PARAM_LIST="TRACKING_DIR"
    3232
     
    3535  local -r PARAM_VALS='${config_param}${dotSTR:${#config_param}} ${L_arrow}${BOLD}${!config_param}${OFF}${R_arrow}'
    3636
    37   local    PARAM_LIST=
     37  local PARAM_LIST=
    3838  local config_param
    3939  local validation_str
  • common/libs/func_wrt_Makefile

    r830f28d r3e7ceed  
    3838PRT_DU_CR      = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found / \`\n"
    3939
    40 ADD_REPORT     = $REPORT
    41 ADD_BLFS_TOOLS = $BLFS_TOOL
     40ADD_REPORT       = $REPORT
     41ADD_CUSTOM_TOOLS = $CUSTOM_TOOLS
     42ADD_BLFS_TOOLS   = $BLFS_TOOL
    4243
    4344
  • common/makefile-functions

    r830f28d r3e7ceed  
    1919
    2020define echo_PHASE
    21   @clear
    2221  @echo $(BOLD)--------------------------------------------------------------------------------
    2322  @echo  $(tab_)$(tab_)Executing $(BLUE)$(1)$(WHITE) scripts
     
    3433
    3534define echo_SULUSER_request
    36   @clear
    3735  @echo $(BOLD)--------------------------------------------------------------------------------
    3836  @echo $(BOLD)$(BLUE)$@
    3937  @echo $(WHITE)You are going to log into the user account $(BOLD)$(YELLOW)$(LUSER)$(OFF)
    40   @echo su requires a password
     38  @echo sudo requires a password
    4139endef
    4240
    4341define echo_CHROOT_request
    44   @clear
    4542  @echo $(BOLD)--------------------------------------------------------------------------------
    4643  @echo $(BOLD)$(BLUE)$@
Note: See TracChangeset for help on using the changeset viewer.