Skip to Content.
Sympa Menu

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

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 (52aee8e4bfc932624c9e9e5b432dbdb1559bb705)
  • Date: Fri, 28 Mar 2008 06:12:57 -0500

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

ChangeLog | 1 +
var/lib/sorcery/modules/libgrimoire | 23 ++++++++++-------------
2 files changed, 11 insertions(+), 13 deletions(-)

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

libgrimoire: real_rm_source_dir: use local variables and a simpler loop
some groundwork for fixing #14100

diff --git a/ChangeLog b/ChangeLog
index e9cf2d4..609e424 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
they can't inherit the bold atribute from the other colors
* api2: added some more messages to cast stages, initial patch from
Sergey
Lipnevich #8521
+ * libgrimoire: real_rm_source_dir: use local variables and a simpler
loop

2008-03-27 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* changed uses of plain sort|uniq to the featurewise equivalent sort
-u
diff --git a/var/lib/sorcery/modules/libgrimoire
b/var/lib/sorcery/modules/libgrimoire
index 968527a..0b0ef5c 100755
--- a/var/lib/sorcery/modules/libgrimoire
+++ b/var/lib/sorcery/modules/libgrimoire
@@ -62,23 +62,20 @@ function real_mk_source_dir() {
#---------------------------------------------------------------------
function real_rm_source_dir() {

- DEAD_DIR=$1
- DEAD_DIR=${DEAD_DIR:-$SOURCE_DIRECTORY}
+ local dead_dir="${1:-$SOURCE_DIRECTORY}"

- debug "libgrimoire" "Running rm_source_dir() on $DEAD_DIR"
+ debug "libgrimoire" "Running rm_source_dir() on $dead_dir"

- if [ -n "$DEAD_DIR" ] && [ -d "$DEAD_DIR" ]; then
+ if [[ -n $dead_dir ]] && [[ -d $dead_dir ]]; then

pushd $BUILD_DIRECTORY 2>&1 > /dev/null

-
# make sure nothing recursive is mounted under deaddir
+ local mount on mountloc rest
mount |
- while read line
+ while read mount on mountloc rest
do
- local mount=$(echo $line | cut -d' ' -f1)
- local mountloc=$(echo $line | cut -d' ' -f3)
- if echo $mountloc | grep -q "^$DEAD_DIR"
+ if echo $mountloc | grep -q "^$dead_dir"
then
debug "libgrimoire" "Unmounting $mount on $mountloc"
umount -l $mountloc 2> /dev/null
@@ -89,10 +86,10 @@ function real_rm_source_dir() {
# we have to. So we move the old dir to a known place before
# running rm. This prevents accidental damage that could be
# caused by
- # a) $DEAD_DIR being an empty string
- # b) $DEAD_DIR being set to "/" (or anything above /usr/src)
- # c) $DEAD_DIR containing metacharacters (like newline)
- mv "$DEAD_DIR" "$INSTALL_ROOT/usr/src/deaddir" &&
+ # a) $dead_dir being an empty string
+ # b) $dead_dir being set to "/" (or anything above /usr/src)
+ # c) $dead_dir containing metacharacters (like newline)
+ mv "$dead_dir" "$INSTALL_ROOT/usr/src/deaddir" &&
rm -rf "$INSTALL_ROOT/usr/src/deaddir" 2> /dev/null

popd 2>&1 > /dev/null



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

Archive powered by MHonArc 2.6.24.

Top of Page