[140584] trunk/dports/perl

khindenburg at macports.org khindenburg at macports.org
Thu Sep 24 18:23:08 PDT 2015


Revision: 140584
          https://trac.macports.org/changeset/140584
Author:   khindenburg at macports.org
Date:     2015-09-24 18:23:08 -0700 (Thu, 24 Sep 2015)
Log Message:
-----------
p5-musicbrainz-discid: new port - needed for abcde-musicbrainz-tool; patches from Debian

Added Paths:
-----------
    trunk/dports/perl/p5-musicbrainz-discid/
    trunk/dports/perl/p5-musicbrainz-discid/Portfile
    trunk/dports/perl/p5-musicbrainz-discid/files/
    trunk/dports/perl/p5-musicbrainz-discid/files/pod-encoding.patch
    trunk/dports/perl/p5-musicbrainz-discid/files/stack-corruption-discid_put.patch
    trunk/dports/perl/p5-musicbrainz-discid/files/url.patch

Added: trunk/dports/perl/p5-musicbrainz-discid/Portfile
===================================================================
--- trunk/dports/perl/p5-musicbrainz-discid/Portfile	                        (rev 0)
+++ trunk/dports/perl/p5-musicbrainz-discid/Portfile	2015-09-25 01:23:08 UTC (rev 140584)
@@ -0,0 +1,30 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem          1.0
+PortGroup           perl5 1.0
+
+perl5.branches      5.16 5.18 5.20 5.22
+perl5.setup         MusicBrainz-DiscID 0.03
+platforms           darwin
+maintainers         khindenburg openmaintainer
+license             GPL-2+
+supported_archs     noarch
+
+description         Perl binding for the libdiscid library.
+long_description    ${description}
+
+checksums           rmd160  06ddcdf08dc27bc8860541aca121f86e39cfcded \
+                    sha256  5002f92fd8f074bccf924752ef171fa11ea2431a634ff60e520a5c3fb080573a
+
+patch.pre_args      -p1
+patchfiles          pod-encoding.patch \
+                    stack-corruption-discid_put.patch \
+                    url.patch
+
+if {${perl5.major} != ""} {
+    depends_build-append    port:pkgconfig
+    depends_lib-append      port:libdiscid
+}
+
+perl5.use_module_build


Property changes on: trunk/dports/perl/p5-musicbrainz-discid/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: trunk/dports/perl/p5-musicbrainz-discid/files/pod-encoding.patch
===================================================================
--- trunk/dports/perl/p5-musicbrainz-discid/files/pod-encoding.patch	                        (rev 0)
+++ trunk/dports/perl/p5-musicbrainz-discid/files/pod-encoding.patch	2015-09-25 01:23:08 UTC (rev 140584)
@@ -0,0 +1,19 @@
+Description: use plain ascii apostrophe
+Origin: vendor
+Bug: https://rt.cpan.org/Ticket/Display.html?id=85212
+Bug-Debian: http://bugs.debian.org/708079
+Forwarded: https://rt.cpan.org/Ticket/Display.html?id=85212
+Author: gregor herrmann <gregoa at debian.org>
+Last-Update: 2013-05-13
+
+--- a/lib/MusicBrainz/DiscID.pm
++++ b/lib/MusicBrainz/DiscID.pm
+@@ -156,7 +156,7 @@
+ Construct a new DiscID object.
+ 
+ As an optional argument the name of the device to read the ID from may 
+-be given. If you don\xD4t specify a device here you can later read the ID with 
++be given. If you don't specify a device here you can later read the ID with
+ the read method.
+ 
+ =item $discid->error_msg()

