From 9b1e2d02e20f270aed32f05210d207398ae0f7a1 Mon Sep 17 00:00:00 2001
From: Rich Megginson <rmeggins@redhat.com>
Date: Fri, 31 Jan 2014 14:21:59 -0700
Subject: [PATCH 86/87] Ticket #47374 - flush.pl is not included in perl5
https://fedorahosted.org/389/ticket/47374
Reviewed by: nhosoi (Thanks!)
Branch: rhel-7.0
Fix Description: Change opt_b to BeginNum and opt_r to Random_Seed.
Have to specify option as j=i because -j has an integer argument.
Get rid of opt_j and use ZeroPad instead.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit f9ba01b4b9ce3881cf08433b0c43db93ab207507)
(cherry picked from commit 55df132065f109b8f548100461011c10b58843ea)
(cherry picked from commit ea868566c49869b3fa0f6e2c7194b743d22f77fe)
---
ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl.in | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl.in b/ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl.in
index 51af0db..2ef76f2 100755
--- a/ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl.in
+++ b/ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl.in
@@ -543,13 +543,14 @@ sub flush {
my $Number_To_Generate = 1;
$Output_File_Name = "output.ldif";
-$Random_Seed = 1;
+$Random_Seed = 0;
$Suffix = 'dc=example,dc=com';
$NamingType = "uid";
$inetOrgPerson = "objectClass: inetOrgPerson\n";
$PrintOrgChartDat = 0;
-$DataDir = "/usr/share/dirsrv/data";
+$DataDir = "@templatedir@";
$BeginNum = 0;
+$ZeroPad = 0;
$Verbose = 0;
$debug = 0;
@@ -572,7 +573,7 @@ GetOptions('number=i' => \$Number_To_Generate,
'x' => \$opt_x,
'y' => \$opt_y,
'z' => \$opt_z,
- 'j' => \$opt_j,
+ 'j=i' => \$ZeroPad,
'verbose' => \$Verbose,
'debug' => \$debug,
'quiet' => \$Quiet,
@@ -598,7 +599,6 @@ if ("" != $opt_y)
{
$printorgunit = 0;
}
-$ZeroPad = $opt_j;
if ($Suffix =~ /o=/) {
($Organization) = $Suffix =~ /o=([^,]+)/;
@@ -1029,8 +1029,8 @@ sub MakeRandomLocality {
sub MakeRandomName {
local($Given_Name, $Surname, $Full_Name, $UID, $uniq, $first, $last, $RDN);
# Get the unique number depending if a seed was set or not.
- $uniq = int rand($Random_Seed) if ($opt_r);
- $uniq = $x if (!$opt_r);
+ $uniq = int rand($Random_Seed) if ($Random_Seed);
+ $uniq = $x if (!$Random_Seed);
$Given_Name = $given_names[rand @given_names];
$Surname = $family_names[rand @family_names];
@@ -1040,7 +1040,7 @@ sub MakeRandomName {
$UID = $first . $last . "$uniq";
# Create the uid based on the DN naming type defined
- if ($opt_b) { # use a uniquenumber for the RDN value
+ if ($BeginNum) { # use a uniquenumber for the RDN value
if ($ZeroPad) {
$RDN = sprintf "%0.${ZeroPad}d", $x;
} else {
--
1.8.1.4