-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcached-artwork-7z.pl
125 lines (91 loc) · 3.03 KB
/
cached-artwork-7z.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
use strict;
use File::Copy;
my $build = $ARGV[0];
my $azbp = $ARGV[1];
my $szp = $ARGV[2];
my $lastbuild = $build;
while(! -e "$azbp\\Package\\Regular_${lastbuild}.7z") {
$lastbuild = $lastbuild - 1;
if ($lastbuild <= 1) {
print "couldn't find a last build!\n";
last;
}
}
my $dir = "$azbp\\Package\\Artwork_minimal";
opendir(DIR, $dir) or die "Can't open $dir $!";
my @files = readdir(DIR);
closedir(DIR);
my @del_indexes = reverse(grep { $files[$_] =~ /^\./ } 0..$#files);
foreach my $item (@del_indexes) {
splice (@files,$item,1);
}
my %h = map(($_, -M "$dir\\$_"), @files);
my @files = sort { $h{$a} <=> $h{$b} } @files;
my $ts = (stat($dir."\\".$files[0]))[9];
my $time = localtime($ts);
open(LA,"C:\\lastart-minimal");
my $la = <LA>;
close LA;
print "$la vs $ts $files[0]\n";
if ($la ne "$ts $files[0]") {
my $cmd = "\"$szp\" a -t7z $azbp\\Package\\Minimal_${build}.7z $azbp\\Package\\Artwork_minimal\\ -xr!*.git -mx8 -m0=LZMA";
system($cmd);
} else {
print "skipping minimal artwork 7z process, not changed!\n";
copy("$azbp\\Package\\Minimal_${lastbuild}.7z","$azbp\\Package\\Minimal_${build}.7z") if ($lastbuild != $build);
};
open(LA,">C:\\lastart-minimal");
print LA "$ts $files[0]";
close LA;
$dir = "$azbp\\Package\\Artwork_detailed";
opendir(DIR, $dir) or die "Can't open $dir $!";
my @files = readdir(DIR);
closedir(DIR);
my @del_indexes = reverse(grep { $files[$_] =~ /^\./ } 0..$#files);
foreach my $item (@del_indexes) {
splice (@files,$item,1);
}
my %h = map(($_, -M "$dir\\$_"), @files);
my @files = sort { $h{$a} <=> $h{$b} } @files;
my $ts = (stat($dir."\\".$files[0]))[9];
my $time = localtime($ts);
open(LA,"C:\\lastart-detailed");
my $la = <LA>;
close LA;
print "$la vs $ts $files[0]\n";
if ($la ne "$ts $files[0]") {
my $cmd = "\"$szp\" a -t7z $azbp\\Package\\Hires_${build}.7z $azbp\\Package\\Artwork_detailed\\ -xr!*.git -mx8 -m0=LZMA";
system($cmd);
} else {
print "skipping detailed artwork 7z process, not changed!\n";
copy("$azbp\\Package\\Hires_${lastbuild}.7z","$azbp\\Package\\Hires_${build}.7z") if ($lastbuild != $build);
};
open(LA,">C:\\lastart-detailed");
print LA "$ts $files[0]";
close LA;
$dir = "$azbp\\Package\\Artwork";
opendir(DIR, $dir) or die "Can't open $dir $!";
my @files = readdir(DIR);
closedir(DIR);
my @del_indexes = reverse(grep { $files[$_] =~ /^\./ } 0..$#files);
foreach my $item (@del_indexes) {
splice (@files,$item,1);
}
my %h = map(($_, -M "$dir\\$_"), @files);
my @files = sort { $h{$a} <=> $h{$b} } @files;
my $ts = (stat($dir."\\".$files[0]))[9];
my $time = localtime($ts);
open(LA,"C:\\lastart-regular");
my $la = <LA>;
close LA;
print "$la vs $ts $files[0]\n";
if ($la ne "$ts $files[0]") {
my $cmd = "\"$szp\" a -t7z $azbp\\Package\\Regular_${build}.7z $azbp\\Package\\Artwork\\ -xr!*.git -mx8 -m0=LZMA";
system($cmd);
} else {
print "skipping regular artwork 7z process, not changed!\n";
copy("$azbp\\Package\\Regular_${lastbuild}.7z","$azbp\\Package\\Regular_${build}.7z") if ($lastbuild != $build);
};
open(LA,">C:\\lastart-regular");
print LA "$ts $files[0]";
close LA;