Bug 725542 - Instance upgrade fails when upgrading 389-ds-base package
https://bugzilla.redhat.com/show_bug.cgi?id=725542
Resolves: bug 725542
Bug Description: Instance upgrade fails when upgrading 389-ds-base package
Reviewed by: nhosoi (Thanks!)
Branch: RHEL-6
Fix Description: On 32-bit platforms, the pack 'Q' format specifier is not
available unless perl is explicitly compiled with 64-bit long long support.
Unfortunately, on RHEL/Fedora platforms, it is not. Same with native support
for 64-bit values - fortunately, the bigint package is available, so we use
it.
Additionally, the format flags '>' and '<' for little/big endianness are not
available on perl 5.8 and earlier, so they are not very portable. Finally,
the way we write the 32-bit unique id generator state is simply not usable.
We already skip it if going from 32-bit to 64-bit, so just ignore it if
going from 32-bit to 32-bit. The fix is to unpack the 64-bit integer
values using two 32-bit values, using 'V' first, then 'N' if we think the
value might be big-endian (e.g. sparc). For short values, 'v' or 'n'.
The 64-bit values are stored with the low part first, followed by the high
part. We convert these two 32-bit values to a native 64-bit value to
perform computations with it, then convert it back to two 32-bit values.
Then pack the values using the format for the current platform -
unfortunately we do not use a platform independent way to store the
nsState values.
Platforms tested: RHEL6 x86_64 and RHEL5 i386
Flag Day: no
Doc impact: no
(cherry picked from commit 077544cad896413ec32801b565fbe220c91bc04e)