-
-
Notifications
You must be signed in to change notification settings - Fork 910
/
makedist
executable file
·41 lines (34 loc) · 975 Bytes
/
makedist
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
#!/usr/bin/perl
use strict;
use XML::Simple;
use Data::Dumper;
use File::Basename;
use List::Util 1.33 'any';
my $input = ".distfiles";
my $output = "distfiles.mk";
my @excludedir = (".github", ".github/workflows");
my @excludefile = ();
open( my $fh => $input) || die "Cannot open $input: $!";
open( my $oh, ">", $output) || die "Cannot open $output: $!";
print $oh "# This File is automatically generated by make dist-update\n";
print $oh "# Any Edits on this file will be lost next time dist-update is run\n";
print $oh "\n";
print $oh "DISTFILES =\t";
while(my $line = <$fh>) {
chomp($line);
my $dir = dirname($line);
if (any {/^$dir$/} @excludedir)
{
print "Excluded File $line - (Directory Excluded)\n";
next;
}
if (any {/^$line$/} @excludefile)
{
print "Excluded File $line - (File Excluded)\n";
next;
}
print $oh $line." \\\n\t";
}
print $oh "cpp/src/vers.cpp\n";
close($oh);
close($fh);