#47374 flush.pl is not included in perl5
Closed: Fixed None Opened 6 years ago by nhosoi.

$ dbgen.pl -o test.ldif -n 10
Legacy library flush.pl will be removed from the Perl core distribution in the next major release. Please install it from the CPAN distribution Perl4::CoreLibs. It is being used at /usr/bin/dbgen.pl, line 536.


[Workaround]
Download Perl4-CoreLibs-0.00#.tar.gz from here:
http://search.cpan.org/~zefram/Perl4-CoreLibs-0.003/lib/Perl4/CoreLibs.pm

Expand the tar ball.

Run dbgen with the path:
perl -I/path/to/expanded/Perl4-CoreLibs-0.003/lib /usr/bin/dbgen.pl -o <output_ldif> -n <user_count>

We should eliminate the requirement for flush.pl in dbgen.pl. None of of other tools appear to use it. The code for flush.pl itself recommends using IO::Handle as an alternative.

These lines are obsolete:
require "flush.pl";
require "getopts.pl";

{{{
http://cpansearch.perl.org/src/ZEFRAM/Perl4-CoreLibs-0.003/lib/flush.pl

This library is no longer being maintained, and is included for backward

compatibility with Perl 4 programs which may require it.

In particular, this should not be used as an example of modern Perl

programming techniques.

Suggested alternative: IO::Handle

;# Usage: &flush(FILEHANDLE)
;# flushes the named filehandle

;# Usage: &printflush(FILEHANDLE, "prompt: ")
;# prints arguments and flushes filehandle

sub flush {
local($old) = select(shift);
$| = 1;
print "";
$| = 0;
select($old);
}

sub printflush {
local($old) = select(shift);
$| = 1;
print @_;
$| = 0;
select($old);
}

1;

}}}

Fix description: replaced obsolete flush.pl and getopts.pl with
perl5 equivalents.

Reviewed by Rich (Thank you!!)

Pushed to master: commit 8bb10ab
Pushed to 389-ds-base-1.3.1: commit 91e3ba6

This caused a regression in ticket#612 - reopening

The fix changed opt_b to BeginNum - but did not change all occurrences of opt_b to BeginNum

In addition, the fix hard coded the template path to be /usr/share/dirsrv/data instead of using the macro @templatedir@.

additional - 0001-Ticket-47374-flush.pl-is-not-included-in-perl5.patch
0001-Ticket-47374-flush.pl-is-not-included-in-perl5.2.patch

0e7f59d..ea86856 389-ds-base-1.3.1 -> 389-ds-base-1.3.1
commit ea86856
Author: Rich Megginson rmeggins@redhat.com
Date: Fri Jan 31 14:21:59 2014 -0700
01c0794..55df132 389-ds-base-1.3.2 -> 389-ds-base-1.3.2
commit 55df132
Author: Rich Megginson rmeggins@redhat.com
Date: Fri Jan 31 14:21:59 2014 -0700
03533f2..f9ba01b master -> master
commit f9ba01b
Author: Rich Megginson rmeggins@redhat.com
Date: Fri Jan 31 14:21:59 2014 -0700

Metadata Update from @nhosoi:
- Issue assigned to nhosoi
- Issue set to the milestone: 1.3.1.3

2 years ago

Login to comment on this ticket.

Metadata