[81457] contrib/cpan2port/cpan2port

dports at macports.org dports at macports.org
Sat Jul 30 22:04:04 PDT 2011


Revision: 81457
          http://trac.macports.org/changeset/81457
Author:   dports at macports.org
Date:     2011-07-30 22:04:04 -0700 (Sat, 30 Jul 2011)
Log Message:
-----------
cpan2port: use sha256 instead of sha1; line-wrap checksums and
depends lines in generated portfile

Modified Paths:
--------------
    contrib/cpan2port/cpan2port

Modified: contrib/cpan2port/cpan2port
===================================================================
--- contrib/cpan2port/cpan2port	2011-07-31 05:02:50 UTC (rev 81456)
+++ contrib/cpan2port/cpan2port	2011-07-31 05:04:04 UTC (rev 81457)
@@ -179,7 +179,7 @@
     my ($info) = shift;
     my $tarball = $$info{tarball} or die;
     my %check;
-    for my $k (qw( sha1 rmd160)) {
+    for my $k (qw( sha256 rmd160)) {
         my ($sum) = qx( openssl $k $tarball);
         my ($v)   = $sum =~ / (.*)/;
         $check{$k} = $v;
@@ -220,7 +220,9 @@
     my $build_depends = '';
     if ( exists $$info{depends} ) {
          if ( my $check =  $$info{checksums} ) {
-             $checksums = join (' ', 'checksums', %{ $check });
+             my @hashes;
+             foreach my $key (keys %{ $check }) { push @hashes, "$key ".$$check{$key}; }
+             $checksums = 'checksums   '.join(" \\\n".(' 'x12), at hashes);
          }
 
          if ( my $dep_ref = Huggy::depends_on($info) ) {
@@ -229,7 +231,7 @@
                  'port:'.Huggy::from_port $_
              } keys %{ $dep_ref };
              if (@depends) {
-                 $depends = join ' ','depends_lib-append', at depends;
+                 $depends = 'depends_lib-append  '.join(" \\\n".(' 'x20), at depends);
              }
 
          }
@@ -268,6 +270,7 @@
 
     $portfile .= <<STOP;
 $checksums
+
 $depends
 $build_depends
 STOP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110730/b2f4aeec/attachment.html>


More information about the macports-changes mailing list