File: remove-links.pl

package info (click to toggle)
manpages-de 0.7-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,188 kB
  • ctags: 9
  • sloc: makefile: 83; perl: 61
file content (21 lines) | stat: -rw-r--r-- 512 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl

use strict;
use warnings;

use File::Basename;

# Get the installation path from Makefile
my $install_path = $ARGV[0] || die "Please specify the installation path.";

# Read the whole file
while (<>) {
	# Remove trailing newline
	chop();
	# Format is source, destination with their corresponding manpage section
	# e.g. man1/access.1.gz or man5/complex.5.gz
	(my $source, my $destination) = split(/ /);
	if (-e $install_path . '/' . $source) {
		system("rm -f $install_path/$destination");
	}
}