File: mkbuildlvl.pl

package info (click to toggle)
fte 0.50.2-1.2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,696 kB
  • ctags: 6,486
  • sloc: cpp: 48,178; ansic: 2,795; perl: 808; sh: 112; makefile: 106
file content (74 lines) | stat: -rwxr-xr-x 1,572 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl -w

use strict;
use FindBin;
use File::Spec;
use File::Basename;

# what build level do we have?

my @time = localtime;
my $bldlvl = sprintf "%04d%02d%02d", $time[5] + 1900, $time[4] + 1, $time[3];

my $dir = File::Spec->canonpath(File::Spec->catdir($FindBin::Bin,
                                                   File::Spec->updir,
                                                   File::Spec->updir,
                                                  )
                               );

chdir $dir;

my $sources = File::Spec->catfile($dir, "fte-$bldlvl-src.zip");
my $common  = File::Spec->catfile($dir, "fte-$bldlvl-common.zip");
print "sources => $sources\ncommon => $common\n";

my @src_files = find_sources();
my @cmn_files = find_common();

unlink $sources, $common;
system qw(zip -9), $sources, @src_files;
system qw(zip -9), $common, @cmn_files;

sub find_sources
{
    # am I really going for the obsfucated perl code contest?
    (
     (
      grep {
          ! /\.o$/ and
              ! -d $_ and
              ! -x _ and
              ! /defcfg\.(?:cnf|h)/ and
              ! /~$/
      } map {
          glob "fte/$_"
      } qw(
      Makefile
      fte.in
      src/*
      src/bmps/*
      src/icons/*
     )  # FTE bug in indentation?
     ),
    qw( fte/install )
    );
}

sub find_common
{
    grep { 
        ! -d $_ and
            $_ !~ /Makefile$/ and
            ! /~$/
    } map {
        glob "fte/$_"
    } qw(
    [A-Z]*
    file_id.diz
    doc/*
    config/*
    config/kbd/*
    config/menu/*
    config/slang/*
);
}