[Module-build-general] Patch: target 'dist'
Status: Beta
Brought to you by:
kwilliams
|
From: Roland B. <rol...@ff...> - 2003-08-16 15:39:18
|
Hi,
sorry, this is a patch over the old v0.19. But I hope it shows the idea:
1) a $VERSION variable should be added
2) I had troubles with target 'dist' and I think this is
because strings like Module-Name-0.10, Module-Name and Module/Name
are mixed up. I think it should/could be:
Module-Name-0.10 .......... dist_file
Module-Name-0.10.tar.gz ... dist_tgz
Module-Name ............... dist_name
Module/Name ............... dist_dir
It seems to work, however, maybe I've misunderstood
the concept.
Regards,
Roland.
#----------------------------------------CUT-------------------
--- Base.pm_v0.19 Tue Jul 08 00:02:22 2003
+++ Base.pm Sat Aug 16 15:58:09 2003
@@ -1,6 +1,10 @@
package Module::Build::Base;
use strict;
+use vars qw($VERSION);
+
+$VERSION = '0.01';
+
BEGIN { require 5.00503 }
use Config;
use File::Copy ();
@@ -1186,7 +1190,7 @@
my $dist_dir = $self->dist_dir;
- $self->make_tarball($dist_dir);
+ $self->make_tarball($dist_dir, $self->dist_file);
$self->delete_filetree($dist_dir);
}
@@ -1288,7 +1292,13 @@
sub dist_dir {
my ($self) = @_;
- return "$self->{properties}{dist_name}-$self->{properties}{dist_version}";
+ (my $dir = $self->dist_name) =~ s#-#/#g;
+ $dir;
+}
+
+sub dist_file {
+ my ($self) = @_;
+ my $file = join '-', $self->dist_name, $self->dist_version;
}
sub script_files {
@@ -1393,13 +1403,13 @@
}
sub make_tarball {
- my ($self, $dir) = @_;
+ my ($self, $dir, $distfile) = @_;
require Archive::Tar;
my $files = $self->rscan_dir($dir);
- print "Creating $dir.tar.gz\n";
- Archive::Tar->create_archive("$dir.tar.gz", 1, @$files);
+ print "Creating $distfile.tar.gz\n";
+ Archive::Tar->create_archive("$distfile.tar.gz", 1, @$files);
}
sub install_base_relative {
#----------------------------------------CUT-------------------
|