]> git.sur5r.net Git - openldap/commitdiff
this will likely fix the problem with partial replication
authorPierangelo Masarati <ando@openldap.org>
Wed, 5 Feb 2003 14:42:37 +0000 (14:42 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 5 Feb 2003 14:42:37 +0000 (14:42 +0000)
tests/scripts/defines.sh
tests/scripts/stripattr.sh [new file with mode: 0755]
tests/scripts/test011-subtree-repl
tests/scripts/undiff.sh

index 236952098c497f13b55196ef80afd792d02fb71b..645024ba42e2136611c47dd03bb0518abc8bbaf3 100755 (executable)
@@ -35,6 +35,7 @@ LDIFFILTER=$SRCDIR/scripts/acfilter.sh
 SUBFILTER=$SRCDIR/scripts/subfilter.sh
 UNDIFFFILTER=$SRCDIR/scripts/undiff.sh
 CONFFILTER=$SRCDIR/scripts/conf.sh
+STRIPATTR=$SRCDIR/scripts/stripattr.sh
 
 SLAPADD="../servers/slapd/tools/slapadd $LDAP_VERBOSE"
 SLAPCAT="../servers/slapd/tools/slapcat $LDAP_VERBOSE"
diff --git a/tests/scripts/stripattr.sh b/tests/scripts/stripattr.sh
new file mode 100755 (executable)
index 0000000..5645e02
--- /dev/null
@@ -0,0 +1,5 @@
+#! /bin/sh
+#
+# Strip attribute from LDIF
+#
+awk '/^'$1'/ {getline; while (substr($0,1,1) == " ") getline;} /.*/ {print $0}'
index e26941f0088e939198fba090f83a4d286791af6c..3089ba077910bdd7879af301e8fb5c54f03f6b09 100755 (executable)
@@ -134,6 +134,10 @@ member: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=Univer
 add: member
 member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of Michigan, c=US
 member: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US
+-
+replace: description
+description: A very long description, that is very likely to cause line wrapping in a LDIF file
+-
 
 dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US
 changetype: modify
@@ -224,7 +228,7 @@ SEARCHOUT=$SUBMASTEROUT
 LDIF=$SLAVEOUT
 
 echo "Filtering master ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT | egrep -iv ^description > $SEARCHFLT
+. $LDIFFILTER < $SEARCHOUT | $STRIPATTR "description" > $SEARCHFLT
 echo "Filtering slave ldapsearch results..."
 . $LDIFFILTER < $LDIF > $LDIFFLT
 
@@ -239,14 +243,14 @@ fi
 SEARCHOUT=$MASTEROUT
 
 echo "Filtering remaining data"
-. $LDIFFILTER < $SEARCHOUT | egrep -iv ^description > $SEARCHFLT
+. $LDIFFILTER < $SEARCHOUT | $STRIPATTR "description" > $SEARCHFLT
 
 echo "Stripping slave entries from master output..."
-$CMP $SEARCHFLT $LDIFFLT | $UNDIFFFILTER > $SUBFLT
+$DIFF $SEARCHFLT $LDIFFLT | $UNDIFFFILTER > $SUBFLT
 
 echo "Stripping subtree entries from master output..."
 . $SUBFILTER 'ou=Groups,[ ]?o=University of Michigan,[ ]?c=US' < $SEARCHOUT \
-       | $UNDIFFFILTER | egrep -iv ^description > $SUBFLT2
+       | $STRIPATTR "description" > $SUBFLT2
 
 echo "Comparing master minus subtree and master minus slave..."
 $CMP $SUBFLT $SUBFLT2 > $CMPOUT
index cb9e13caf5c3d6ea838ec6e76046f17503731f48..a4539938d6ba7fc455179571417e4a9b06bb4533 100755 (executable)
@@ -1,8 +1,6 @@
 #! /bin/sh
 #
-# Expunge "< " and "> " resulting from diff
+# Expunge extra stuff resulting from diff -u
+# strip everything, including leading '-', except leading '+' to force errors
 #
-awk '!/^[0-9]/ {print $0}' | \
-       sed "s/^< \|^> \|^- \|^+ //" | \
-       awk '/.+/ {print $0}'
-
+awk '/^-/ {if (substr($0,1,3) != "---") print substr($0,2,length($0))} /^+/ {if (substr($0,1,3) != "+++") print $0}'