source: common/libs/func_custom_pkgs@ e2dfa2c

experimental
Last change on this file since e2dfa2c was dfa51ee, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Updated CUSTOM_TOOLS code

  • Property mode set to 100644
File size: 2.1 KB
Line 
1#!/bin/bash
2
3# $Id$
4
5#----------------------------------#
6wrt_CustomTools_target() { # Add any users supplied scripts
7#----------------------------------#
8 PREV=""
9
10 echo "${tab_}${GREEN}Processing... ${L_arrow}CUSTOM_TOOLS ${R_arrow}"
11
12 for file in custom-tools/* ; do
13 # Keep the script file name
14 this_script=`basename $file`
15
16 # Grab the phase name to be used with INSTALL_LOG and tracking dir touch
17 name=`grep "^PKG_PHASE=" ${file} | sed -e 's@PKG_PHASE=@@'`
18 # Grab also the package version
19 pkg_ver=`grep "^VERSION=" ${file} | sed -e 's@VERSION=@@'`
20
21 # Append each name of the script files to a list (this will become
22 # the names of the targets in the Makefile)
23 custom_list="$custom_list ${this_script}"
24
25 #--------------------------------------------------------------------#
26 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
27 #--------------------------------------------------------------------#
28 #
29 # Drop in the name of the target on a new line, and the previous target
30 # as a dependency. Also call the echo_message function.
31 wrt_target "${this_script}" "$PREV"
32
33 # Touch timestamp file if installed files logs will be created.
34 if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
35 wrt_TouchTimestamp
36 fi
37
38 # Run the script.
39 wrt_RunScript "$file"
40
41 # Write installed files log
42 if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
43 wrt_LogNewFiles "$name"
44 fi
45
46 # Touch the tracking file.
47 if [ "$PROGNAME" = "clfs2" ]; then
48 echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
49 else
50 echo -e "\t@touch $TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
51 fi
52
53 # Include a touch of the target name so make can check
54 # if it's already been made.
55 wrt_touch
56 #
57 #--------------------------------------------------------------------#
58 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
59 #--------------------------------------------------------------------#
60
61 # Keep the script file name for Makefile dependencies.
62 PREV=${this_script}
63 done
64}
Note: See TracBrowser for help on using the repository browser.