[SM-Commit] GIT changes to stable-1.13 sorcery by Jaka Kranjc (e8c872227d78528bc1c78653d2d02370b2547b72)

Jaka Kranjc scm at sourcemage.org
Fri Jan 11 15:04:49 EST 2008


GIT changes to stable-1.13 sorcery by Jaka Kranjc <lynxlynxlynx at sourcemage.org>:

 ChangeLog                                     |   56 ++++++++++++++++++++++++++
 build                                         |    9 +++-
 etc/sorcery/mirrors/KDE                       |    6 --
 etc/sorcery/mirrors/SOURCEFORGE               |   13 ++++--
 etc/sorcery/version                           |    2 
 usr/sbin/cast                                 |    5 +-
 usr/sbin/gaze                                 |    4 -
 usr/sbin/scribe                               |    2 
 usr/sbin/sorcery                              |   33 ++++++---------
 var/lib/sorcery/excluded                      |    1 
 var/lib/sorcery/modules/libapi                |   14 ++++++
 var/lib/sorcery/modules/libcodex              |    6 +-
 var/lib/sorcery/modules/libdepends            |   42 +++++++------------
 var/lib/sorcery/modules/libmisc               |   50 +++++++++++++++++------
 var/lib/sorcery/modules/libstate              |   52 ++++++++++++++++++++++++
 var/lib/sorcery/modules/url_handlers/url_http |    2 
 16 files changed, 220 insertions(+), 77 deletions(-)

New commits:
commit e8c872227d78528bc1c78653d2d02370b2547b72
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    1.13.7 Release

commit fd3b08a75ef21aa8af61cc57feedf6b80fb5c196
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    1.13.7 final
    (cherry picked from commit 5bb20990afc09a58f1d9194711bec34ea4ed77b8)

commit dfc83d613adf98921e07a79c0c5f4dc09def4f06
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    changelog entry for the previous "wip" commit
    (cherry picked from commit f85e652b57f105674236d0a8bf2677b04ac3bfac)

commit c4b3798c17f716d9b619f5c6c1e4b9e2eb7e6a12
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    wip: libdepends optimisations for stable
    (cherry picked from commit a7007c512d96434a482ad3a9628d7c6698946042)
    (cherry picked from commit 61345e62d0b761ef6d808b360dc13ed6e838f8d2)

commit 0fd58fc82ea48733fc91a088951d74c83e5e95ad
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    sync build from devel
    (cherry picked from commit 2c73e77d69ae72f336d5f6655ccfad548b62f087)

commit 6d0a038133587a232a095424a893fbaafdbf3169
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    1.13.7-rc4
    (cherry picked from commit 152bdd505d67d18a18ddc0416b2c902bb519e784)

commit 393c9e0cbcd75240f244bdcefebfa070e149a5bc
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    gaze: fixed matching of spell and short during gaze search #9433
    (cherry picked from commit e2babc7cbff219e4125a639df0bc10dcf58da823)
    (cherry picked from commit 9db038d5d1bc469651611ef8c73a1f0bec37eda9)

commit 9420ef7b555ad8fd9ee74b102c5364c65a23e23a
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    scribe: fixed error message when swapping nonexsistant grimoires #13253
    (cherry picked from commit ab8b0b2b7da80679ac7b680e3c28e0b7e19cfd9f)
    (cherry picked from commit 503b9e82a8e697bcac2e986040b78835114f79c8)

commit 8c6d6c0364a8bf5a2f0bcaf866710ccabd2fa2eb
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    mirrors/SOURCEFORGE: updated list from #13504
    (cherry picked from commit 6ef27a5a97736ef6f0082995f7ddabd9d630df47)
    (cherry picked from commit f18cd7c05eeda71faeb17f5644115ce90ce220e5)

commit 9694a38140a40ac9a1b93986a6366d9e49c778c5
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    sorcery: rewrote show_installed_spell and fixed remove_pkgs - removing
          spells from the sorcery menu works again
    (cherry picked from commit 038967ff365b2051aeaf6cd5a68af4cbdce2769b)

commit 88fd17b71ccda92fcb608b8674e6921cca25662c
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    excluded: removed /var/yp - the one spell that uses it, installs config
          files there #11831
    (cherry picked from commit fdbebdeb09cab13b1b7176fc29649df55ce056f8)
    (cherry picked from commit 3eb2dfa3511c4306e80719cf0be71b1d5d280d29)

commit d719335ecb3f22679d79303acdf477691a9b6a3e
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    1.13-rc3
    (cherry picked from commit 1f1c53e9904862af40bc8390b9477f2292322114)

commit 17d865878b61956657f9a6a909a0c6f143a6f97a
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    libdepends: fixed some more quoting regressions since stable. Should
                eliminate some bad provider query defaults
    (cherry picked from commit c6f0ecf9b47dd5a9a54806278d0a6a941522727b)

