diff --git a/MANIFEST b/MANIFEST index c8e2cf0..3cc443d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2174,6 +2174,7 @@ tools/release/crow.pir [] tools/release/gen_release_info.pl [] tools/release/inc_ver.pir [] tools/release/release.json [] +tools/release/releasecheck.pl [] tools/release/templates.json [] # Local variables: # mode: text diff --git a/config/gen/makefiles/root.in b/config/gen/makefiles/root.in index 7076a6d..3321ec8 100644 --- a/config/gen/makefiles/root.in +++ b/config/gen/makefiles/root.in @@ -55,6 +55,7 @@ BUILD_TOOLS_DIR = tools/build # directory for developers' tools # programs, templates, configuration files NOT invoked by 'make all' DEV_TOOLS_DIR = tools/dev +RELEASE_TOOLS_DIR = tools/release # directory for header files INC_DIR = include/parrot @@ -823,6 +824,7 @@ help : @echo "" @echo "Release:" @echo " release: Create a tarball." + @echo " release_check: Check that the tarball will build on its own." @echo " win32-inno-installer: Create MSWin32 setup." @echo "" @echo "Examples:" @@ -2915,6 +2917,12 @@ release : MANIFEST MANIFEST.generated mv MANIFEST.real MANIFEST rm parrot-$(VERSION) +release_check: + make release VERSION=$(SOVERSION) + $(PERL) $(RELEASE_TOOLS_DIR)/releasecheck.pl + +relcheck : release_check + win32-inno-installer : world installable $(PERL) $(DEV_TOOLS_DIR)/mk_inno.pl $(INNO_SETUP) parrot.iss diff --git a/tools/release/releasecheck.pl b/tools/release/releasecheck.pl new file mode 100644 index 0000000..f5a285c --- /dev/null +++ b/tools/release/releasecheck.pl @@ -0,0 +1,49 @@ +# !perl +use strict; +use warnings; +use Data::Dumper;$Data::Dumper::Indent=1; +use Carp; +use Cwd; +use File::Copy; +use File::Temp qw( tempdir ); + +my $cwd = cwd(); +opendir my $DIRH, $cwd + or croak "Unable to open directory handle"; +my @tarballs = grep { m/parrot-.*\.tar\.gz$/ } readdir $DIRH; +closedir $DIRH or croak "Unable to close directory handle"; +croak "Should find exactly one gzipped tarball" + unless @tarballs == 1; +my $tb = $tarballs[0]; +my $distro = ''; +if ($tb =~ m/(parrot-\d+\.\d+\.\d+(?:-devel)?)\.tar\.gz$/ ) { + $distro = $1; +} +else { + croak "Unable to extract distro from $tb"; +} +print "Performing releasecheck on $tb\n"; +{ + my $tdir = tempdir( CLEANUP => 1 ); + chdir $tdir or croak "Unable to change to temporary directory"; + print "Changing to temporary directory\n"; + my $ctarball = "$tdir/$tb"; + copy "$cwd/$tb" => $ctarball + or croak "Unable to copy $tb"; + system(qq{tar xzf $ctarball}) + and croak "Unable to untar $ctarball"; + chdir $distro or croak "Unable to chdir to $distro"; + print "Reconfiguring\n"; + system(qq{$^X Configure.pl --silent}) and croak "Unable to configure"; + print "Rebuilding\n"; + system(qq{make --silent}) and croak "Unable to build"; + print "Retesting\n"; + system(qq{make test}) and croak "'make test' did not complete successfully"; + print "Rereleasing\n"; + system(qq{make release --silent}) and croak "Unable to release"; + print "Recleaning\n"; + system(qq{make realclean --silent}) and croak "Unable to realclean"; + chdir $cwd or croak "Unable to change dir back"; + print "Leaving temporary directory\n"; +} +print "Completed releasecheck on $tb\n";