Thread: [Module-build-general] [PATCH] always copy files to dist dir
Status: Beta
Brought to you by:
kwilliams
|
From: Dave R. <au...@ur...> - 2003-08-13 16:43:24
|
I proposed this earlier and got no response so here's a patch to implement this. I think doing this just makes more sense, since otherwise we can't manipular files in the dist dir without affecting the base dir files, since the dist dir could just be symlinks. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ --- Base.pm.~1.163.~ 1969-12-31 19:00:01.000000000 -0500 +++ Base.pm 2003-08-13 11:51:12.000000000 -0400 @@ -1486,7 +1486,7 @@ my $dist_dir = $self->dist_dir; $self->delete_filetree($dist_dir); $self->add_to_cleanup($dist_dir); - ExtUtils::Manifest::manicopy($dist_files, $dist_dir, 'best'); + ExtUtils::Manifest::manicopy($dist_files, $dist_dir, 'cp'); warn "*** Did you forget to add $self->{metafile} to the MANIFEST?\n" unless exists $dist_files->{$self->{metafile}}; $self->_sign_dir($dist_dir) if $self->{properties}{sign}; |
|
From: Ken W. <ke...@ma...> - 2003-08-13 17:26:46
|
On Wednesday, August 13, 2003, at 10:52 AM, Dave Rolsky wrote: > I proposed this earlier and got no response so here's a patch to > implement > this. Yeah, I wasn't sure whether we had achieved consensus yet, mostly because I didn't understand all the issues yet. I don't see any harm in the patch, though. I'll apply. > I think doing this just makes more sense, since otherwise we can't > manipular files in the dist dir without affecting the base dir files, > since the dist dir could just be symlinks. I think they would be hard links, not symlinks. Not that these concepts translate very well to different platforms or anything. -Ken |
|
From: Ken W. <ke...@ma...> - 2003-08-18 16:18:41
|
On Wednesday, August 13, 2003, at 10:52 AM, Dave Rolsky wrote: > I proposed this earlier and got no response so here's a patch to > implement > this. I think doing this just makes more sense, since otherwise we > can't > manipular files in the dist dir without affecting the base dir files, > since the dist dir could just be symlinks. This patch seems to have broken M::B's 'disttest' action, because we don't have permission to write META.yml files. I'm about to do a new beta release of 0.19_05, so I'll roll back this change for it - if you can figure out how to make it work properly again, I'll re-patch. I agree that it's weird to make links, especially since links aren't really a cross-platform concept. -Ken |
|
From: Dave R. <au...@ur...> - 2003-08-19 13:50:13
|
On Mon, 18 Aug 2003, Ken Williams wrote: > > On Wednesday, August 13, 2003, at 10:52 AM, Dave Rolsky wrote: > > > I proposed this earlier and got no response so here's a patch to > > implement > > this. I think doing this just makes more sense, since otherwise we > > can't > > manipular files in the dist dir without affecting the base dir files, > > since the dist dir could just be symlinks. > > This patch seems to have broken M::B's 'disttest' action, because we > don't have permission to write META.yml files. > > I'm about to do a new beta release of 0.19_05, so I'll roll back this > change for it - if you can figure out how to make it work properly > again, I'll re-patch. I agree that it's weird to make links, > especially since links aren't really a cross-platform concept. I think we just need to chmod the file in the distmeta action. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/ RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.173 diff -u -r1.173 Base.pm --- lib/Module/Build/Base.pm 18 Aug 2003 16:02:24 -0000 1.173 +++ lib/Module/Build/Base.pm 19 Aug 2003 13:47:57 -0000 @@ -1507,7 +1507,7 @@ my $dist_dir = $self->dist_dir; $self->delete_filetree($dist_dir); $self->add_to_cleanup($dist_dir); - ExtUtils::Manifest::manicopy($dist_files, $dist_dir, 'best'); + ExtUtils::Manifest::manicopy($dist_files, $dist_dir, 'cp'); warn "*** Did you forget to add $self->{metafile} to the MANIFEST?\n" unless exists $dist_files->{$self->{metafile}}; $self->_sign_dir($dist_dir) if $self->{properties}{sign}; @@ -1595,6 +1595,9 @@ }; $node->{generated_by} = "Module::Build version " . Module::Build->VERSION; + + chmod 0644, $self->{metafile} + or die "Cannot make $self->{metafile} writeable: $!"; # YAML API changed after version 0.30 my $yaml_sub = $YAML::VERSION le '0.30' ? \&YAML::StoreFile : \&YAML::DumpFile; |
|
From: Ken W. <ke...@ma...> - 2003-08-19 14:09:09
|
On Tuesday, August 19, 2003, at 08:49 AM, Dave Rolsky wrote:
>
> I think we just need to chmod the file in the distmeta action.
Might be better to just remove it if it exists - not sure how chmod()
will act on different platforms. I've just committed the following
patch.
-Ken
Index: lib/Module/Build/Base.pm
===================================================================
RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -r1.173 -r1.174
--- lib/Module/Build/Base.pm 18 Aug 2003 16:02:24 -0000 1.173
+++ lib/Module/Build/Base.pm 19 Aug 2003 14:07:07 -0000 1.174
@@ -1507,7 +1507,7 @@
my $dist_dir = $self->dist_dir;
$self->delete_filetree($dist_dir);
$self->add_to_cleanup($dist_dir);
- ExtUtils::Manifest::manicopy($dist_files, $dist_dir, 'best');
+ ExtUtils::Manifest::manicopy($dist_files, $dist_dir, 'cp');
warn "*** Did you forget to add $self->{metafile} to the
MANIFEST?\n" unless exists $dist_files->{$self->{metafile}};
$self->_sign_dir($dist_dir) if $self->{properties}{sign};
@@ -1595,6 +1595,9 @@
};
$node->{generated_by} = "Module::Build version " .
Module::Build->VERSION;
+
+ # If we're in the distdir, the metafile may exist and be
non-writable.
+ $self->delete_filetree($self->{metafile});
# YAML API changed after version 0.30
my $yaml_sub = $YAML::VERSION le '0.30' ? \&YAML::StoreFile :
\&YAML::DumpFile;
|