Added the ability to create custom scripts that do not reference tarballs.. self contained bash scripts

This commit is contained in:
George Boudreau 2006-10-16 22:59:45 +00:00
parent 53f291f65c
commit e7655b2815
2 changed files with 60 additions and 3 deletions

View file

@ -17,8 +17,9 @@ configuration scripts and a few examples. A switch has been added to the
configuration file which enables/disables the inclusion of personal scripts. configuration file which enables/disables the inclusion of personal scripts.
custom custom
/config <-- where to put your scripts. /config <-- where to put your scripts.
template <-- ALL scripts MUST look like this /examples <-- a few example scripts
template <-- ALL scripts MUST look like this
@ -112,6 +113,8 @@ PKG_FILE="gmp-1.20.1.tar.bz2"
URL="ftp://arcana.linux.it/pub/gpm/gpm-1.20.1.tar.bz2" URL="ftp://arcana.linux.it/pub/gpm/gpm-1.20.1.tar.bz2"
MD5="2c63e827d755527950d9d13fe3d87692" MD5="2c63e827d755527950d9d13fe3d87692"
# MD5SUM is not absolutely necessary but JHALFS whines and complains
# Add the MD5SUM if you can
PATCH1=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-segfault-1.patch" PATCH1=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-segfault-1.patch"
PATCH2=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-silent-1.patch" PATCH2=" http://www.linuxfromscratch.org/patches/blfs/svn/gpm-1.20.1-silent-1.patch"
@ -144,3 +147,27 @@ EOF
xEOFx xEOFx
) > tmp ) > tmp
#--------- CMDS ONLY example -----------
# This is an example of a self contained cmd script
# There are no referenced to a package or package dir.
# This method is useful for creating user files/profiles/etc
# at build time.
PKG=""
PKG_VERSION=""
PKG_FILE=""
URL=""
MD5=""
PATCH1=""
( cat << "xEOFx"
echo "JUST A USELESS TRACE"
xEOFx
) > tmp

View file

@ -37,6 +37,32 @@ xEOFx
THIS_SCRIPT=$(basename ${this_script}) THIS_SCRIPT=$(basename ${this_script})
echo "$tab_${GREEN}Adding${OFF} ${THIS_SCRIPT}" echo "$tab_${GREEN}Adding${OFF} ${THIS_SCRIPT}"
# Create a Makefile entry
if [[ "x${PKG}" = "x" ]]; then
# Create an entry for a self contained cmd script that does not reference a package tarball
( cat << EOF
${THIS_SCRIPT}: ${PREV_SCRIPT}
@\$(call echo_message, Building)
@./progress_bar.sh \$@ \$\$PPID &
@( time { source envars && /\$(SCRIPT_ROOT)/custom-commands/scripts/${THIS_SCRIPT} >>logs/${THIS_SCRIPT} 2>&1 ; } ) 2>>logs/${THIS_SCRIPT}
@touch \$@
@\$(call housekeeping)
EOF
) >> ${MKFILE}.tmp2
# Create the build script file
( cat <<- xEOFx
#!/bin/bash
set -e
`cat tmp`
exit
xEOFx
) > custom-commands/scripts/$THIS_SCRIPT
else
# Create an entry for package
( cat << EOF ( cat << EOF
${THIS_SCRIPT}: ${PREV_SCRIPT} ${THIS_SCRIPT}: ${PREV_SCRIPT}
@ -63,9 +89,10 @@ cd \$PKGDIR
exit exit
xEOFx xEOFx
) > custom-commands/scripts/$THIS_SCRIPT ) > custom-commands/scripts/$THIS_SCRIPT
fi
chmod 755 custom-commands/scripts/$THIS_SCRIPT chmod 755 custom-commands/scripts/$THIS_SCRIPT
rm -f tmp rm -f tmp
PREV_SCRIPT=$THIS_SCRIPT PREV_SCRIPT=$THIS_SCRIPT
CUSTOM_LIST="${CUSTOM_LIST}${THIS_SCRIPT} " CUSTOM_LIST="${CUSTOM_LIST}${THIS_SCRIPT} "
done done
@ -93,6 +120,9 @@ add_CustomToolsURLS() { # Add any users supplied scripts URL informat
break break
fi fi
source $this_script source $this_script
# A cmd only script had no PKG defined
[[ "x${PKG}" = "x" ]] && continue
echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp echo "${URL} ${BLFS_SERVER}${PKG}/${PKG_FILE} ${MD5}" >> urls.lst.tmp
# Add any patches.. # Add any patches..
for PATCH in PATCH{1..10}; do for PATCH in PATCH{1..10}; do