File: create_missing_manual_pages

package info (click to toggle)
vips 8.10.5-2
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 40,952 kB
  • sloc: ansic: 201,201; cpp: 9,766; sh: 5,031; xml: 4,191; python: 3,869; makefile: 1,033; perl: 40
file content (44 lines) | stat: -rw-r--r-- 926 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env perl
require 5.008;
BEGIN { $^W = 1; }
use strict;
use File::Copy;

my $whoami = ($0 =~ m,([^/\\]*)$,) ? $1 : $0;
#my $dirname = ($0 =~ m,(.*)[/\\][^/\\]+$,) ? $1 : ".";

my @links = ();
my @programs = ();
my $dir = "debian/tmp/usr/bin";
opendir(D, $dir) or die;
my @entries = readdir(D) or die;
closedir(D);
foreach my $entry (@entries)
{
    my $fullpath = "$dir/$entry";
    if (-l $fullpath)
    {
	push(@links, $entry);
    }
    elsif ((-f $fullpath) && (-x $fullpath))
    {
	push(@programs, $entry);
    }
}
my $mandir = 'debian/tmp/usr/share/man/man1';
foreach my $link (@links)
{
    open(M, ">$mandir/$link.1") or die;
    print M ".so man1/vips.1\n";
    close(M);
}
foreach my $prog (@programs)
{
    if (! -f "$mandir/$prog.1")
    {
	open(M, ">$mandir/$prog.1") or die;
	print M ".so man1/vips_missing.1\n";
	close(M);
    }
}
copy("debian/misc/vips_missing.1", "$mandir/vips_missing.1") or die;