+ eval { File::Path::mkpath($dir) };
+ return $FAIL->("mkpath($dir): $@") if $@;
+ }
+
+ my $file = $stat->ebuild_file;
+ open my $eb, '>', $file or return $FAIL->("open($file): $!");
+ print $eb $self->ebuild_source;
+ close $eb;
+
+ $stat->created(0);
+ $stat->dist(undef);
+
+ $self->SUPER::create(@_);
+
+ if ($stat->do_manifest and not $self->update_manifest) {
+ 1 while unlink $file;
+ return $FAIL->();
+ }
+
+ return $OK->();
+}
+
+=head2 C<update_manifest>
+
+Updates the F<Manifest> file for the ebuild associated to the current dist object.
+
+=cut
+
+sub update_manifest {
+ my $self = shift;
+ my $stat = $self->status;
+
+ my $file = $stat->ebuild_file;
+ unless ($file and -e $file) {
+ return $self->_abort('The ebuild file is invalid or does not exist');
+ }
+
+ unless (File::Copy::copy($stat->fetched_arch => $stat->distdir)) {
+ return $self->_abort("Couldn\'t copy the distribution file to distdir ($!)");