2007-09-19 18:50:48 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# $Id$
|
|
|
|
|
|
|
|
#----------------------------------#
|
|
|
|
wrt_CustomTools_target() { # Add any users supplied scripts
|
|
|
|
#----------------------------------#
|
|
|
|
PREV=""
|
|
|
|
|
2007-09-29 20:57:23 +02:00
|
|
|
echo "${tab_}${GREEN}Processing... ${L_arrow}CUSTOM_TOOLS ${R_arrow}"
|
|
|
|
|
|
|
|
for file in custom-tools/* ; do
|
|
|
|
# Keep the script file name
|
|
|
|
this_script=`basename $file`
|
|
|
|
|
|
|
|
# Grab the phase name to be used with INSTALL_LOG and tracking dir touch
|
|
|
|
name=`grep "^PKG_PHASE=" ${file} | sed -e 's@PKG_PHASE=@@'`
|
|
|
|
# Grab also the package version
|
|
|
|
pkg_ver=`grep "^VERSION=" ${file} | sed -e 's@VERSION=@@'`
|
|
|
|
|
|
|
|
# Append each name of the script files to a list (this will become
|
|
|
|
# the names of the targets in the Makefile)
|
|
|
|
custom_list="$custom_list ${this_script}"
|
|
|
|
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
# >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
#
|
|
|
|
# Drop in the name of the target on a new line, and the previous target
|
|
|
|
# as a dependency. Also call the echo_message function.
|
|
|
|
wrt_target "${this_script}" "$PREV"
|
|
|
|
|
|
|
|
# Touch timestamp file if installed files logs will be created.
|
|
|
|
if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
|
|
|
|
wrt_TouchTimestamp
|
2007-09-19 18:50:48 +02:00
|
|
|
fi
|
|
|
|
|
2007-09-29 20:57:23 +02:00
|
|
|
# Run the script.
|
|
|
|
wrt_RunScript "$file"
|
2007-09-19 18:50:48 +02:00
|
|
|
|
2007-09-29 20:57:23 +02:00
|
|
|
# Write installed files log
|
|
|
|
if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
|
|
|
|
wrt_LogNewFiles "$name"
|
|
|
|
fi
|
2007-09-19 18:50:48 +02:00
|
|
|
|
2007-09-29 20:57:23 +02:00
|
|
|
# Touch the tracking file.
|
|
|
|
if [ "$PROGNAME" = "clfs2" ]; then
|
|
|
|
echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
|
2007-09-19 18:50:48 +02:00
|
|
|
else
|
2007-09-29 20:57:23 +02:00
|
|
|
echo -e "\t@touch $TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
|
2007-09-19 18:50:48 +02:00
|
|
|
fi
|
|
|
|
|
2007-09-29 20:57:23 +02:00
|
|
|
# Include a touch of the target name so make can check
|
|
|
|
# if it's already been made.
|
|
|
|
wrt_touch
|
|
|
|
#
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
# >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
|
|
|
|
#--------------------------------------------------------------------#
|
2007-09-19 18:50:48 +02:00
|
|
|
|
2007-09-29 20:57:23 +02:00
|
|
|
# Keep the script file name for Makefile dependencies.
|
|
|
|
PREV=${this_script}
|
2007-09-19 18:50:48 +02:00
|
|
|
done
|
|
|
|
}
|