Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Submit patch to contrib/ldifdiff.pl

2 views
Skip to first unread message

Anthony Milan

unread,
Apr 21, 2006, 12:27:35 PM4/21/06
to subb...@computer.org, perl...@perl.org
Hi all,

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

moddn.patch

Kartik Subbarao

unread,
Apr 22, 2006, 6:45:02 PM4/22/06
to Anthony Milan, perl...@perl.org
Anthony Milan wrote:
> Hi all,
>
> 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 :
[...]

> I think that's wrong the changetype would be moddn and not modrdn.

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

0 new messages