aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2009-05-08 23:07:18 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2009-05-08 23:07:18 +0000
commita717b77fa05a3b71dd09f20da97d0af56e0b9ea2 (patch)
tree76f525e589f04e4fd596857eae7016a7d5044639
parent40ce96b66753c5be192bc9ea968ffb7376d04d52 (diff)
downloadspec-helper-a717b77fa05a3b71dd09f20da97d0af56e0b9ea2.tar
spec-helper-a717b77fa05a3b71dd09f20da97d0af56e0b9ea2.tar.gz
spec-helper-a717b77fa05a3b71dd09f20da97d0af56e0b9ea2.tar.bz2
spec-helper-a717b77fa05a3b71dd09f20da97d0af56e0b9ea2.tar.xz
spec-helper-a717b77fa05a3b71dd09f20da97d0af56e0b9ea2.zip
drop man page normalisation: it doesn't work on compressed man pages (mdv bug#50729), and seems to be uneeded anymore, as file command doesn't need it anymore
-rwxr-xr-xnormalize_man_pages60
1 files changed, 0 insertions, 60 deletions
diff --git a/normalize_man_pages b/normalize_man_pages
deleted file mode 100755
index fffc342..0000000
--- a/normalize_man_pages
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/perl
-# $Id: fix_eol 242516 2008-05-14 08:54:21Z guillomovitch $
-# ensure all man pages contains a comment line
-
-use strict;
-use warnings;
-use File::Find;
-use File::Temp;
-
-my $buildroot = $ENV{RPM_BUILD_ROOT};
-die "No build root defined" unless $buildroot;
-die "Invalid build root" unless -d $buildroot;
-# normalize build root
-$buildroot =~ s|/$||;
-
-my $mandir=`rpm --eval %{_mandir}`;
-chomp $mandir;
-
-my $exclude_string = join('|',
- map { '(:?' . quotemeta($_) . ')' }
- $ENV{EXCLUDE_FROM_NORMALIZATION} ?
- split(' ', $ENV{EXCLUDE_FROM_NORMALIZATION}) : ()
-);
-my $exclude_pattern = qr/$exclude_string/;
-
-find(\&normalize, $buildroot . $mandir);
-
-sub normalize {
- # skip everything but files
- return unless -f $_;
- # skip symlinks
- return if -l $_;
- # skip excluded files
- return if $exclude_string && $File::Find::name =~ $exclude_pattern;
-
- # check if first line begin with a comment
- open(my $in, '<', $_) or die "Unable to open file $_: $!";
- my $line = <$in>;
- if (defined $line && $line !~ /^\.\\"/) {
- # process all file
- my $out = File::Temp->new(DIR => '.', UNLINK => 0);
- print $out <<'EOF';
-.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-.\" make the file command recognize this file as a roff text
-.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-EOF
- print $out $line;
- while (defined ($line = <$in>)) {
- print $out $line;
- }
- my $tmp = $out->filename;
- $out = undef;
-
- # rename file, taking care to keep original permissions
- my $perms = (stat $_)[2] & 07777;
- rename($tmp, $_) or die "Unable to rename $tmp to $_: $!";
- chmod($perms, $_);
- }
- close($in);
-}