~sourcemage/sorcery

11b4fd90bf05b4c8158b125d16e7c91d3418c9eb — Paul Mahon 17 years ago ba55e1b
Add default config for new debugging, make new debugging work
M etc/sorcery/config => etc/sorcery/config +5 -1
@@ 57,7 57,8 @@ FORCE_BASESYSTEM_DEPENDS=${FORCE_BASESYSTEM_DEPENDS:-off}
             FILEPROG=${FILEPROG:=file}
           DIALOGPROG=${DIALOGPROG:=dialog}

                DEBUG=${DEBUG:=/dev/null}
        SORCERY_DEBUG=${SORCERY_DEBUG:=/dev/null}
 SORCERY_DEBUG_FILTER=${SORCERY_DEBUG_FILTER:=libhash libapi liblock}

          CROSS_INSTALL=${CROSS_INSTALL:=off}



@@ 186,6 187,9 @@ CASTFS_DEBUG_LEVEL=255
# this makes appending the sorcery path idempotent
[ -z ${PATH##*$SORCERY_PATH*} ] || export PATH="$PATH:$SORCERY_PATH"

# initialize the debugging variables
init_debugging

optimize
umask $UMASK >/dev/null
# this fixes breakage with multiply nested triggers, if/when we dont use

M usr/sbin/sorcery => usr/sbin/sorcery +10 -6
@@ 1502,8 1502,8 @@ sorcery_devel_settings()   {

    D) TEXT="Note: if you turn this on, don't forget to empty the log file occasionaly.\nWhat file do you want the debugging logged to?"
        FILE=`eval $DIALOG --ok-label "Commit" --inputbox \"$TEXT\" 0 0 \"$DEBUG\"` &&
        modify_local_config "DEBUG" "$FILE" ;;
    F) sorcery_debug_filter() ;;
        modify_local_config "SORCERY_DEBUG" "$FILE" ;;
    F) sorcery_debug_filter ;;
    S) TEXT="Note: You don't want to do this probably. Don't forget to 2>/root/debug.out.\nDo you want super debugging on?"
        TOGGLE=`eval $DIALOG --yesno \"$TEXT\" 0 0` &&
        ( modify_local_config "SUPER_DEBUG" "on" ; modify_local_config "set" "-x" "command" ) ||


@@ 1516,7 1516,7 @@ sorcery_devel_settings()   {
}

sorcery_debug_filter() {

set -x
  local i
  local CHECKLIST=`make_debug_checklist`



@@ 1525,13 1525,17 @@ sorcery_debug_filter() {

  if  OUTLIST=`eval $DIALOG '  --title "$DEVEL_TITLE"  \
                        --ok-label  "Commit"   \
                        --separate-output      \
                        --checklist            \
                        "$DEVEL_HELP"          \
                        0 0 0                  \
                        '$CHECKLIST`
  then
    modify_local_config "SORCERY_DEBUG_FILTER" "( $OUTLIST )"
    # The space on the end is there on purpose, so an empty list won't give an
    # empty string, so default values will not be used
    modify_local_config "SORCERY_DEBUG_FILTER" "$OUTLIST "
  fi

set +x
}

make_debug_checklist()  {


@@ 1539,7 1543,7 @@ make_debug_checklist()  {
  array=()

  find $SGL_LIBRARY_MODULES -type f -name 'lib*' -printf %f\\n | sort |
    while read LINE
    while read LINE ; do
      VAR=SORCERY_DEBUG_${LINE}
      echo -en "\"${LINE}\""
      echo -en "\t\"${LINE}\""

M var/lib/sorcery/modules/libcodex => var/lib/sorcery/modules/libcodex +1 -1
@@ 706,7 706,7 @@ function codex_cache_spell_lookup()  {
  local spell="$1"
  shift
  while [ $# -gt 0 ] ; do
    $STD_SORCERY_DEBUG "looking up $spell in ${1}'s cache"
    $STD_SORCERY_DEBUG "looking up $spell in ${1}\\'s cache"
    codex_check_cache $1
    SECTION=`grep -m 1 "^$spell " $1/$SPELL_INDEX_FILE | cut -d' ' -f2`
    [[ $SECTION ]] && echo "$SECTION/$spell" && return

M var/lib/sorcery/modules/libsorcery => var/lib/sorcery/modules/libsorcery +1 -1
@@ 773,7 773,7 @@ function optimize()  {
    set_architecture
    $STD_SORCERY_DEBUG "ARCHITECTURE='${ARCHITECTURE}'"
    $STD_SORCERY_DEBUG "TARGET='${TARGET}'"
    $STD_SORCERY_DEBUG"OPTIMIZATIONS='${OPTIMIZATIONS}'"
    $STD_SORCERY_DEBUG "OPTIMIZATIONS='${OPTIMIZATIONS}'"
    BUILD=${HOST}

    $STD_SORCERY_DEBUG "BUILD is $BUILD, HOST is $HOST"