Changed circular dependencies handler to skip only the offended dependencies.

But don't look very stable yet (see comments about alsa-lib and jdk).
Not verified yet it all circular dependencies has been tracked.
This commit is contained in:
Manuel Canales Esparcia 2006-05-24 22:47:56 +00:00
parent 7acf5caa4e
commit 2a3e0f048b
2 changed files with 61 additions and 44 deletions

View file

@ -10,7 +10,7 @@ declare BLFS_XML
declare VERBOSITY=1 declare VERBOSITY=1
# Grab and name the command line options # Grab and name the command line options
optTARGET=$1 optTARGET=$1
optDEPENDENCY=$2 optDEPENDENCY=$2
@ -40,14 +40,14 @@ source func_parser
validate_target() { # ID of target package (as listed in packages file) validate_target() { # ID of target package (as listed in packages file)
#-------------------------# #-------------------------#
: <<inline_doc : <<inline_doc
function: Validate the TARGET parameter. function: Validate the TARGET parameter.
input vars: $1, package/target to validate input vars: $1, package/target to validate
externals: file: packages externals: file: packages
modifies: TARGET modifies: TARGET
returns: nothing returns: nothing
output: nothing output: nothing
on error: exit on error: exit
on success: modifies TARGET on success: modifies TARGET
inline_doc inline_doc
if [[ -z "$1" ]] ; then if [[ -z "$1" ]] ; then
@ -79,7 +79,7 @@ inline_doc
validate_dependency() { # Dependencies level 1(required)/2(1 + recommended)/3(2+ optional) validate_dependency() { # Dependencies level 1(required)/2(1 + recommended)/3(2+ optional)
#-------------------------# #-------------------------#
: <<inline_doc : <<inline_doc
function: Validate the dependency level requested. function: Validate the dependency level requested.
input vars: $1, requested dependency level input vars: $1, requested dependency level
externals: vars: TARGET externals: vars: TARGET
modifies: vars: DEP_LEVEL modifies: vars: DEP_LEVEL
@ -97,35 +97,10 @@ inline_doc
fi fi
case $1 in case $1 in
1 | 2 ) 1 | 2 | 3 )
DEP_LEVEL=$1 DEP_LEVEL=$1
echo -e "\n\tUsing $DEP_LEVEL as dependencies level.\n" echo -e "\n\tUsing $DEP_LEVEL as dependencies level.\n"
;; ;;
# Prevent circular dependencies when level 3
# cracklib-->python-->tk-->X-->linux-pam-->cracklib
# docbook-utils--> Optional dependencies are runtime only
# libxml2-->libxslt-->libxml2
# cyrus-sasl-->openldap-->cyrus-sasl
# alsa-lib-->doxygen-->graphviz-->jdk-->alsa-lib
# unixodbc-->qt-->unixodbc
# cups-->php-->sendmail-->espgs-->cups
# libexif-->graphviz-->php-->libexif
# esound-->aRts-->esound
# gimp-->imagemagick-->gimp
3 )
case $TARGET in
cracklib | docbook-utils | libxml2 | cyrus-sasl | alsa-lib | \
unixodbc | cups | libexif | esound | gimp )
DEP_LEVEL=2
echo -e "\n\t$TARGET have circular dependencies at level $1"
echo -e "\tUsing $DEP_LEVEL as dependencies level.\n"
;;
* )
DEP_LEVEL=$1
echo -e "\n\tUsing $DEP_LEVEL as dependencies level.\n"
;;
esac
;;
* ) * )
DEP_LEVEL=2 DEP_LEVEL=2
echo -e "\n\t$1 is not a valid dependencies level." echo -e "\n\t$1 is not a valid dependencies level."

View file

