sm-sorcery AT lists.ibiblio.org
Subject: Discussion of Sorcery related topics
List archive
- From: Paul <dufflebunk AT dufflebunk.homeip.net>
- To: sm-sorcery <sm-sorcery AT lists.ibiblio.org>
- Subject: [SM-Sorcery] Full Ordering
- Date: Tue, 06 Jan 2004 15:11:52 -0500
I've been working on getting the full dependancy tree ordering into
libdepends. It was more difficult than I thought. However, I /think/ I
have it done... but it needs extensive testing and I'll be away for
several days. I have two patches, one to cast, the other to libdepends.
I'm not sure if they were constructed properly, but I think they should
work although you'll probably get hunk offset warnings.
I've done light testing, it seems to not make anything explode, but
please backup your state packages and depends files before testing thses
just in case.
I imagine there are bugs in it since I haven't found many yet. Let me
know if you find one or notice anything odd.
--
De mortuis nihil nisi bonum.
1121,1122c1154,1155 < < compute_depends "SPELL_RULES" $SPELLS --- > #set -x > time compute_depends "to_cast" "already_cast" "bad_cast" $SPELLS 1125c1158,1160 < echo "$SPELL_RULES" | depends_to_Makefile $numRules $SPELLS > $MAKEFILE --- > depends_to_Makefile to_cast already_cast > $MAKEFILE > SPELLS=$(hash_get_table_fields "to_cast") > # echo "$SPELL_RULES" | depends_to_Makefile $numRules $SPELLS > $MAKEFILE 1135c1170 < SPELLS=`sed -n 's/^\([^:]*\):.*$/\1/p' $MAKEFILE | grep -v "^all$" | grep -v "^.PHONY$"` --- > # SPELLS=`sed -n 's/^\([^:]*\):.*$/\1/p' $MAKEFILE | grep -v "^all$" | grep -v "^.PHONY$"` 1138a1174,1175 > less $MAKEFILE > 1144,1148c1181,1184 < local spell all_spells="" < local tmp_list i < local LINE="" < local args < tmp_list="" --- > > for i in $( { hash_get_table_fields $1 ; hash_get_table_fields $2; } | sort | uniq -d ); do > hash_unset "$2" "$i" > done 1151,1158c1187,1191 < < while read LINE ; do < < [[ $LINE ]] || continue #Remove blank lines < spell=${LINE%%:*} < all_spells="$all_spells $spell" < echo "$LINE" < echo -e "\t@$0 $args $spell" --- > > # Spells that are actualy going to be cast > for i in $( hash_get_table_fields $1 ) ; do > echo "$i : $(hash_get "$1" "$i")" > echo -e "\t@$0 $args $i" 1160,1164d1192 < < for (( i=1 ; i <= $# ; i++ )) ; do < [[ ${!i} == $spell ]] && tmp_list="$tmp_list $spell" < done < 1167c1195,1202 < echo "all: $tmp_list" --- > #Spells that are already cast > #NOTE: For recursive recompile cast, make this loop like loop above > for i in $( hash_get_table_fields $2 ) ; do > echo "$i : $(hash_get "$1" "$i")" > echo > done > local all_spells=$({ hash_get_table_fields $1 ; hash_get_table_fields $2; } | tr '[:cntrl:]' ' ') > echo "all : $all_spells" 1168a1204 > echo ".PHONEY : all $all_spells" 1170,1174d1205 < # All targets are PHONY < # See http://bugs.sourcemage.org/show_bug.cgi?id=2674 for details < echo ".PHONY: all $all_spells" < echo <
34a35,41 > # CAST_HASH: The name of the hast table to put spells and dependancies > # that are to be cast (only used in this lib) > # DO_NOT_CAST_HASH: The name of the hash table to put spells and dependancies > # that are not to be cast, but may still be needed (only used in this lib) > # CANNOT_CAST: The name of the hash table to put spells that cannot be cast > # and the reason why. Usualy because they are exiled or don't exist > # (only used in this lib) 206c210,211 < # $1=var to place spells in, $* = root spells --- > # $1=table to place spells in, $2=table to put non-casting spells in > # $3=table to put problem spells in, $* = root spells 209,210c214,217 < local outVar="$1" < shift --- > local CAST_HASH="$1" > local DO_NOT_CAST_HASH="$2" > local CANNOT_CAST_HASH="$3" > shift 3 212a220,225 > echo -n "Creating tree of already cast spells..." > private_compute_installed_depends $DO_NOT_CAST_HASH > echo " done" > > [[ $COMPILE ]] && PRETEND_NOT_INSTALLED="$BASE_SPELLS" > 229,232c242,245 < for SPELL in ${SPELLS[*]} ; do < debug "libdepends" "Appending info for $SPELL." < eval "$outVar=\"${!outVar}${SPELL}: "`hash_get "libdepends" "$SPELL"`$'\n'\" < done --- > # for SPELL in ${SPELLS[*]} ; do > # debug "libdepends" "Appending info for $SPELL." > # eval "$outVar=\"${!outVar}${SPELL}: "`hash_get "libdepends" "$SPELL"`$'\n'\" > # done 357c370,371 < if spell_exiled $1 ; then --- > if spell_exiled $1 ; then > hash_put $CANNOT_CAST_HASH "$1" "Exiled" 374a389 > hash_put $CANNOT_CAST_HASH "$1" "Exiled" 472c487 < if [[ $2 == on ]] && private_should_cast $1 ; then --- > # if [[ $2 == on ]] && private_should_cast $1 ; then 474c489 < fi --- > # fi 501,505c516,525 < run_prepare && < run_details && < run_configure && < run_depends $1 && < private_add_depends --- > #We only need to run the stuff if we are going to be casting. > #It only needs to be added to the casting hash table if we are really casting it > if private_should_cast $SPELL ; then > run_prepare && > run_details && > run_configure && > run_depends $1 && > private_add_depends || return 1 > fi > return 0 514c534 < hash_put "libdepends" "$SPELL" "${NEW_DEPENDS[*]}" --- > hash_put "$CAST_HASH" "$SPELL" "${NEW_DEPENDS[*]}" 530c550 < is_member "$1" `hash_get "libdepends" "${SPELLS[$i]}"` && echo $i --- > is_member "$1" `hash_get "$CAST_HASH" "${SPELLS[$i]}"` && echo $i 540c560 < hash_unset "libdepends" "${SPELLS[spell]}" --- > hash_unset "$CAST_HASH" "${SPELLS[spell]}" 557a578,596 > function private_compute_installed_depends() > { #$1==hash table to fill > > # Create hashtable for all installed or held spells > # We must have all installed spells in the table > # including ones with no deps, as they are still valid targets > eval $(awk -F : '$3=="installed" || $3=="held"{ > printf("hash_put \"'$1'\" \"%s\" \" \";\n",$1); > }' $SPELL_STATUS ) > > # Fill in hashtable for spells that have dependancies > eval $(awk -F : '$3=="on"{ spells[$1]=spells[$1]" "$2" "; } > END{ > for(spell in spells) { > printf("hash_put \"'$1'\" \"%s\" \" %s \";\n", spell, spell, spells[spell]); > } > }' < $DEPENDS_STATUS ) > > }
Attachment:
signature.asc
Description: This is a digitally signed message part
-
[SM-Sorcery] Full Ordering,
Paul, 01/06/2004
-
Re: [SM-Sorcery] Full Ordering,
Arwed von Merkatz, 01/08/2004
-
Re: [SM-Sorcery] Full Ordering,
Paul, 01/10/2004
-
Re: [SM-Sorcery] Full Ordering,
Arwed von Merkatz, 01/10/2004
-
Re: [SM-Sorcery] Full Ordering,
Arwed von Merkatz, 01/10/2004
- Re: [SM-Sorcery] Full Ordering, Seth Alan Woolley, 01/10/2004
-
Re: [SM-Sorcery] Full Ordering,
Paul, 01/10/2004
-
Re: [SM-Sorcery] Full Ordering,
Paul, 01/10/2004
- Re: [SM-Sorcery] Full Ordering, Arwed von Merkatz, 01/11/2004
-
Re: [SM-Sorcery] Full Ordering,
Paul, 01/10/2004
-
Re: [SM-Sorcery] Full Ordering,
Arwed von Merkatz, 01/10/2004
-
Re: [SM-Sorcery] Full Ordering,
Arwed von Merkatz, 01/10/2004
-
Re: [SM-Sorcery] Full Ordering,
Paul, 01/10/2004
-
Re: [SM-Sorcery] Full Ordering,
Jason Flatt, 01/10/2004
- Re: [SM-Sorcery] Full Ordering, Paul, 01/10/2004
-
Re: [SM-Sorcery] Full Ordering,
Arwed von Merkatz, 01/08/2004
Archive powered by MHonArc 2.6.24.