Skip to Content.
Sympa Menu

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

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 (455930f91d624062a4b9c1528458f157bc9862aa)
  • Date: Wed, 26 Mar 2008 07:20:52 -0500

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

ChangeLog | 8 +++++++
var/lib/sorcery/modules/build_api/common | 16 +++++++-------
var/lib/sorcery/modules/libdepends | 34
+++++++++++++++----------------
3 files changed, 33 insertions(+), 25 deletions(-)

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

use real_list_find everywhere else in libdepends

commit e50ae7695a498c621fd1c42c4680c1cb482ea82f
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

use real_list_find in private_run_depends

commit c8fa0d622fd156b54d8b2b815ad3ba4150988747
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

fixed private_upward_depends matching spells too loosely

commit 0e9c23a01b2a26a537e05ae55520df34a1bb689b
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

use real_list_find in work_{,optional_}depends_provider

commit 82f952874587e42e399acf99cbe888d7b039ed07
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

use real_list_find in private_up_trigger

commit b9a9dcedb8e589ab058598d11699a565b31f05ec
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

fixed the check if spell is held in real_sub_depends and improved the msg

commit b2c9a2c03a9b08824fd6f29054ac668c921a4a52
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libdepends: use real_list_find in private_should_cast instead of forking
halves the execution time in the worst/best case

commit 06c8f2e6629408ae58072c5d5b5cb96a63b0b66d
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

common: cleaned up install_pam_confs

diff --git a/ChangeLog b/ChangeLog
index b0f87c6..b14c66f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,14 @@
* libmisc: adjusted formatting in get_dirnames and get_basenames and
made
them use the faster internal smgl_dirname and smgl_basename
respectively
* libdispel, libmisc: fixed the only three callers to use get_dirnames
+ * common: cleaned up install_pam_confs
+ * libdepends: use real_list_find in private_should_cast instead of
forking
+ fixed the check if spell is held in real_sub_depends and improved
the msg
+ use real_list_find in private_up_trigger
+ use real_list_find in work_{,optional_}depends_provider
+ fixed private_upward_depends matching spells too loosely
+ use real_list_find in private_run_depends
+ use real_list_find everywhere else

