mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-06 06:59:54 -05:00
this will likely fix the problem with partial replication
This commit is contained in:
parent
8547e09c6e
commit
f051181042
4 changed files with 17 additions and 9 deletions
|
|
@ -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"
|
||||
|
|
|
|||
5
tests/scripts/stripattr.sh
Executable file
5
tests/scripts/stripattr.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Strip attribute from LDIF
|
||||
#
|
||||
awk '/^'$1'/ {getline; while (substr($0,1,1) == " ") getline;} /.*/ {print $0}'
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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}'
|
||||
|
|
|
|||
Loading…
Reference in a new issue