commit 15aab7b12fa6d1323e935f1f4d59141e41b72c21
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    fixed a regression in private_add_depends, probably fixes #13735
    (cherry picked from commit 1cbddd6dfcbd9e09c8fb36d44e1d1d318a499829)

commit 2f0bd9e346eb3460b4593aeb60166a8d63bb330a
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    fix url_ftp_verify #13001
    (cherry picked from commit 51023db18bee29e590e71e7b4ed16a3aa4a17a28)

commit a35c210b9c280379895138a1e8ebd83592b89b0f
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    moved the load_libcompat call before the sourcing of DETAILS
    in codex_set_current_spell
    (cherry picked from commit b467f5d31c148cbe1af67d426a5b837fdd9a8b6f)

commit 3f8ce094bb53d4146e53019dc697a9e47820a9b0
Author: Andrew Stitt <a at t.armory.com>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    fix bug 9836, allow select_list to show more items like
    select_provider does
    (cherry picked from commit 261977c3eb66948f5911b71816ba0ad9bc348c47)

commit 4d8485eb56b8ebc3ca6fa79f8dfbd255c2680704
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    version++
    (cherry picked from commit ff9f95e3e66b20caacdd9b58d31d319e74de3060)

commit 96c56854e27ef27d05924df5e00545cae881a434
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    fix bug 12949, put is_depends_enabled in test
    (cherry picked from commit 8ed1cbf69dfd530bab9b7027f5009def7226e97b)

