Debian Codegraph @

bin_PL/_build_docs

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 #!/usr/bin/env perl
2 use 5.008.004;
3 use strict;
4 use warnings;
5
6 use FindBin qw($Bin $Script);
7 use File::Basename;
8
9 my $bindir = "bin";
10
11 if ( !-d $bindir ) {
12 mkdir $bindir || die "Could not mkdir $bindir: $!";
13 }
14
15 print "Using perl binary: $^X", $/;
16 print "Using perl version $^V", $/;
17
18 for my $dest (@ARGV) {
19 my $source = $Bin . '/' . basename($dest);
20
21 next if ( $source =~ m/$Script/ );
22 next if ( $source =~ m/\.x$/ );
23
24 print "Generating: $source", $/;
25
26 if ( -f $dest ) {
27 chmod( 0755, $dest ) || die "Could not chmod $dest for removing: $!";
28 }
29
30 open( my $sfh, '<', $source )
31 || die "Could not open $source for reading: $!";
32 open( my $dfh, '>', $dest ) || die "Could not open $dest for writing: $!";
33 print $dfh $_ while (<$sfh>);
34 close($sfh);
35
36 if ( $source !~ m/clusterssh_bash_completion.dist/ ) {
37 print $dfh "\n\n__END__\n\n";
38
39 my $pod = qx{ $^X $source --generate-pod };
40 die "Failed to generate pod" if ($?);
41 print $dfh $pod;
42 }
43
44 close($dfh);
45
46 chmod( 0555, $dest ) || die "Could not chmod $dest: $!";
47 }