-
Notifications
You must be signed in to change notification settings - Fork 0
/
installu.pl
executable file
·73 lines (66 loc) · 1.87 KB
/
installu.pl
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/pro/bin/perl -w
use strict;
use Config;
use Cwd;
use File::Find;
use File::Copy;
exists $ENV{UNIFY} && -d $ENV{UNIFY} or die "Not in (valid) UNIFY env";
my $version = $Config{version};
my $arch = $Config{archname};
my %tar;
my $src = getcwd;
foreach my $loc (qw( arch lib man3 )) {
chdir "$src/blib/$loc" or die "No $loc";
find (sub {
m/^\.+$/ and return;
(my $f = $File::Find::name) =~ s:^./::;
push @{$tar{$loc}}, $f;
}, ".");
}
-d "$ENV{UNIFY}/perl" or
mkdir "$ENV{UNIFY}/perl", 0775;
-d "$ENV{UNIFY}/perl/man" or
mkdir "$ENV{UNIFY}/perl/man", 0775;
-d "$ENV{UNIFY}/perl/man/man3" or
mkdir "$ENV{UNIFY}/perl/man/man3", 0775;
-d "$ENV{UNIFY}/perl/$version" or
mkdir "$ENV{UNIFY}/perl/$version", 0775;
-d "$ENV{UNIFY}/perl/$version/$arch" or
mkdir "$ENV{UNIFY}/perl/$version/$arch", 0775;
my $dst = "$ENV{UNIFY}/perl/$version";
foreach my $f (sort @{$tar{lib}}) {
my $s = "$src/blib/lib/$f";
if (-d $s) {
print STDERR "mkdir $dst/$f ...\n";
mkdir "$dst/$f", 0775;
next;
}
print STDERR "lib cp lib/$f\n";
copy ("$src/blib/lib/$f", "$dst/$f");
$f =~ m/\.(sl|al|pm|bs)$/ and chmod 0755, "$dst/$f";
}
$dst = "$ENV{UNIFY}/perl/$version/$arch";
foreach my $f (sort @{$tar{arch}}) {
my $s = "$src/blib/arch/$f";
if (-d $s) {
print STDERR "mkdir $dst/$f ...\n";
mkdir "$dst/$f", 0775;
next;
}
print STDERR "arch cp arch/$f\n";
copy ("$src/blib/arch/$f", "$dst/$f");
$f =~ m/\.(sl|so|al|pm|bs)$/ and chmod 0755, "$dst/$f";
}
$dst = "$ENV{UNIFY}/perl/man/man3";
foreach my $f (sort @{$tar{man3}}) {
$f =~ m{(?:^|/)\.exists$} and next;
my $s = "$src/blib/man3/$f";
if (-d $s) {
print STDERR "mkdir $dst/$f ...\n";
mkdir "$dst/$f", 0775;
next;
}
print STDERR "man3 cp man3/$f\n";
copy ("$src/blib/man3/$f", "$dst/$f");
chmod 0644, "$dst/$f";
}