Added: trunk/dports/perl/p5-musicbrainz-discid/files/stack-corruption-discid_put.patch
===================================================================
--- trunk/dports/perl/p5-musicbrainz-discid/files/stack-corruption-discid_put.patch	                        (rev 0)
+++ trunk/dports/perl/p5-musicbrainz-discid/files/stack-corruption-discid_put.patch	2015-09-25 01:23:08 UTC (rev 140584)
@@ -0,0 +1,57 @@
+Description: stack corruption in discid_put
+ This patch fixes two ways to corrupt the stack. One is by supplying
+ more that 99 offset arguments. The offsets array is declared with space
+ for 100 elements, but the first is reserved for the sectors argument.
+ The patch addresses this by limitting the filling of offsets[] to 99 elements
+ (plus the sectors argument which is in offsets[0]). It relies on libdiscid
+ to return false if the request was for more than 99 offsets.
+ .
+ The second stack corruption is because of a typo in the initialization
+ for loop. Because of that, the for loop is essentially reduced to
+ "i=100" and the following line (not part of the loop) sets
+ offsets[100], which is beyond the allocated space for the array. Using
+ memset is safer and probably faster.
+Author: Damyan Ivanov <dmn at debian.org>
+Bug-Debian: https://bugs.debian.org/758216
+Bug: https://rt.cpan.org/Ticket/Display.html?id=98179
+
+--- a/lib/MusicBrainz/DiscID.xs
++++ b/lib/MusicBrainz/DiscID.xs
+@@ -124,12 +124,13 @@ discid_put( disc, first_track, sectors,
+   DiscId *disc
+   int first_track
+   int sectors
++  int n_items = items;
+   PREINIT:
+ 	  int i, last_track, offsets[100];
+   CODE:
+-	  for (i=0;i<100;i++);
+-	      offsets[i] = 0;
+-    for (i=3; i<items; i++) {
++    memset(offsets, 0, sizeof(offsets));
++    if (items > 102 ) n_items = 102;  // rely on discid_put to return error
++    for (i=3; i<n_items; i++) {
+         offsets[i-2] = (int)SvIV(ST(i));
+     }
+     offsets[0] = sectors;
+--- a/t/10discid.t
++++ b/t/10discid.t
+@@ -5,7 +5,7 @@ use strict;
+ use Test::More;
+ 
+ # use a BEGIN block so we print our plan before modules are loaded
+-BEGIN { plan tests => 54 }
++BEGIN { plan tests => 56 }
+ 
+ # load modules
+ use MusicBrainz::DiscID;
+@@ -16,6 +16,9 @@ my $disc = new MusicBrainz::DiscID();
+ ok( $disc );
+ is(ref $disc, 'MusicBrainz::DiscID');
+ 
++ok( !$disc->put( 1, 140, 1 .. 100 ) );
++
++is( $disc->error_msg, "Illegal track limits" );
+ 
+ ok( $disc->put( 1, 303602,
+                 150, 9700, 25887, 39297, 53795, 63735, 77517, 94877, 107270,

Added: trunk/dports/perl/p5-musicbrainz-discid/files/url.patch
===================================================================
--- trunk/dports/perl/p5-musicbrainz-discid/files/url.patch	                        (rev 0)
+++ trunk/dports/perl/p5-musicbrainz-discid/files/url.patch	2015-09-25 01:23:08 UTC (rev 140584)
@@ -0,0 +1,23 @@
+Description: libdiscid 0.6.x has updated the URLs
+ modify test to accept old and new ones
+Origin: vendor
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=89285
+Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=89285
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=725584
+Author: gregor herrmann <gregoa at debian.org>
+Reviewed-by: gregor herrmann <gregoa at debian.org>
+Last-Update: 2013-11-26
+
+--- a/t/10discid.t
++++ b/t/10discid.t
+@@ -28,8 +28,8 @@
+ is( $disc->freedb_id, '370fce16');
+ is( $disc->last_track_num, 22);
+ is( $disc->sectors, 303602);
+-is( $disc->submission_url, 'http://mm.musicbrainz.org/bare/cdlookup.html?id=xUp1F2NkfP8s8jaeFn_Av3jNEI4-&tracks=22&toc=1+22+303602+150+9700+25887+39297+53795+63735+77517+94877+107270+123552+135522+148422+161197+174790+192022+205545+218010+228700+239590+255470+266932+288750');
+-is( $disc->webservice_url, 'http://mm.musicbrainz.org/ws/1/release?type=xml&discid=xUp1F2NkfP8s8jaeFn_Av3jNEI4-&toc=1+22+303602+150+9700+25887+39297+53795+63735+77517+94877+107270+123552+135522+148422+161197+174790+192022+205545+218010+228700+239590+255470+266932+288750');
++like( $disc->submission_url, qr{http://(mm\.musicbrainz\.org/bare/cdlookup\.html|musicbrainz\.org/cdtoc/attach)\?id=xUp1F2NkfP8s8jaeFn_Av3jNEI4-&tracks=22&toc=1\+22\+303602\+150\+9700\+25887\+39297\+53795\+63735\+77517\+94877\+107270\+123552\+135522\+148422\+161197\+174790\+192022\+205545\+218010\+228700\+239590\+255470\+266932\+288750});
++like( $disc->webservice_url, qr{http://(mm\.)?musicbrainz\.org/ws/1/release\?type=xml&discid=xUp1F2NkfP8s8jaeFn_Av3jNEI4-&toc=1\+22\+303602\+150\+9700\+25887\+39297\+53795\+63735\+77517\+94877\+107270\+123552\+135522\+148422\+161197\+174790\+192022\+205545\+218010\+228700\+239590\+255470\+266932\+288750});
+ 
+ is( $disc->track_offset(1), 150);
+ is( $disc->track_offset(2), 9700);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150924/e89671af/attachment.html>


More information about the macports-changes mailing list