On Tue, 2003-10-14 at 17:27, Stas Bekman wrote:
> Philippe, is this relevant to your efforts with Module::Signature on mp1?

It's quite funny, actually. I realized the exact same problem and
'fixed' it on my side with MY::** EU::MM magic and it's almost identical
to what this patch does. Guess I won't have to submit a patch to EU::MM
after all.

That's great, combined with the little cleanup I did yesterday,
distribution signature with Module::Signature for mp-1 should just work
out of the box.

Great news, thanks Stas!

> -------- Original Message --------
> Subject: [PATCH] SIGN => 1 support for MakeMaker
> Date: Tue, 14 Oct 2003 18:32:28 +0800
> From: Autrijus Tang <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> CC: Mailing list Perl5 <[EMAIL PROTECTED]>,   [EMAIL PROTECTED]
> 
> Below please find the promised patches to allow SIGN => 1 to be passed
> to WriteMakefile, which generates SIGNATURE using "cpansign -s" and add
> that file to MANIFEST, as part of the distdir action, right after
> META.yml is being written.
> 
> This solves a major annoyance on using cpansign with modern MakeMaker,
> as noted by Andreas in CPAN-1.76/Makefile.PL:
> 
>      # if we make sign first and make dist then, then any change to
>      # META.yml will ruin the signature
>      # if we make dist first and make sign then, then the correct signature
>      # will not be part of the tarball
> 
> Thanks,
> /Autrijus/
> 
> diff -dur /var/perl-5.8.1/lib/ExtUtils/MM_Any.pm ExtUtils/MM_Any.pm
> --- /var/perl-5.8.1/lib/ExtUtils/MM_Any.pm    Tue Sep 16 16:00:37 2003
> +++ ExtUtils/MM_Any.pm        Tue Oct 14 17:39:59 2003
> @@ -607,6 +607,32 @@
>   }
> 
> 
> +=item signature_target
> +
> +    my $target = $mm->signature_target;
> +
> +Generate the signature target.
> +
> +Writes the file SIGNATURE with "cpansign -s".
> +
> +=cut
> +
> +sub signature_target {
> +    my $self = shift;
> +
> +    return <<'MAKE_FRAG' if !$self->{SIGN};
> +signature:
> +     $(NOECHO) $(NOOP)
> +MAKE_FRAG
> +
> +    return <<'MAKE_FRAG';
> +signature:
> +     cpansign -s
> +MAKE_FRAG
> +
> +}
> +
> +
>   =item metafile_addtomanifest_target
> 
>     my $target = $mm->metafile_addtomanifest_target
> @@ -630,6 +656,35 @@
> 
>       return sprintf <<'MAKE_FRAG', $add_meta;
>   metafile_addtomanifest:
> +     $(NOECHO) %s
> +MAKE_FRAG
> +
> +}
> +
> +
> +=item signature_addtomanifest_target
> +
> +  my $target = $mm->signature_addtomanifest_target
> +
> +Adds the META.yml file to the MANIFEST.
> +
> +=cut
> +
> +sub signature_addtomanifest_target {
> +    my $self = shift;
> +
> +    return <<'MAKE_FRAG' if !$self->{SIGN};
> +signature_addtomanifest:
> +     $(NOECHO) $(NOOP)
> +MAKE_FRAG
> +
> +    my $add_sign = $self->oneliner(<<'CODE', ['-MExtUtils::Manifest=maniadd']);
> +eval { maniadd({q{SIGNATURE} => q{Public-key signature (added by MakeMaker)}}) }
> +    or print "Could not add SIGNATURE to MANIFEST: $${'@'}\n"
> +CODE
> +
> +    return sprintf <<'MAKE_FRAG', $add_sign;
> +signature_addtomanifest:
>       $(NOECHO) %s
>   MAKE_FRAG
> 
> diff -dur /var/perl-5.8.1/lib/ExtUtils/MM_Unix.pm ExtUtils/MM_Unix.pm
> --- /var/perl-5.8.1/lib/ExtUtils/MM_Unix.pm   Sun Sep 21 19:08:27 2003
> +++ ExtUtils/MM_Unix.pm       Tue Oct 14 17:40:48 2003
> @@ -953,7 +953,7 @@
>       my($self) = shift;
> 
>       return <<'MAKE_FRAG';
> -distdir : metafile metafile_addtomanifest
> +distdir : metafile metafile_addtomanifest signature signature_addtomanifest
>       $(RM_RF) $(DISTVNAME)
>       $(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \
>               -e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
> diff -dur /var/perl-5.8.1/lib/ExtUtils/MakeMaker.pm ExtUtils/MakeMaker.pm
> --- /var/perl-5.8.1/lib/ExtUtils/MakeMaker.pm Tue Sep 16 16:00:37 2003
> +++ ExtUtils/MakeMaker.pm     Tue Oct 14 17:49:33 2003
> @@ -226,7 +226,7 @@
>       PERL_SRC PERM_RW PERM_RWX
>       PL_FILES PM PM_FILTER PMLIBDIRS POLLUTE PPM_INSTALL_EXEC
>       PPM_INSTALL_SCRIPT PREREQ_FATAL PREREQ_PM PREREQ_PRINT PRINT_PREREQ
> -    SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
> +    SIGN SKIP TYPEMAPS VERSION VERSION_FROM XS XSOPT XSPROTOARG
>       XS_VERSION clean depend dist dynamic_lib linkext macro realclean
>       tool_autosplit
> 
> @@ -265,6 +265,7 @@
>    installbin subdirs
>    clean_subdirs clean realclean_subdirs realclean
>    metafile metafile_addtomanifest
> + signature signature_addtomanifest
>    dist_basics dist_core distdir dist_test dist_ci
>    install force perldepend makefile staticmake test ppd
> 
> @@ -1990,6 +1991,16 @@
>   $Config{installprefix} will be used.
> 
>   Overridable by PREFIX
> +
> +=item SIGN
> +
> +When true, perform the generation and addition to the MANIFEST of
> +the SIGNATURE file during 'make distdir', via 'cpansign -s'.
> +
> +Note that you need to install the Module::Signature module to
> +perform this operation.
> +
> +Defaults to false.
> 
>   =item SKIP
> 
-- 
--------------------------------------------------------------------------------
Philippe M. Chiasson /gozer\@(cpan|ectoplasm)\.org/ 88C3A5A5 (122FF51B/C634E37B)
http://gozer.ectoplasm.org/    F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3 A5A5
Q: It is impossible to make anything foolproof because fools are so ingenious.
perl -e'$$=\${gozer};{$_=unpack(P7,pack(L,$$));/^JAm_pH\n$/&&print||$$++&&redo}'

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to