2008-03-25 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libsorcery: reformatted the files, directories and symlinks
functions and
diff --git a/var/lib/sorcery/modules/build_api/common
b/var/lib/sorcery/modules/build_api/common
index debaac5..72d3d04 100755
--- a/var/lib/sorcery/modules/build_api/common
+++ b/var/lib/sorcery/modules/build_api/common
@@ -204,14 +204,14 @@ function install_pam_confs() {

debug "libgrimoire" "Running install_pam_confs() on $SPELL"

- if [ -d "$SCRIPT_DIRECTORY/pam.d" ]; then
- cd "$SCRIPT_DIRECTORY/pam.d"
-
- mkdir -p $INSTALL_ROOT/etc/pam.d
- local FILE
- for FILE in `ls`; do
- if ! [ -f $INSTALL_ROOT/etc/pam.d/$FILE ]; then
- cp $FILE $INSTALL_ROOT/etc/pam.d
+ if [[ -d $SCRIPT_DIRECTORY/pam.d ]]; then
+ cd "$SCRIPT_DIRECTORY/pam.d"
+
+ mkdir -p "$INSTALL_ROOT/etc/pam.d"
+ local file
+ for file in *; do
+ if ! [[ -f $INSTALL_ROOT/etc/pam.d/$file ]]; then
+ cp "$file" "$INSTALL_ROOT/etc/pam.d"
fi
done

diff --git a/var/lib/sorcery/modules/libdepends
b/var/lib/sorcery/modules/libdepends
index 4524432..83db9c5 100755
--- a/var/lib/sorcery/modules/libdepends
+++ b/var/lib/sorcery/modules/libdepends
@@ -492,7 +492,7 @@ function private_run_depends()
# no point in keeping the file around if its empty...
test -s $spell_depends || rm -f $spell_depends $spell_sub_depends

- if echo "${RUNTIME_DEPENDS[*]}"| tr " " "\n" | grep -x -q "$SPELL" ; then
+ if real_list_find "${RUNTIME_DEPENDS[*]}" "$SPELL"; then
local k=${#BONUS_SPELLS[@]}
BONUS_SPELLS[$k]=$SPELL
fi
@@ -522,7 +522,7 @@ function private_should_cast()
# order is important here...
if ! codex_does_spell_exist $1; then
return 1
- elif echo "$PRETEND_NOT_INSTALLED" | grep -q " $1 " ; then
+ elif real_list_find "$PRETEND_NOT_INSTALLED" $1 ; then
# always look at stuff on the command line unless its exiled
return 0
# from here on the spell was not on the command line...
@@ -532,14 +532,14 @@ function private_should_cast()
elif [[ "$RECAST_DOWN" ]] ; then
# user gave -R so recast...
return 0
- elif echo "${UP_DEPENDS[*]}"| tr " " "\n" | grep -x -q "$1" ; then
+ elif real_list_find "${UP_DEPENDS[*]}" $1; then
# if someone has determined this is an upward depend (-B)
return 0
- elif echo "${TRIGGEREES[*]}"| tr " " "\n" | grep -x -q "$1" ; then
+ elif real_list_find "${TRIGGEREES[*]}" $1; then
# if its being triggered we need to look at it, despite its
# installed status
return 0
- elif echo "${FORCE_DEPENDS[*]}"| tr " " "\n" | grep -x -q "$1" ; then
+ elif real_list_find "${FORCE_DEPENDS[*]}" $1; then
return 0
elif [[ "$(hash_get sub_depends_process $1)" != "" ]] ; then
return 0
@@ -562,7 +562,7 @@ function private_upward_depends() {
# and/or move the weird pattern into library functions...
# (afrayedknot 2005-10-02)
lock_file "$DEPENDS_STATUS"
- tmp=$(grep "^.*:$1\(([^:]*)\)\?" $DEPENDS_STATUS|cut -f1 -d:|tr "\n" " ")
+ tmp=$(grep "^.*:$1\(([^:]*)\)\?:" $DEPENDS_STATUS|cut -f1 -d:|tr "\n" "
")
unlock_file "$DEPENDS_STATUS"
local j k each
let j=${#NEW_UP_DEPENDS[*]}
@@ -932,20 +932,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 -x -q "$tmp" && default=$tmp
+ [[ $tmp ]] && real_list_find "$CANDIDATES" "$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 -x -q "$tmp" && default=$tmp
+ [[ $tmp ]] && real_list_find "$CANDIDATES" "$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
+ real_list_find "${spells[@]}" "$tmp" && default=$tmp && break
done
fi

@@ -1037,7 +1037,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_simple $ABANDONED_DEPENDS/$SPELL "$SPELL"
".*($1)" "on"|awk -F: '{print $2;exit}')
- if [[ $tmp ]] && echo "$CANDIDATES" | grep -x -q "$tmp" ; then
+ if [[ $tmp ]] && real_list_find "$CANDIDATES" "$tmp"; then
default=$tmp
else
tmp=$(search_depends_status_simple $ABANDONED_DEPENDS/$SPELL "$SPELL"
".*($1)" "off")
@@ -1059,7 +1059,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 -x -q "$tmp" &&
+ [[ $tmp ]] && real_list_find "$CANDIDATES" "$tmp" &&
default=$tmp || default=none
else
default=none
@@ -1070,7 +1070,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
+ real_list_find "${spells[@]}" "$tmp" && default=$tmp && break
done
fi

@@ -1176,7 +1176,7 @@ function work_optional_depends_spell()
# check the install queue
if [[ ! $default ]]; then
debug "libdepends" "Checking in queue"
- echo " ${spells[@]} " | grep -q " $1 " && default=on
+ real_list_find "${spells[@]}" "$1" && default=on
fi

# check if installed/held
@@ -1295,7 +1295,7 @@ function private_up_trigger() {

# 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 " ||
+ real_list_find "${NEW_DEPENDS[@]}" "$TARGET" ||
NEW_DEPENDS=( ${NEW_DEPENDS[*]} $spell)

triggerees=( ${triggerees[*]} $TARGET )
@@ -1349,12 +1349,12 @@ function real_sub_depends() {

# if didnt return above, then we know the sub-depends is not on the system
# so the spell must be (re)cast, check to see if we're allowed to do that
- if ! echo "$PRETEND_NOT_INSTALLED" | grep -x -q "$1" &&
+ if ! real_list_find "$PRETEND_NOT_INSTALLED" $sub_dependee &&
spell_held $sub_dependee; then
# spell is held and not explicitly requested, so we cant recast the
# spell with the sub-depends requested
message "${PROBLEM_COLOR}Sub-depends requested on" \
- "a held spell${DEFAULT_COLOR}"
+ "a held spell: $SPELL_COLOR$sub_dependee$DEFAULT_COLOR"
return 1
fi

@@ -1482,7 +1482,7 @@ function private_add_depends()
# force implied basesystem dependency in the depends tree
if [[ $FORCE_BASESYSTEM_DEPENDS == on ]] &&
[[ $SPELL != basesystem ]] &&
- ! echo "$base_deps"|grep -x -q "$SPELL"; then
+ ! real_list_find "$base_deps" "$SPELL"; then
hash_append "$CAST_HASH" "$SPELL" "basesystem"
hash_append "$BACK_CAST_HASH" "basesystem" "$SPELL"
fi



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

Archive powered by MHonArc 2.6.24.

Top of Page