source: common/libs/func_blfs_deps@ dfa51ee

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

Making the new blfs-tool-deps download code generic enought to can be used also on custom-tools and user inserted scripts.

  • Property mode set to 100644
File size: 3.1 KB
Line 
1#!/bin/bash
2
3# $Id$
4
5
6#----------------------------------#
7blfs_tool_clean_scripts() { # Remove unselected dependencies scripts
8#----------------------------------#
9
10 for file in ${PROGNAME}-commands/blfs-tool-deps/* ; do
11 # Keep the script file name
12 this_script=`basename $file`
13
14 case "${this_script}" in
15 *libxml2 ) [[ "${DEP_LIBXML}" = "n" ]] && rm ${file} ;;
16 *libxslt ) [[ "${DEP_LIBXSLT}" = "n" ]] && rm ${file} ;;
17 *tidy ) [[ "${DEP_TIDY}" = "n" ]] && rm ${file} ;;
18 *unzip ) [[ "${DEP_UNZIP}" = "n" ]] && rm ${file} ;;
19 *docbook-xml ) [[ "${DEP_DBXML}" = "n" ]] && rm ${file} ;;
20 *docbook-xsl ) [[ "${DEP_DBXSL}" = "n" ]] && rm ${file} ;;
21 *gpm ) [[ "${DEP_GPM}" = "n" ]] && rm ${file} ;;
22 *lynx ) [[ "${DEP_LYNX}" = "n" ]] && rm ${file} ;;
23 *sudo ) [[ "${DEP_SUDO}" = "n" ]] && rm ${file} ;;
24 *wget ) [[ "${DEP_WGET}" = "n" ]] && rm ${file} ;;
25 *subversion ) [[ "${DEP_SVN}" = "n" ]] && rm ${file} ;;
26 esac
27 done
28}
29
30
31#----------------------------------#
32wrt_blfs_tool_targets() { #
33#----------------------------------#
34 PREV=""
35
36 echo "${tab_}${GREEN}Processing... ${L_arrow}BLFS_TOOL ${R_arrow}"
37
38 for file in blfs-tool-deps/* ; do
39 # Keep the script file name
40 this_script=`basename $file`
41
42 # Grab the phase name to be used with INSTALL_LOG and tracking dir touch
43 name=`grep "^PKG_PHASE=" ${file} | sed -e 's@PKG_PHASE=@@'`
44 # Grab also the package version
45 pkg_ver=`grep "^VERSION=" ${file} | sed -e 's@VERSION=@@'`
46
47 # Append each name of the script files to a list (this will become
48 # the names of the targets in the Makefile)
49 blfs_tool="$blfs_tool ${this_script}"
50
51 #--------------------------------------------------------------------#
52 # >>>>>>>> START BUILDING A Makefile ENTRY <<<<<<<< #
53 #--------------------------------------------------------------------#
54 #
55 # Drop in the name of the target on a new line, and the previous target
56 # as a dependency. Also call the echo_message function.
57 wrt_target "${this_script}" "$PREV"
58
59 # Touch timestamp file if installed files logs will be created.
60 if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
61 wrt_TouchTimestamp
62 fi
63
64 # Run the script.
65 wrt_RunScript "$file"
66
67 # Write installed files log
68 if [ "$name" != "" ] && [ "${INSTALL_LOG}" = "y" ] ; then
69 wrt_LogNewFiles "$name"
70 fi
71
72 # Touch the tracking file.
73 if [ "$PROGNAME" = "clfs2" ]; then
74 echo -e "\t@touch \$(MOUNT_PT)$TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
75 else
76 echo -e "\t@touch $TRACKING_DIR/${name}-${pkg_ver}" >> $MKFILE.tmp
77 fi
78
79 # Include a touch of the target name so make can check
80 # if it's already been made.
81 wrt_touch
82 #
83 #--------------------------------------------------------------------#
84 # >>>>>>>> END OF Makefile ENTRY <<<<<<<< #
85 #--------------------------------------------------------------------#
86
87 # Keep the script file name for Makefile dependencies.
88 PREV=${this_script}
89 done
90}
Note: See TracBrowser for help on using the repository browser.