Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (ebdb6e6e72bafda6ae3f063a36ce461638e4f486)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (ebdb6e6e72bafda6ae3f063a36ce461638e4f486)
  • Date: Mon, 31 Mar 2008 10:15:02 -0500

GIT changes to master sorcery by Jaka Kranjc <lynxlynxlynx AT sourcemage.org>:

ChangeLog | 2 ++
var/lib/sorcery/modules/libdepends | 6 ++++--
var/lib/sorcery/modules/libstate | 24 ++++++++++++++++++++++++
3 files changed, 30 insertions(+), 2 deletions(-)

New commits:
commit ebdb6e6e72bafda6ae3f063a36ce461638e4f486
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libstate: added a toggle_depends_status for toggling dependencies on/off
* libdepends: fixed private_recast_optionals. It never worked. #14411

todo: make private_recast_optionals work with providers
and use toggle_depends_status in cleanse

diff --git a/ChangeLog b/ChangeLog
index 10ee174..b2ee7b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,8 @@
escaped. This was broken since esc_str became consistent on
2008-03-26
* libstate: use esc_provider_str for the second argument in the
search_depends_status* functions
+ added a toggle_depends_status for toggling dependencies on/off
+ * libdepends: fixed private_recast_optionals. It never worked. #14411

2008-03-30 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libstate: added a workaround to search_depends_status_exact for
provider
diff --git a/var/lib/sorcery/modules/libdepends
b/var/lib/sorcery/modules/libdepends
index 74b843d..6eef079 100755
--- a/var/lib/sorcery/modules/libdepends
+++ b/var/lib/sorcery/modules/libdepends
@@ -604,9 +604,11 @@ function private_recast_optionals() {
fi
fi
if [[ $enabled ]] ; then
- NEW_UP_DEPENDS[$j]=$each
+ NEW_UP_DEPENDS[$j]=$spell
let j++
- remove_depends_status $DEPENDS_STATUS $each "${1}\(([^:]*)\)\?"
+ # toggle the dependency, so the user doesn't get requeried
+ toggle_depends_status $DEPENDS_STATUS $spell $1
+ spells=( ${spells[*]} $spell )
fi
done
fi
diff --git a/var/lib/sorcery/modules/libstate
b/var/lib/sorcery/modules/libstate
index e05faf6..533e3e3 100755
--- a/var/lib/sorcery/modules/libstate
+++ b/var/lib/sorcery/modules/libstate
@@ -232,6 +232,30 @@ function remove_depends_status()
}

#---------------------------------------------------------------------
+## Toggle optional and suggested dependencies on/off
+##
+## @param depends file
+## @param spell
+## @param dependency
+##
+#---------------------------------------------------------------------
+function toggle_depends_status() {
+ local depends_status=$1
+ shift
+
+ local spell dependency
+ esc_str "$1" spell; esc_str "$2" dependency
+
+ local t_status
+ lock_start_transaction "$depends_status" t_status
+ awk -F ':' -v OFS=':' \
+ '/^'$spell:$dependency'(\([^:]*\))?:(on|off):(optional|suggest):/ \
+ { if ($3 == "on") $3 = "off"; else $3 = "on"; }
+ { print; }' $depends_status > $t_status
+ lock_commit_transaction "$depends_status"
+}
+
+#---------------------------------------------------------------------
## Sets up the uncommitted depends file. If the name isn't
## found in the hash table create it. If the file already exists
## move it to the abandoned depends directory and start with a new one.



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (ebdb6e6e72bafda6ae3f063a36ce461638e4f486), Jaka Kranjc, 03/31/2008

Archive powered by MHonArc 2.6.24.

Top of Page