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
# Grab and name the command line options
optTARGET=$1
optTARGET=$1
optDEPENDENCY=$2
@ -40,14 +40,14 @@ source func_parser
validate_target() { # ID of target package (as listed in packages file)
#-------------------------#
: <<inline_doc
function: Validate the TARGET parameter.
function: Validate the TARGET parameter.
input vars: $1, package/target to validate
externals: file: packages
modifies: TARGET
returns: nothing
output: nothing
on error: exit
on success: modifies TARGET
on success: modifies TARGET
inline_doc
if [[ -z "$1" ]] ; then
@ -79,7 +79,7 @@ inline_doc
validate_dependency() { # Dependencies level 1(required)/2(1 + recommended)/3(2+ optional)
#-------------------------#
: <<inline_doc
function: Validate the dependency level requested.
function: Validate the dependency level requested.
input vars: $1, requested dependency level
externals: vars: TARGET
modifies: vars: DEP_LEVEL
@ -97,35 +97,10 @@ inline_doc
fi
case $1 in
1 | 2 )
1 | 2 | 3 )
DEP_LEVEL=$1
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
echo -e "\n\t$1 is not a valid dependencies level."

View file

@ -17,7 +17,7 @@ generate_dependency_tree() { #
PKGXML
DEP_LEVEL
func: do_dependencies
modifies: vars: PKGXML
modifies: vars: PKGXML
BLFS_XML
returns: nothing
output: files: $TARGET.dep
@ -29,7 +29,7 @@ inline_doc
local ENTRY_START
local ENTRY_END
#---------------------
# Create the working directory and cd into it
mkdir $TARGET && cd $TARGET
@ -111,14 +111,14 @@ do_dependencies() { # Loop to find sub-dependencies :::WARNING::: THIS IS
file: depure.txt
$TARGET-index.xml.tmp
$PKG.dep
$PKG.inc
$PKG.inc
modifies: files
returns: nothing
output: file: $PKG-xinc.tmp
depure.txt
$TARGET-index.xml.tmp
on error: exit
on success:
on success:
inline_doc
set -e
@ -147,16 +147,16 @@ inline_doc
done
return
fi
#------------------
# Start with a clean $PKG.xinc.tmp file
> xincludes/$PKG.xinc.tmp
for DEP in `cat dependencies/$PKG.dep`; do
# Special packages (a lot of hacks)
case $DEP in
db ) # The proper version of DB is installed in LFS
continue ;;
continue ;;
hal-requirements ) # ID value don't have their own XML package file
continue ;;
perl-* | tk-perl ) DEP=perl-modules ;;
@ -173,13 +173,52 @@ inline_doc
#------------------
echo -e "\tDEP for $PKG is $DEP" >> depure.txt
# Prevent circular dependencies when level 3
case $DEP in
# Circular dependencies at level 3
cracklib | docbook-utils | libxml2 | cyrus-sasl | alsa-lib | \
unixodbc | cups | libexif | esound | gimp )
[[ "$DEP_LV" = "3" ]] && DEP_LV=2
python )
# cracklib-->python-->tk-->X-->linux-pam-->cracklib
[[ "$PKG" = "cracklib" ]] && continue
;;
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
#------------------
@ -203,6 +242,9 @@ inline_doc
# If not already created, create its dependencies list
if [[ ! -f dependencies/$DEP.dep ]] ; then
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)
alsa ) # When dependency "alsa", use all alsa-* packages
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
# However, uncontrolled recursion will cause a seg-fault due to stack issues with local variables.
#
#
set +e
[[ "${VERBOSITY}" > 0 ]] && echo -ne "\nrecursive call: $((++cntr)) ${spaceSTR:0:$cntr} ${RED}$DEP${OFF}"
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)"
set -e
# Include it when done
echo -e "\tUsing the new xinclude file for PKG $DEP (to solve $PKG)\n" >> depure.txt
IFS=$'\x0A'