commit e528ba052e03e73f544b50de19c9dc6bc7875900
Author: Paul Mahon <pmahon at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    cast: Shorten screen names (fixes bug #12133)
    (cherry picked from c2105553843df19c00cf8bbec35a6204df9c780c commit)
    (cherry picked from commit 0f0bac6e8439c4afadc331214eafeb1d352907a2)

commit d35ba05e4b1b45489d3c1c0cc55663f5c3e7cbd9
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    fix bug 12978, remove dead kde mirrors
    (cherry picked from 97a79fe3d26e7b5433b868139ebd6f8899b08c39 commit)
    (cherry picked from commit b900e719143615267032f4384cb1b01e6107c1f1)

commit 56a8d6ee3b8a18c3bc1e886e49d3bfeca3b69f16
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    fix poland mirror typo
    (cherry picked from 5d64e05fe4b8bf079569f4bae052d1828fc836c5 commit)
    (cherry picked from commit 2b4210f08958a44d966df48b38e2fde1f9d901e2)

commit a176d6510e9d401bdecaa115212e13e3ea2db193
Author: Andrew Stitt <astitt at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    try to fix all the list searching greps. Translate spaces to newlines
    so we can just use grep -x.
    (cherry picked from 8a15f3839f2acbdfde6f6facd864e4f6d1f6590e commit)
    (cherry picked from commit 729660fcdc83c6b8e4eaf579760b395e0e18d971)

commit a6e674948d8385938a5b24578a1914c5a67ef09a
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    version++
    (cherry picked from commit 0f7284539723bf4044a3f2b270fc8b4e48f2ecb9)
    
    Conflicts:
    
    	etc/sorcery/version

commit f575e1eec4d0364d6acfc0dbf22b7b4c9497b5ff
Author: Jaka Kranjc <lynxlynxlynx at sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx at sourcemage.org>

    fix bug 12904
    (cherry picked from ffa3356d87fd8279ac98981c6876018eabda4d51 commit)
    (cherry picked from commit 873436514cd6d95d0f8e49d8a0c2ff17d0eba118)
    
    Conflicts:
    
    	ChangeLog

diff --git a/ChangeLog b/ChangeLog
index 0548a7e..f637ae6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,56 @@
+2008-01-11 Jaka Kranjc <lynxlynxlynx at sourcemage.org>
+	* 1.13.7 Release
+
+2007-11-30 Jaka Kranjc <lynxlynxlynx at sourcemage.org>
+	* libdepends: finally satisfactorily fixed the sorcery rebuild pausing for
+	  hours #13735
+
+2007-11-23 Jaka Kranjc <lynxlynxlynx at sourcemage.org>
+	* sorcery: rewrote show_installed_spell and fixed remove_pkgs - removing
+	  spells from the sorcery menu works again
+	* mirrors/SOURCEFORGE: updated list from #13504
+	* scribe: fixed error message when swapping nonexsistant grimoires #13253
+	* gaze: fixed matching of spell and short during gaze search #9433
+
+2007-11-14 Jaka Kranjc <lynxlynxlynx at sourcemage.org>
+	* excluded: removed /var/yp - the one spell that uses it, installs config
+	  files there #11831
+
+2007-10-30 Jaka Kranjc <lynxlynxlynx at sourcemage.org>
+	* libdepends: fixed some more quoting regressions since stable. Should
+	  eliminate some bad provider query defaults
+
+2007-08-11 Jaka Kranjc <lynxlynxlynx at sourcemage.org>
+	* libcodex: moved the load_libcompat call before the sourcing of DETAILS in
+	  codex_set_current_spell. This way fallbacks can be used there as well,
+	  which will among other things help a bit with #13883
+	* libdepends: fixed a regression in private_add_depends;
+	  probably fixes #13735
+
+2007-08-09 Jaka Kranjc <lynxlynxlynx at sourcemage.org>
+	* url_handlers/url_http: fix url_ftp_verify to not pass a deprecated wget
+	  option. Now it works again. #13001
+
+2006-08-18 Andrew Stitt <astitt at sourcemage.org>
+	* libstate, libapi: add is_depends_enabled, bug 12949
+
+2006-08-13 Paul Mahon <pmahon at sourcemage.org>
+	* cast: shorten screen names (fixes bug #12133)
+
+2006-08-12 Andrew Stitt <astitt at sourcemage.org>
+	* mirrors/KDE: remove dead mirrors, bug 12978
+
+2006-08-06 Andrew Stitt <astitt at sourcemage.org>
+	* mirrors/KDE: fix typo in poland mirror
+
+2006-07-29 Andrew Stitt <astitt at sourcemage.org>
+	* libdepends: integrate fix for bug 12233, spells with regexps
+	  in names do not always become the default provider
+
+2006-07-29 Andrew Stitt <astitt at sourcemage.org>
+	* libstate: fix bug 12904, get_depends_options is broken with
+	  spellnames containing regexp characters. Patch from Jaka Kranjc
+
 2006-07-10 Andrew Stitt <astitt at sourcemage.org>
 	* 1.13.6 Release
 
@@ -295,6 +348,9 @@
 	  in dependency queries, bug 10073
 	* scribbler: fix bug 10056, missing backquote on a message,
 	  patch from Eric Sandall.
+	* libmisc, libdepends: factor out common code from select_list and
+	  select_provider, use a hash instead of an array in select_list to
+	  fix bug 9836.
 
 2005-11-04 Andrew Stitt <astitt at sourcemage.org>
 	* libsummon: dont use leapforward url for tree downloads, bug 10062
diff --git a/build b/build
index ca1024c..f02fc71 100755
--- a/build
+++ b/build
@@ -5,15 +5,22 @@ function build__find_non_volatile() {
 }
 
 branch_dir=$(basename $(pwd))
+if [[ $1 ]] ; then
+  branch_name=$1
+else
+  branch_name=$branch_dir
+fi
+
 if [ -e ../sorcery ]; then
   echo "We need a blank directory beneath the current on to link sorcery -> $branch_dir"
   exit 1
 fi
+[[ $branch_name == devel ]] && date "+%Y%m%d" > etc/sorcery/version
 pushd .. &>/dev/null
 NAMES_TMP=/tmp/sorcery.build.$$
 ln -sf $branch_dir sorcery
 build__find_non_volatile sorcery > $NAMES_TMP
-tar --owner=0 --group=0 -cvjf sorcery-${branch_dir}.tar.bz2 -T $NAMES_TMP
+tar --owner=0 --group=0 -cvjf sorcery-${branch_name}.tar.bz2 -T $NAMES_TMP
 rm $NAMES_TMP
 rm sorcery
 popd .. &>/dev/null
diff --git a/etc/sorcery/mirrors/KDE b/etc/sorcery/mirrors/KDE
index fa99c58..369c297 100755
--- a/etc/sorcery/mirrors/KDE
+++ b/etc/sorcery/mirrors/KDE
@@ -2,14 +2,10 @@
 "Custom Mirror"		Custom
 USA			ftp://download.sourceforge.net/pub/mirrors/kde
 USA			http://download.sourceforge.net/mirrors/kde
-USA			ftp://kde.us.themoes.org/pub/kde
-USA			http://kde.us.themos.org/pub/kde
 USA			ftp://ftp.us.kde.org/pub/kde
 USA			http://ftp.us.kde.org/pub/kde
 USA			ftp://csociety-ftp.ecn.purdue.edu/pub/kde
 USA			http://csociety-ftp.ecn.purdue.edu/pub/kde
-"United Kingdom"	ftp://kde.uk.themoes.org/pub/kde
-"United Kingdom"	http://kde.uk.themoes.org/pub/kde
 "United Kingdom"	ftp://ftp.mirror.ac.uk/sites/ftp.kde.org/pub/kde
 "United Kingdom"	http://ftp.mirror.ac.uk/sites/ftp.kde.org/pub/kde
 Australia		ftp://ftp.au.kde.org/pub/kde
@@ -34,7 +30,7 @@ Germany			http://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.kde.org/pub/kde
 Germany			ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/kde
 Netherlands		ftp://ftp.eu.uu.net/pub/kde
 Poland			ftp://ftp.tuniv.szczecin.pl/pub/kde
-Poland			htp://ftp.tuniv.szczecin.pl/pub/kde
+Poland			http://ftp.tuniv.szczecin.pl/pub/kde
 Poland			ftp://ftp.task.gda.pl/pub/unix/kde
 Poland			http://ftp.task.gda.pl/pub/unix/kde
 Poland			ftp://sunsite.icm.edu.pl/pub/unix/kde
diff --git a/etc/sorcery/mirrors/SOURCEFORGE b/etc/sorcery/mirrors/SOURCEFORGE
index df70f06..b09d662 100755
--- a/etc/sorcery/mirrors/SOURCEFORGE
+++ b/etc/sorcery/mirrors/SOURCEFORGE
@@ -2,10 +2,17 @@
 "Bern (CH) mirror"             http://puzzle.dl.sourceforge.net/sourceforge
 "Dublin (IE) mirror"           http://heanet.dl.sourceforge.net/sourceforge
 "Dusseldorf (DE) mirror"       http://mesh.dl.sourceforge.net/sourceforge
-"Georgia (US) mirror"          http://internap.dl.sourceforge.net/sourceforge
+"California (US) mirror"       http://internap.dl.sourceforge.net/sourceforge
 "Ishikawa (JP) mirror"         http://jaist.dl.sourceforge.net/sourceforge
 "Minnesota (US) mirror"        http://umn.dl.sourceforge.net/sourceforge
-"New York (US) mirror"         http://voxel.dl.sourceforge.net/sourceforge
+"Virginia (US) mirror"         http://superb-east.dl.sourceforge.net/sourceforge
+"Washington (US) mirror"       http://superb-west.dl.sourceforge.net/sourceforge
 "Paris (FR) mirror"            http://ovh.dl.sourceforge.net/sourceforge
-"Reston (US) mirror"           http://aleron.dl.sourceforge.net/sourceforge
+"Arizona (US) mirror"          http://easynews.dl.sourceforge.net/sourceforge
 "Sydney (AU) mirror"           http://optusnet.dl.sourceforge.net/sourceforge
+"Tainan (TW) mirror"           http://nchc.dl.sourceforge.net/sourceforge
+"Brussels (BE) mirror"         http://belnet.dl.sourceforge.net/sourceforge
+"Lausanne (CH) mirror"         http://switch.dl.sourceforge.net/sourceforge
+"Amsterdam (NL) mirror"        http://surfnet.dl.sourceforge.net/sourceforge
+"Kent (UK) mirror"             http://kent.dl.sourceforge.net/sourceforge
+"Curitiba (BR) mirror"         http://ufpr.dl.sourceforge.net/sourceforge
diff --git a/etc/sorcery/version b/etc/sorcery/version
index 2e3a551..b0f139e 100644
--- a/etc/sorcery/version
+++ b/etc/sorcery/version
@@ -1 +1 @@
-1.13.6
+1.13.7
diff --git a/usr/sbin/cast b/usr/sbin/cast
index 9c39ec2..a45ec57 100755
--- a/usr/sbin/cast
+++ b/usr/sbin/cast
@@ -837,8 +837,9 @@ else
   if  [[ $SCREEN == on ]]         && 
       [[ $TERM != screen ]]
   then
-    export SCREEN_NAME="ScreenCast $*"
-    screen_start "ScreenCast $*" "$0" "$@"
+    SCREEN_NAME="ScreenCast $*"
+    export SCREEN_NAME="${SCREEN_NAME:0:64}$(echo $SCREEN_NAME | md5sum)"
+    screen_start "$SCREEN_NAME" "$0" "$@"
     echo "WTF?? We should not get here. screen_start execs!"
     exit 1
   fi
diff --git a/usr/sbin/gaze b/usr/sbin/gaze
index e74426b..57acb21 100755
--- a/usr/sbin/gaze
+++ b/usr/sbin/gaze
@@ -738,8 +738,8 @@ function real_long_search()  {
       pattern=${SEARCH[$i]}
       SEARCH_RESULTS=$(gawk 'BEGIN{ORS = ""; IGNORECASE=1; inLongDesc=0}
         /'"${pattern}"'/{
-          if(/^[[:blank:]]*SPELL/)   {print "(Name Match)";        exit 0;}
-          if(/^[[:blank:]]*SHORT/)   {print "(Short Description)"; exit 0;}
+          if(/^[[:blank:]]*SPELL=.*'"${pattern}"'/)   {print "(Name Match)";        exit 0;}
+          if(/^[[:blank:]]*SHORT=.*'"${pattern}"'/)   {print "(Short Description)"; exit 0;}
           if(inLongDesc) {print "(Description)";       exit 0;}
         }
         /cat[[:blank:]]*<<[[:blank:]]*EOF/{inLongDesc = 1;}
diff --git a/usr/sbin/scribe b/usr/sbin/scribe
index a4c4d46..e22ed82 100755
--- a/usr/sbin/scribe
+++ b/usr/sbin/scribe
@@ -540,7 +540,7 @@ function scribe_swap() {
     return 1
   fi
   if ! codex_find_grimoire $grim2 grimoire2 idx2 ; then
-    message "Grimoire $grim1 not found"
+    message "Grimoire $grim2 not found"
     return 1
   fi
   message -n "swapping "
diff --git a/usr/sbin/sorcery b/usr/sbin/sorcery
index 5121e9c..e02bba9 100755
--- a/usr/sbin/sorcery
+++ b/usr/sbin/sorcery
@@ -308,25 +308,22 @@ file_menu() {
 
 
 show_installed_spells()  {
+  local spell date status version
 
-  for  LINE  in  `sort  $SPELL_STATUS`;  do
+  while read spell date status version; do
+    if  [[  $status  ==  "installed"  ]]  ||
+        [[  $status  ==  "held"       ]];  then
 
-      SPELL=`echo  "$LINE"    |  cut  -d : -f1`
-     STATUS=`echo  "$LINE"    |  cut  -d : -f3`
-    VERSION=`echo  "$LINE"    |  cut  -d : -f4`
-
-    if  [  "$STATUS"  ==  "installed"  ]  ||
-        [  "$STATUS"  ==  "held"       ];  then
-
-      if  codex_set_current_spell_by_name  $SPELL;  then
-        echo -en   '"'${SPELL:="Unknown"}'"'
-        echo -en '\t"'${VERSION:="-"}'"'
-        echo  -e '\t"'${SHORT:="Description Unavailable"}'"'
+      if  codex_set_current_spell_by_name  $spell;  then
+        SHORT=${SHORT:-"Description unavailable"}
+        echo -en   '"'${spell:="Unknown"}'"'
+        echo -en '\t"'${version:="-"}'"'
+        echo  -e '\t"'${SHORT//\"/\'}'"'
       fi
 
     fi
-  done
-
+  done < <(tr : " " < $SPELL_STATUS) | sort
+  codex_clear_current_spell
 }
 
 
@@ -353,13 +350,13 @@ remove_pkgs()	{
     codex_set_current_spell_by_name  $SPELL
     DESCRIPTION=`codex_get_spell_description  $SPELL_DIRECTORY`
 
-    if  $DIALOG  --title      "Remove $SPELL?"  \
+    if  eval $DIALOG  '--title      "Remove $SPELL?"  \
                  --yesno      "$DESCRIPTION"    \
-                 0 0
+                 0 0'
     then
       push_remove_queue  $SPELL                                    &&
-      $DIALOG  --msgbox  "$SPELL added to the remove queue."  0 0  ||
-      $DIALOG  --msgbox  "$SPELL is not really installed?"    0 0
+      eval $DIALOG  '--msgbox  "$SPELL added to the remove queue."  0 0'  ||
+      eval $DIALOG  '--msgbox  "$SPELL is not really installed?"    0 0'
     fi
 
   done
diff --git a/var/lib/sorcery/excluded b/var/lib/sorcery/excluded
index 27eab72..98e5b79 100755
--- a/var/lib/sorcery/excluded
+++ b/var/lib/sorcery/excluded
@@ -43,5 +43,4 @@
 ^/var/state
 ^/var/tmp
 ^/var/www
-^/var/yp
 ^/usr/lib/perl.*/.*/.*-linux-thread-multi/perllocal\.pod
diff --git a/var/lib/sorcery/modules/libapi b/var/lib/sorcery/modules/libapi
index 4b9e903..055d946 100755
--- a/var/lib/sorcery/modules/libapi
+++ b/var/lib/sorcery/modules/libapi
@@ -45,6 +45,7 @@
 #    get_source_nums        (libmisc)
 #    guess_compressor       (libunpack)
 #    handle_changed_config  (libresurrect)
+#    is_depends_enabled     (libstate)
 #    installed_version      (libgrimoire)   
 #    install_config_file    (libresurrect)
 #    invoke_installwatch    (libtrack)
@@ -570,6 +571,19 @@ function handle_changed_config() {
 #---------------------------------------------------------------------
 ## @Type API
 ## @param spell
+## @param dependency
+## @See <@function var.lib.sorcery.modules.libstate.html,is_depends_enabled> for more details.
+## Returns whether or not a given dependency is enabled
+##
+#---------------------------------------------------------------------
+function is_depends_enabled() {
+    debug "libapi" "is_depends_enabled - $*"
+    real_is_depends_enabled "$@"
+}
+
+#---------------------------------------------------------------------
+## @Type API
+## @param spell
 ## @See <@function var.lib.sorcery.modules.libgrimoire.html,real_install_version> for more details.
 ## Returns the current version of the given spell
 ##
diff --git a/var/lib/sorcery/modules/libcodex b/var/lib/sorcery/modules/libcodex
index 0854733..07e7e95 100755
--- a/var/lib/sorcery/modules/libcodex
+++ b/var/lib/sorcery/modules/libcodex
@@ -630,14 +630,14 @@ function codex_set_current_spell()  {
   [[ -x $GRIMOIRE/API_VERSION ]] && . $GRIMOIRE/API_VERSION
   [[ -x $SECTION_DIRECTORY/API_VERSION ]] && . $SECTION_DIRECTORY/API_VERSION
 
+  # load compatibility functions needed for any stage of cast
+  load_libcompat
+
   debug "libcodex" "sourcing DETAILS"
   persistent_load
   .  $SPELL_DIRECTORY/DETAILS 1>/dev/null 2>&1
   persistent_clear
 
-  # load compatibility functions needed for any stage of cast
-  load_libcompat
-
   # set a default build api if there isn't one already
   # this isn't strictly necessary as other code should be able to handle the
   # lack of this variable, but I want to play it safe.
diff --git a/var/lib/sorcery/modules/libdepends b/var/lib/sorcery/modules/libdepends
index 5be17ab..778eaeb 100755
--- a/var/lib/sorcery/modules/libdepends
+++ b/var/lib/sorcery/modules/libdepends
@@ -678,20 +678,20 @@ function work_depends_provider()
   # check if theres an abandoned answer, but only if its still a provider
   if [[ ! $default ]] && [ -e $ABANDONED_DEPENDS/$SPELL ] ; then
     tmp=$(search_depends_status $ABANDONED_DEPENDS/$SPELL "$SPELL" ".*($1)"|awk -F: '{print $2;exit}')
-    [[ $tmp ]] && echo $CANDIDATES|grep -q "\<$tmp\>" && default=$tmp
+    [[ $tmp ]] && echo "$CANDIDATES" | grep -x -q "$tmp" && default=$tmp
   fi
 
   # check if theres a default provider
   if [[ ! $default ]]; then
     explode "$(search_default_provider $DEFAULT_PROVIDERS ".*" "$1")" ":" "status"
     tmp=${status[0]}
-    [[ $tmp ]] && echo $CANDIDATES|grep -q "\<$tmp\>" && default=$tmp
+    [[ $tmp ]] && echo "$CANDIDATES" | grep -x -q "$tmp" && default=$tmp
   fi
 
   # check if we've already answered this question
   if [[ ! $default ]]; then
     for tmp in $CANDIDATES; do
-      echo ${spells[@]} | grep -q "\<$tmp\>" && default=$tmp && break
+      echo " ${spells[@]} " |  grep -q " $tmp " && default=$tmp && break
     done
   fi
 
@@ -771,7 +771,7 @@ function work_optional_depends_provider()
   # check if theres an abandoned answer, but only if its still a provider
   if [[ ! $default ]] && [ -e $ABANDONED_DEPENDS/$SPELL ] ; then
     tmp=$(search_depends_status $ABANDONED_DEPENDS/$SPELL "$SPELL" ".*($1)"|awk -F: '{print $2;exit}')
-    [[ $tmp ]] && echo $CANDIDATES|grep -q "\<$tmp\>" && default=$tmp
+    [[ $tmp ]] && echo "$CANDIDATES"|grep -x -q "$tmp" && default=$tmp
   fi
 
   # check if theres a default provider
@@ -788,7 +788,7 @@ function work_optional_depends_provider()
         # if the user said "on" use the default rather than none
         # unless theres something wrong with the provider they chose 
         # in which case fall back to none
-        [[ $tmp ]] && echo $CANDIDATES|grep -q "\<$tmp\>" &&
+        [[ $tmp ]] && echo "$CANDIDATES" | grep -x -q "$tmp" &&
         default=$tmp || default=none
       else
         default=none
@@ -799,7 +799,7 @@ function work_optional_depends_provider()
   # check if we've already answered this question
   if [[ ! $default ]]; then
     for tmp in $CANDIDATES; do
-      echo ${spells[@]} | grep -q "\<$tmp\>" && default=$tmp && break
+      echo " ${spells[@]} " | grep -q " $tmp " && default=$tmp && break
     done
   fi
 
@@ -892,8 +892,7 @@ function work_optional_depends_spell()
   # check the install queue
   if [[ ! $default ]]; then
     debug "libdepends" "Checking in queue"
-    #\< and \> match the empty string at the start and end of a word
-    echo ${spells[@]} | grep -q "\<$1\>" && default=on
+    echo " ${spells[@]} " | grep -q " $1 " && default=on
   fi
 
   # check if installed/held
@@ -943,7 +942,7 @@ function select_provider()
     shift 3
 
     local each default_char=0 stuff=()
-    local char answer spell
+    local char
 
     # we can only read one character so use every one we can, I dont expect
     # there to be more than 62 providers
@@ -975,22 +974,9 @@ function select_provider()
       let i++
     done
 
-    message -n "\n${QUERY_COLOR}Which one do you want? " \
-               "[$default_char]$DEFAULT_COLOR "
-    read   -t  $PROMPT_DELAY  -n  1 answer 
-    [[ $answer ]] || answer=$default_char
-    spell="$(hash_get CHAR_TO_SPELL $answer)"
-
-    while [[ ! $spell ]] ; do
-      message -n "\n${QUERY_COLOR}Which one do you want? " \
-                 "[$default_char]$DEFAULT_COLOR "
-      read   -t  $PROMPT_DELAY  -n  1 answer 
-      [[ $answer ]] || answer=$default_char
-      spell=$(hash_get CHAR_TO_SPELL $answer)
-    done
-    echo
+    local msg="\n${QUERY_COLOR}Which one do you want? [$default_char]$DEFAULT_COLOR "
+    select_list_sub "$returnvar" CHAR_TO_SPELL "$msg" "$default_char"
     hash_unset CHAR_TO_SPELL
-    eval $returnvar=\"$spell\"
 }
 
 #---------------------------------------------------------------------
@@ -1027,8 +1013,12 @@ function private_up_trigger() {
   # this maps trigerees to triggerers
   # cast_self:perl_module -> perl
   hash_append trg_r_hash  "$TARGET:$ACTION" " $SPELL "
-  echo $NEW_DEPENDS | grep -q "$TARGET" || 
+
+  # afk 6-7-06 Im not sure this line is correct, it seems to only
+  # make a circular depends, instead we want $TARGET to depend on $SPELL
+  echo " ${NEW_DEPENDS[@]} " | grep -q " $TARGET " || 
   NEW_DEPENDS=( ${NEW_DEPENDS[*]} $spell)
+
   triggerees=( ${triggerees[*]} $TARGET )
 }
 
@@ -1148,7 +1138,7 @@ function private_add_depends()
   # force implied basesystem dependency in the depends tree
   if [[ $FORCE_BASESYSTEM_DEPENDS == on ]] &&
      [[ $SPELL != basesystem ]] &&
-     ! echo $base_deps| grep -q $SPELL; then
+     ! echo "$base_deps"|grep -x -q "$SPELL"; then
     hash_append "$CAST_HASH" "$SPELL" "basesystem"
     hash_append "$BACK_CAST_HASH" "basesystem" "$SPELL"
   fi
diff --git a/var/lib/sorcery/modules/libmisc b/var/lib/sorcery/modules/libmisc
index 613cd66..b53d421 100755
--- a/var/lib/sorcery/modules/libmisc
+++ b/var/lib/sorcery/modules/libmisc
@@ -472,7 +472,7 @@ function iterate()
 }
 
 #---------------------------------------------------------------------
-## @param return_var (must not be i, foo, temp, returnvar, or default)
+## @param return_var (must not be i, foo, temp, returnvar, stuff or default)
 ## @param default choice
 ## @param elements, ..
 ## 
@@ -486,26 +486,50 @@ function select_list()
     local foo temp number
     local returnvar=$1
     local default=$2
+    local stuff=()
+
     shift 2
+    hash_unset select_list_hash
+    # see note in select_provider
+    stuff=(0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z)
+    
     let i=0
     for foo in "$@"; do
-        message "\t$DEFAULT_COLOR($i)  $SPELL_COLOR$foo$DEFAULT_COLOR"
-        temp[$i]="$foo"
+        message "\t$DEFAULT_COLOR(${stuff[$i]})  $SPELL_COLOR$foo$DEFAULT_COLOR"
+        hash_put select_list_hash "${stuff[$i]}" "$foo"
         let i++
     done
 
-    message -n "\n${QUERY_COLOR}Which one do you want? [$default]$DEFAULT_COLOR "
-    read   -t  $PROMPT_DELAY  -n  1  number
-    if [[ ! $number ]] ; then number=$default; fi
-    while [[ $number != [0-9]* ]] || (( $number >= $i )) ; do
-        message -n "\n${QUERY_COLOR}Which one do you want? [$default]$DEFAULT_COLOR "
-        read -n 1 number
-        if [[ ! $number ]] ; then number=$default; fi
-    done
+    local msg="\n${QUERY_COLOR}Which one do you want? [$default]$DEFAULT_COLOR "
+    select_list_sub "$returnvar" select_list_hash "$msg" "$default"
+    hash_unset select_list_hash
+}
 
-    echo
+#---------------------------------------------------------------------
+## Common code for select_list and select_provider
+## The user should have already printed out the menu, this handles
+## getting a valid answer from the user.
+## @param name of return value
+## @param name of hash table mapping answers to results
+## @param message to print out for the query
+## @param default answer
+#---------------------------------------------------------------------
+function select_list_sub() {
+  local returnvar=$1
+  local hashname=$2
+  local msgstr=$3
+  local default=$4
 
-    eval $returnvar=\"${temp[$number]}\"
+  local result
+
+  while [[ ! $result ]] ; do
+    message -n "$msgstr"
+    read   -t  $PROMPT_DELAY  -n  1  answer
+    [[ $answer ]] || answer=$default
+    result="$(hash_get $hashname $answer)"
+  done
+  echo
+  eval $returnvar=\"$result\"
 }
 
 #---------------------------------------------------------------------
diff --git a/var/lib/sorcery/modules/libstate b/var/lib/sorcery/modules/libstate
index 2f40b1e..88667b1 100755
--- a/var/lib/sorcery/modules/libstate
+++ b/var/lib/sorcery/modules/libstate
@@ -131,7 +131,38 @@ function search_depends_status()
 
 }
 
+#---------------------------------------------------------------------
+##
+## Search depends status, dont do anything escaping.
+##
+## Arguments can be regexp
+##
+## Prints out the matching line(s)
+## @Stdout the matching line(s)
+## @param depends file
+## @param spell
+## @param depends
+## @param on/off (optional)
+## @param optional/required (optional)
+## @param on arg (optional)
+## @param off arg (optional)
+##
+#---------------------------------------------------------------------
+function search_depends_status_simple()
+{ # $1=depends file $2=spell, $3=depends, $4=on/off, $5=optional/required, $6=on arg, $7=off arg
 
+    local depends_status=$1
+    shift
+
+    local a1 a2 a3 a4 a5 a6
+    a1=`esc_str "$1"` ; a2=`esc_str "$2"`
+    a3=${3:-.*} ; a4=${4:-.*}
+    a5=`esc_str "$5"`; a6=`esc_str "$6"`
+    a5=${5:-.*} ; a6=${6:-.*}
+
+    grep "^$a1:$a2\(([^:]*)\)\?:$a3:$a4:$a5:$a6$" $depends_status
+
+}
 
 #---------------------------------------------------------------------
 ## 
@@ -665,6 +696,27 @@ function get_all_spells_with_status () {
     unlock_file $SPELL_STATUS
 }
 
+#---------------------------------------------------------------------
+## @Type API
+## @param Spell name
+## @param Target spell name
+## @param If empty get the uncommited spell info, if anything else get
+## info from the committed ($DEPENDS_STATUS) database. If the uncommited
+## db doesnt exist (maybe we're not casting) use DEPENDS_STATUS
+##
+## @return 0 if a dependency from $1 on $2 is enabled, 1 otherwise.
+## @stdout the provider name(s)
+#---------------------------------------------------------------------
+function real_is_depends_enabled() {
+  local dep_status
+  if [[ $3 ]] ; then
+    dep_status=$DEPENDS_STATUS
+  else
+    dep_status=$(hash_get uncommitted_hash $1)
+    [[ $dep_status ]] || dep_status=$DEPENDS_STATUS
+  fi
+  [[ -n $(search_depends_status_simple $dep_status "$1" "$2" 'on' ) ]]
+}
 
 #---------------------------------------------------------------------
 ## @param variable
diff --git a/var/lib/sorcery/modules/url_handlers/url_http b/var/lib/sorcery/modules/url_handlers/url_http
index ad99515..617d706 100755
--- a/var/lib/sorcery/modules/url_handlers/url_http
+++ b/var/lib/sorcery/modules/url_handlers/url_http
@@ -89,7 +89,7 @@ function url_ftp_verify() {
   if  [  -n  "$URL"  ];  then
     local  FILENAME=`basename $URL`
     local  DIRECTORY=`dirname $URL`
-    local  OUTPUT=`wget --passive-ftp -t 1 -T 30 -O - --spider -nr "$DIRECTORY/" 2>&1`
+    local  OUTPUT=`wget --passive-ftp -t 1 -T 30 -O - --spider -S "$DIRECTORY/" 2>&1`
 
     if  echo  $OUTPUT  |  grep  -q  "$FILENAME";  then
       rm  -f  .listing



More information about the SM-Commit mailing list