Blame SOURCES/0086-Ticket-47374-flush.pl-is-not-included-in-perl5.patch

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