Ticket #1159: make.distcheck.diff

File make.distcheck.diff, 2.9 KB (added by jkeenan, 4 years ago)
  • MANIFEST

    diff --git a/MANIFEST b/MANIFEST
    index c8e2cf0..1e4f76b 100644
    a b  
    21712171tools/install/smoke_languages.pl                            [] 
    21722172tools/release/README                                        []doc 
    21732173tools/release/crow.pir                                      [] 
     2174tools/release/distcheck.pl                                  [] 
    21742175tools/release/gen_release_info.pl                           [] 
    21752176tools/release/inc_ver.pir                                   [] 
    21762177tools/release/release.json                                  [] 
  • config/gen/makefiles/root.in

    diff --git a/config/gen/makefiles/root.in b/config/gen/makefiles/root.in
    index 7076a6d..e84bde6 100644
    a b  
    5555# directory for developers' tools 
    5656# programs, templates, configuration files NOT invoked by 'make all' 
    5757DEV_TOOLS_DIR = tools/dev 
     58RELEASE_TOOLS_DIR = tools/release 
    5859 
    5960# directory for header files 
    6061INC_DIR         = include/parrot 
     
    29192920        $(PERL) $(DEV_TOOLS_DIR)/mk_inno.pl 
    29202921        $(INNO_SETUP) parrot.iss 
    29212922 
     2923distcheck : release 
     2924        $(PERL) $(RELEASE_TOOLS_DIR)/distcheck.pl 
     2925 
    29222926############################################################################### 
    29232927# 
    29242928# exec: 
  • (a) /dev/null vs. (b) b/tools/release/distcheck.pl

    diff --git a/tools/release/distcheck.pl b/tools/release/distcheck.pl
    new file mode 100644
    index 0000000..9e3d17e
    a b  
     1# !perl 
     2use strict; 
     3use warnings; 
     4use Data::Dumper;$Data::Dumper::Indent=1; 
     5use Carp; 
     6use Cwd; 
     7use File::Copy; 
     8use File::Temp qw( tempdir ); 
     9 
     10my $cwd = cwd(); 
     11opendir my $DIRH, $cwd 
     12    or croak "Unable to open directory handle"; 
     13my @tarballs = grep { m/parrot-.*\.tar\.gz$/ } readdir $DIRH; 
     14closedir $DIRH or croak "Unable to close directory handle"; 
     15croak "Should find exactly one gzipped tarball" 
     16    unless @tarballs == 1; 
     17my $tb = $tarballs[0]; 
     18my $distro = ''; 
     19if ($tb =~ m/(parrot-\d+\.\d+\.\d+(?:-devel)?)\.tar\.gz$/ ) { 
     20    $distro = $1; 
     21} 
     22else { 
     23    croak "Unable to extract distro from $tb"; 
     24} 
     25print "Performing distcheck on $tb\n"; 
     26{ 
     27    my $tdir = tempdir( CLEANUP => 1 ); 
     28    chdir $tdir or croak "Unable to change to temporary directory"; 
     29    my $ctarball = "$tdir/$tb"; 
     30    copy "$cwd/$tb" => $ctarball 
     31        or croak "Unable to copy $tb"; 
     32    system(qq{tar xzf $ctarball}) 
     33        and croak "Unable to untar $ctarball"; 
     34    chdir $distro or croak "Unable to chdir to $distro"; 
     35    system(qq{$^X Configure.pl --silent}) and croak "Unable to configure"; 
     36    system(qq{make --silent}) and croak "Unable to build"; 
     37    system(qq{make test}) and croak "'make test' did not complete successfully"; 
     38    system(qq{make release}) and croak "Unable to release"; 
     39    system(qq{make realclean}) and croak "Unable to realclean"; 
     40    chdir $cwd or croak "Unable to change dir back"; 
     41} 
     42print "Completed distcheck on $tb\n";