sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[SM-Commit] GIT changes to master sorcery by Andrew Stitt (6070b69cee418045efb2938e5d7ddad54c8a1867)
- From: Andrew Stitt <scm AT mail.sourcemage.org>
- To: sm-commit AT lists.ibiblio.org
- Subject: [SM-Commit] GIT changes to master sorcery by Andrew Stitt (6070b69cee418045efb2938e5d7ddad54c8a1867)
- Date: Sun, 3 Dec 2006 01:31:22 -0600
GIT changes to master sorcery by Andrew Stitt <astitt AT sourcemage.org>:
ChangeLog | 3 +++
var/lib/sorcery/modules/libsorcery | 29 ++++++++++-------------------
2 files changed, 13 insertions(+), 19 deletions(-)
New commits:
commit 6070b69cee418045efb2938e5d7ddad54c8a1867
Author: Andrew Stitt <astitt AT sourcemage.org>
Commit: Andrew Stitt <astitt AT sourcemage.org>
fix filter()
diff --git a/ChangeLog b/ChangeLog
index 869e4de..cb8474d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2006-12-02 Andrew Stitt <astitt AT sourcemage.org>
+ * libsorcery: fix filter() to use a temp file
+
2006-11-30 David Brown <dmlb2000 AT gmail.com>
* libtrack: forgot to run stage root files list through exclude filter
* libtrack: is_castfs_installed quieted all the errors and output
diff --git a/var/lib/sorcery/modules/libsorcery
b/var/lib/sorcery/modules/libsorcery
index b01de55..705eca2 100755
--- a/var/lib/sorcery/modules/libsorcery
+++ b/var/lib/sorcery/modules/libsorcery
@@ -511,25 +511,16 @@ function filter() {
echo -n "${thing/\!/}\|"
done
echo -n /dev/null)
- (
- # Okay to explain the code
- # exec 3> is opening up the 3 file descriptor for this shell and
- # pointing all input to that file descriptor to the stdin of the
- # subshell with grep
- # similarly with exec 4> line
- # the tee line is taking the stdin from this subshell and sending
- # it to the two file descriptors 3 and 4
- # the filter_tmp_file is used so the output going to fds 3 & 4
- # won't over-write each other
-
- # And to explain the reasoning
- # the grep -v command removes both the RID and NOT_RID lists
- touch $TMP_DIR/filter_tmp_file
- exec 3> >(grep -v "$NOT_RID_LIST\|$RID_LIST")
- exec 4> >(grep "$NOT_RID_LIST" > $TMP_DIR/filter_tmp_file)
- tee -a /proc/self/fd/3 1>&4
- cat $TMP_DIR/filter_tmp_file
- )
+
+ local TMP_SSF=$(make_safe_dir)
+ local FILE=$TMP_SSF/ssf
+
+ cat > $FILE
+ {
+ grep -v "$NOT_RID_LIST\|$RID_LIST" $FILE
+ grep "$NOT_RID_LIST" $FILE
+ }
+ rm $FILE 2>/dev/null
else
cat
fi
- [SM-Commit] GIT changes to master sorcery by Andrew Stitt (6070b69cee418045efb2938e5d7ddad54c8a1867), Andrew Stitt, 12/03/2006
Archive powered by MHonArc 2.6.24.