Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Ismael Luceno (34f0c6b31c25cc6b7983412c65342e486364a800)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Ismael Luceno (34f0c6b31c25cc6b7983412c65342e486364a800)
  • Date: Wed, 24 Dec 2014 22:56:16 -0600

GIT changes to master sorcery by Ismael Luceno <ismael AT sourcemage.org>:

var/lib/sorcery/modules/libcodex | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)

New commits:
commit 34f0c6b31c25cc6b7983412c65342e486364a800
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libcodex: Remove eval at codex_create_in_memory_cache

diff --git a/var/lib/sorcery/modules/libcodex
b/var/lib/sorcery/modules/libcodex
index 07e2624..42d3da3 100755
--- a/var/lib/sorcery/modules/libcodex
+++ b/var/lib/sorcery/modules/libcodex
@@ -876,27 +876,32 @@ function codex_create_in_memory_cache() {
fi
local hash=$1
shift
- eval $(
- for each in "$@"; do
- cat $each/$SPELL_INDEX_FILE
- done | awk -v i="$list" -v hash="$hash" '
- { if (!($1 in map)) map[$1] = $2 }
+ while read hash spell dir; do
+ hash_put "$hash" "$spell" "$dir/$spell"
+ done < <(
+ awk -v idx="/$SPELL_INDEX_FILE" -v lst="$list" -v hash="$hash" '
+ BEGIN {
+ for (i in ARGV)
+ ARGV[i] = ARGV[i] idx
+ }
+ !($1 in map) {
+ map[$1] = $2
+ }
function phash(hash, spell) {
- printf("hash_put %s %s \"%s/%s\";\n", hash, spell,
map[spell], spell)
+ print hash, spell, map[spell]
}
END {
- if (i) {
+ if (lst) {
FS=":"
- while (getline < i)
+ while (getline < lst)
if ($3 == "installed" || $3 == "held")
phash(hash, $1)
} else {
for (spell in map)
phash(hash, spell)
}
- }'
- )
-
+ }
+ ' "$@")
}

#---------------------------------------------------------------------



  • [SM-Commit] GIT changes to master sorcery by Ismael Luceno (34f0c6b31c25cc6b7983412c65342e486364a800), Ismael Luceno, 12/24/2014

Archive powered by MHonArc 2.6.24.

Top of Page