I have to compare two ldif files and I use the ldifdiff.pl script to do
this. This week, I have this two entries like this :
# new.ldif
dn: cn=Tonio,ou=Washington,dc=company,dc=com
objectclass: inetOrgPerson
cn: Tonio
ou: Washington
sn: Tonio
employeenumber: 888999
# old.ldif
dn: cn=Tony,ou=Los Angeles,dc=company,dc=com
objectclass: inetOrgPerson
cn: Tony
ou: Los Angeles
sn: Tony
employeenumber: 888999
The result of ldifdiff -k employeenumber new.ldif old.ldif was :
dn: cn=Tony,ou=Los Angeles,dc=company,dc=com
changetype: modrdn
newrdn: cn=Tonio
deleteoldrdn: 1
dn: cn=Tonio,ou=Washington,dc=company,dc=com
changetype: modify
replace: ou
ou: Washington
-
replace: sn
sn: Tonio
I think that's wrong the changetype would be moddn and not modrdn.
I propose this patch to do this. The result was :
dn: cn=Tony,ou=Los Angeles,dc=company,dc=com
changetype: moddn
newrdn: cn=Tonio
deleteoldrdn: 1
newsuperior: ou=Washington,dc=company,dc=com
dn: cn=Tonio,ou=Washington,dc=company,dc=com
changetype: modify
replace: ou
ou: Washington
-
replace: sn
sn: Tonio
Hope that helps anyway.
Regards,
--
Anthony Milan
You're right. The script did not have support for moddn.
I have checked in an updated version into the SVN repository. Please try
it out and let me know how it works. Also, I fixed a bug that you
reported back in June 2005 (which I didn't see until relatively
recently) with case-sensitive DN comparisons. Sorry for the long delay
on that!
Regards,
-Kartik