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
|
#!/usr/bin/perl -w
$dir = $ENV{SBO_GITROOT} || die "SBO_GITROOT not set\n";
chdir $dir || die "can't cd to $dir: $!\n";
$ret = 0;
open my $pipe, "-|", "git log --pretty=format:%H:%s master.." or die "$!\n";
while(<$pipe>) {
chomp;
my ($hash, $build, undef) = split /:/;
$build =~ s/:.*$//;
$build =~ s,.*/,,;
$hash = substr($hash, 0, 9);
$lhashes{$hash}++;
$builds{$build}++;
}
close $pipe;
for(sort keys %builds) {
my $count = $builds{$_};
$count < 2 && next;
print "$_: has $count local commits\n";
$ret++;
}
print " Fix these, rebase, and do a git push -f\n\n" if $ret;
open $pipe, "-|", "elinks -dump-width 500 -dump -no-numbering -no-references https://slackbuilds.org/ready/";
while(<$pipe>) {
last if /SlackBuild\s+Category/;
}
while(<$pipe>) {
chomp;
last if /^$/;
my ($build, undef, $hash, undef) = split /\s+/;
next if $lhashes{$hash};
$rbuilds{$build}++;
}
close $pipe;
for(sort keys %builds) {
my $count = $rbuilds{$_};
if($count) {
print "$_: has $builds{$_} local and $count remote commits\n";
$ret++;
}
}
print " Remove local commits, rebase, and do a git push -f\n\n" if $ret;
for(sort keys %rbuilds) {
my $count = $rbuilds{$_};
$count < 2 && next;
print "$_: has $count remote commits\n";
}
print " Let Willy know he should fix these.\n" if $ret;
exit $ret ? 1 : 0;
|