diff --git a/BLFS/gen-makefile.sh b/BLFS/gen-makefile.sh index b637b39..ee81d6a 100755 --- a/BLFS/gen-makefile.sh +++ b/BLFS/gen-makefile.sh @@ -4,15 +4,11 @@ # set -e -# Uncomment this when reasy to be used -#source ../configuration - # TEMPORARY VARIABLES.. development use only declare MKFILE=Makefile declare PREV_PACKAGE="" declare BUILD_SCRIPTS=scripts -# Remove this when we can use configuration -declare TRACKING_DIR=/var/lib/jhalfs/BLFS +declare TRACKING_DIR=tracking-dir HEADER="# This file is automatically generated by jhalfs # YOU MAY NEED TO EDIT THIS FILE MANUALLY diff --git a/BLFS/gen_config.sh b/BLFS/gen_config.sh index e35610e..529c74a 100755 --- a/BLFS/gen_config.sh +++ b/BLFS/gen_config.sh @@ -6,12 +6,11 @@ export outFile=aConfig.in # file for reading and writing to. export inFile=packages # file for reading and writing to. -declare TRACKING_DIR=tracking-dir - declare PKG_NAME declare PKG_XML_FILE declare PKG_DIR declare PKG_VER +declare INST_VER declare SAVE_IFS=${IFS} declare -a DIR_TREE declare PREV_DIR1="none" @@ -42,15 +41,18 @@ do PKG_XML_FILE=$(basename $2) PKG_DIR=$(dirname $2) PKG_VER=$3 + INST_VER=$4 # These are the META packages. if [ $PKG_DIR = "." ]; then SET_COMMENT=y # Do not include previously installed packages.... - if [ -e $TRACKING_DIR/${PKG_NAME}-${PKG_VER} ]; then continue; fi + if [ -n "${PKG_VER}" ] && [ "x${PKG_VER}" = "x${INST_VER}" ]; then + continue + fi META_PKG=$(echo ${PKG_NAME} | tr [a-z] [A-Z]) echo -e "config CONFIG_$META_PKG" >> $outFile - echo -e "\tbool \"$META_PKG $PKG_VER\"" >> $outFile + echo -e "\tbool \"$META_PKG $PKG_VER $INST_VER\"" >> $outFile echo -e "\tdefault n" >> $outFile echo -e "menu \"$(echo ${PKG_NAME} | tr [a-z] [A-Z]) components\"" >> $outFile @@ -59,11 +61,15 @@ do while [ 0 ]; do read || break 1 PKG_NAME=${REPLY} - PKG_VER=$(grep "^$PKG_NAME[[:space:]]" $inFile | cut -f3) + PKG_VER=$(grep "^${PKG_NAME}[[:space:]]" $inFile | cut -f3) + INST_VER=$(grep "^${PKG_NAME}[[:space:]]" $inFile | cut -f4) + if [ -n "${PKG_VER}" ] && [ "x${PKG_VER}" = "x${INST_VER}" ]; then + continue + fi ( cat << EOF config DEP_${META_PKG}_${PKG_NAME} - bool "$PKG_NAME ${PKG_VER}" + bool "$PKG_NAME ${PKG_VER} ${INST_VER}" default y EOF @@ -83,7 +89,9 @@ EOF # IF this package name-version exists in the tracking dir # do not add this package to the list of installable pkgs. - if [ -e $TRACKING_DIR/${PKG_NAME}-${PKG_VER} ]; then continue; fi + if [ -n "${PKG_VER}" ] && [ "x${PKG_VER}" = "x${INST_VER}" ]; then + continue + fi IFS="/" DIR_TREE=(${PKG_DIR}) @@ -122,7 +130,7 @@ EOF ( cat << EOF config CONFIG_$PKG_NAME - bool "$PKG_NAME ${PKG_VER}" + bool "$PKG_NAME ${PKG_VER} ${INST_VER}" default n EOF ) >> $outFile @@ -235,11 +243,6 @@ config SUDO help Select if sudo will be used (you want build as a normal user) otherwise sudo is not needed (you want build as root) - -config TRACKING_DIR - string - default $TRACKING_DIR - EOF ) >> $outFile echo "done" diff --git a/BLFS/libs/func_dependencies b/BLFS/libs/func_dependencies index e6040dc..9981ce2 100644 --- a/BLFS/libs/func_dependencies +++ b/BLFS/libs/func_dependencies @@ -136,7 +136,6 @@ do_dependencies() { # Loop to find sub-dependencies :::WARNING::: THIS IS $KBR5 $GHOSTSCRIPT $MAILSERVER - $TRACKING_DIR file: depure.txt $TARGET-index.xml.tmp $PKG.dep @@ -154,9 +153,7 @@ inline_doc local PKG=$1 local saveIFS=$IFS local DEP_LV=$DEP_LEVEL - local line line2 DEP pkg_ver - # Remove this when we can use configuration file - local TRACKING_DIR=/var/lib/jhalfs/BLFS + local line line2 DEP pkg_ver inst_ver #------------------ # If a premade xinclude file exists, use it. If not, create one @@ -182,7 +179,9 @@ inline_doc for DEP in `cat dependencies/$PKG.dep`; do # If DEP has been previouly installed, skip it pkg_ver=$(grep "^${DEP}[[:space:]]" ../packages | cut -f3) - [ -e $TRACKING_DIR/${DEP}-$pkg_ver ] && continue + inst_ver=$(grep "^${DEP}[[:space:]]" ../packages | cut -f4) + [ -n "${pkg_ver}" ] && [ "x${pkg_ver}" = "x${inst_ver}" ] && continue + # Special packages (a lot of hacks) case $DEP in diff --git a/blfs b/blfs index 0ecfa11..4674a4a 100755 --- a/blfs +++ b/blfs @@ -126,9 +126,9 @@ rm -rf menu/lxdialog/.svn # Set some harcoded envars to their proper values sed -i 's,blfs-xml,'$BLFS_XML',' update_book.sh libs/book.xsl -sed -i 's,tracking-dir,'$TRACKING_DIR',' update_book.sh gen_config.sh +sed -i 's,tracking-dir,'$TRACKING_DIR',' update_book.sh gen-makefile.sh -# Fetch book sources and create packages and GNOME/KDE dependencies files +# Fetch book sources and create packages and meta-packages dependencies files if [[ -d $BLFS_XML ]] ; then ./update_book.sh else