ldap/admin/src/scripts/91subtreereindex.pl | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
New commits:
commit 790cbbb903e37086ca5d042c0636fab426200e88
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Jan 30 20:47:23 2012 -0700
Ticket #273 - ruv tombstone searches don't work after reindex entryrdn
https://fedorahosted.org/389/ticket/273
Resolves: Ticket #273
Bug Description: ruv tombstone searches don't work after reindex entryrdn
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: Upgrade script was not working correctly:
1) replace both rdn-format/ and rdn-format-1/ with rdn-format-2/
2) use s (replace) instead of y (transliterate)
3) use correct version string when updating main DBVERSION file
4) open main DBVERSION file in write mode
5) do not put extra newline in DBVERSION file
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/admin/src/scripts/91subtreereindex.pl
b/ldap/admin/src/scripts/91subtreereindex.pl
index c512435..a031cc1 100644
--- a/ldap/admin/src/scripts/91subtreereindex.pl
+++ b/ldap/admin/src/scripts/91subtreereindex.pl
@@ -123,8 +123,9 @@ sub runinst {
if (!open(DBVERSION, "> $dbversion1")) {
push @errs, ['error_opening_file', $dbversion1, $!];
} else {
- $versionstr =~ y/rdn\-format/rdn\-format\-2/;
- print DBVERSION $versionstr . "\n";
+ $versionstr =~ s,rdn\-format\-1/,rdn\-format\-2/,;
+ $versionstr =~ s,rdn\-format/,rdn\-format\-2/,;
+ print DBVERSION $versionstr; # not chomp'd above, already has
newline
close DBVERSION;
}
}
@@ -134,11 +135,12 @@ NEXT:
}
# update main DBVERSION file
- if (!open(DBVERSION, "$dbversion0")) {
+ if (!open(DBVERSION, "> $dbversion0")) {
push @errs, ['error_opening_file', $dbversion0, $!];
} else {
- $dbversionstr = y/rdn\-format/rdn\-format\-2/;
- print DBVERSION $versionstr . "\n";
+ $dbversionstr =~ s,rdn\-format\-1/,rdn\-format\-2/,;
+ $dbversionstr =~ s,rdn\-format/,rdn\-format\-2/,;
+ print DBVERSION $dbversionstr; # not chomp'd above, already has newline
close DBVERSION;
}