@ -17,7 +17,7 @@ generate_dependency_tree() { #
PKGXML PKGXML
DEP_LEVEL DEP_LEVEL
func: do_dependencies func: do_dependencies
modifies: vars: PKGXML modifies: vars: PKGXML
BLFS_XML BLFS_XML
returns: nothing returns: nothing
output: files: $TARGET.dep output: files: $TARGET.dep
@ -29,7 +29,7 @@ inline_doc
local ENTRY_START local ENTRY_START
local ENTRY_END local ENTRY_END
#--------------------- #---------------------
# Create the working directory and cd into it # Create the working directory and cd into it
mkdir $TARGET && cd $TARGET mkdir $TARGET && cd $TARGET
@ -111,14 +111,14 @@ do_dependencies() { # Loop to find sub-dependencies :::WARNING::: THIS IS
file: depure.txt file: depure.txt
$TARGET-index.xml.tmp $TARGET-index.xml.tmp
$PKG.dep $PKG.dep
$PKG.inc $PKG.inc
modifies: files modifies: files
returns: nothing returns: nothing
output: file: $PKG-xinc.tmp output: file: $PKG-xinc.tmp
depure.txt depure.txt
$TARGET-index.xml.tmp $TARGET-index.xml.tmp
on error: exit on error: exit
on success: on success:
inline_doc inline_doc
set -e set -e
@ -147,16 +147,16 @@ inline_doc
done done
return return
fi fi
#------------------ #------------------
# Start with a clean $PKG.xinc.tmp file # Start with a clean $PKG.xinc.tmp file
> xincludes/$PKG.xinc.tmp > xincludes/$PKG.xinc.tmp
for DEP in `cat dependencies/$PKG.dep`; do for DEP in `cat dependencies/$PKG.dep`; do
# Special packages (a lot of hacks) # Special packages (a lot of hacks)
case $DEP in case $DEP in
db ) # The proper version of DB is installed in LFS db ) # The proper version of DB is installed in LFS
continue ;; continue ;;
hal-requirements ) # ID value don't have their own XML package file hal-requirements ) # ID value don't have their own XML package file
continue ;; continue ;;
perl-* | tk-perl ) DEP=perl-modules ;; perl-* | tk-perl ) DEP=perl-modules ;;
@ -173,13 +173,52 @@ inline_doc
#------------------ #------------------
echo -e "\tDEP for $PKG is $DEP" >> depure.txt echo -e "\tDEP for $PKG is $DEP" >> depure.txt
# Prevent circular dependencies when level 3
case $DEP in case $DEP in
# Circular dependencies at level 3 python )
cracklib | docbook-utils | libxml2 | cyrus-sasl | alsa-lib | \ # cracklib-->python-->tk-->X-->linux-pam-->cracklib
unixodbc | cups | libexif | esound | gimp ) [[ "$PKG" = "cracklib" ]] && continue
[[ "$DEP_LV" = "3" ]] && DEP_LV=2 ;;
jadetex | perl-* | lynx | Links | w3m )
# Optional dependencies are runtime only
[[ "$PKG" = "docbook-utils" ]] && continue
;;
libxslt )
# libxml2-->libxslt-->libxml2
[[ "$PKG" = "libxml2" ]] && continue
;;
openldap | postgresql | $KBR5 )
# cyrus-sasl-->several-->cyrus-sasl
[[ "$PKG" = "cyrus-sasl" ]] && continue
;;
doxygen )
# alsa-lib-->doxygen-->graphviz-->jdk-->alsa-lib
# Commented out due that it bomb "jdk 3" Why??
#[[ "$PKG" = "alsa-lib" ]] && continue
# libexif-->doxygen-->graphviz-->php-->libexif
[[ "$PKG" = "libexif" ]] && continue
;;
qt )
# unixodbc-->qt-->unixodbc
[[ "$PKG" = "unixodbc" ]] && continue
;;
espgs )
# sendmail-->espgs-->cups-->php-->sendmail
# We should to use $MAIL_SERVER, when it actually work :-/
[[ "$PKG" = "sendmail" ]] && continue
;;
graphviz )
# libexif-->graphviz-->php-->libexif
[[ "$PKG" = "libexif" ]] && continue
;;
aRts )
# esound-->aRts-->esound
[[ "$PKG" = "esound" ]] && continue
;;
gimp )
# imagemagick-->gimp-->imagemagick
[[ "$PKG" = "imagemagick" ]] && continue
;; ;;
* ) DEP_LV=$DEP_LEVEL ;;
esac esac
#------------------ #------------------
@ -203,6 +242,9 @@ inline_doc
# If not already created, create its dependencies list # If not already created, create its dependencies list
if [[ ! -f dependencies/$DEP.dep ]] ; then if [[ ! -f dependencies/$DEP.dep ]] ; then
case $DEP in case $DEP in
alsa-lib ) ;; # Only one optional dependency and is recursive.
# When placed inside the circular dependencies handler
# some packages may bomb. But I don't know yet why
# Meta-packages at dependency level (ugly *.dep files, but work for now) # Meta-packages at dependency level (ugly *.dep files, but work for now)
alsa ) # When dependency "alsa", use all alsa-* packages alsa ) # When dependency "alsa", use all alsa-* packages
echo -e "alsa-oss\nalsa-firmware\nalsa-tools\nalsa-utils\n \ echo -e "alsa-oss\nalsa-firmware\nalsa-tools\nalsa-utils\n \
@ -245,13 +287,13 @@ inline_doc
# #
# If the recursion depth is not too great this is an acceptable methodology for a script language # If the recursion depth is not too great this is an acceptable methodology for a script language
# However, uncontrolled recursion will cause a seg-fault due to stack issues with local variables. # However, uncontrolled recursion will cause a seg-fault due to stack issues with local variables.
# #
set +e set +e
[[ "${VERBOSITY}" > 0 ]] && echo -ne "\nrecursive call: $((++cntr)) ${spaceSTR:0:$cntr} ${RED}$DEP${OFF}" [[ "${VERBOSITY}" > 0 ]] && echo -ne "\nrecursive call: $((++cntr)) ${spaceSTR:0:$cntr} ${RED}$DEP${OFF}"
do_dependencies $DEP do_dependencies $DEP
[[ "${VERBOSITY}" > 0 ]] && echo -ne "\nrecursive ret: $cntr ${spaceSTR:0:$((cntr--))} ${GREEN}$DEP${OFF}\tUsing the new xinclude file for PKG $DEP (to solve $PKG)" [[ "${VERBOSITY}" > 0 ]] && echo -ne "\nrecursive ret: $cntr ${spaceSTR:0:$((cntr--))} ${GREEN}$DEP${OFF}\tUsing the new xinclude file for PKG $DEP (to solve $PKG)"
set -e set -e
# Include it when done # Include it when done
echo -e "\tUsing the new xinclude file for PKG $DEP (to solve $PKG)\n" >> depure.txt echo -e "\tUsing the new xinclude file for PKG $DEP (to solve $PKG)\n" >> depure.txt
IFS=$'\x0A' IFS=$'\x0A'