<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[140584] trunk/dports/perl</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/140584">140584</a></dd>
<dt>Author</dt> <dd>khindenburg@macports.org</dd>
<dt>Date</dt> <dd>2015-09-24 18:23:08 -0700 (Thu, 24 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>p5-musicbrainz-discid: new port - needed for abcde-musicbrainz-tool; patches from Debian</pre>

<h3>Added Paths</h3>
<ul>
<li>trunk/dports/perl/p5-musicbrainz-discid/</li>
<li><a href="#trunkdportsperlp5musicbrainzdiscidPortfile">trunk/dports/perl/p5-musicbrainz-discid/Portfile</a></li>
<li>trunk/dports/perl/p5-musicbrainz-discid/files/</li>
<li><a href="#trunkdportsperlp5musicbrainzdiscidfilespodencodingpatch">trunk/dports/perl/p5-musicbrainz-discid/files/pod-encoding.patch</a></li>
<li><a href="#trunkdportsperlp5musicbrainzdiscidfilesstackcorruptiondiscid_putpatch">trunk/dports/perl/p5-musicbrainz-discid/files/stack-corruption-discid_put.patch</a></li>
<li><a href="#trunkdportsperlp5musicbrainzdiscidfilesurlpatch">trunk/dports/perl/p5-musicbrainz-discid/files/url.patch</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsperlp5musicbrainzdiscidPortfile"></a>
<div class="addfile"><h4>Added: trunk/dports/perl/p5-musicbrainz-discid/Portfile (0 => 140584)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+# -*- 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} != &quot;&quot;} {
+    depends_build-append    port:pkgconfig
+    depends_lib-append      port:libdiscid
+}
+
+perl5.use_module_build
</ins><span class="cx">Property changes on: trunk/dports/perl/p5-musicbrainz-discid/Portfile
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkdportsperlp5musicbrainzdiscidfilespodencodingpatch"></a>
<div class="addfile"><h4>Added: trunk/dports/perl/p5-musicbrainz-discid/files/pod-encoding.patch (0 => 140584)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+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 &lt;gregoa@debian.org&gt;
+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-&gt;error_msg()
</ins></span></pre></div>
<a id="trunkdportsperlp5musicbrainzdiscidfilesstackcorruptiondiscid_putpatch"></a>
<div class="addfile"><h4>Added: trunk/dports/perl/p5-musicbrainz-discid/files/stack-corruption-discid_put.patch (0 => 140584)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+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
+ &quot;i=100&quot; 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 &lt;dmn@debian.org&gt;
+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&lt;100;i++);
+-              offsets[i] = 0;
+-    for (i=3; i&lt;items; i++) {
++    memset(offsets, 0, sizeof(offsets));
++    if (items &gt; 102 ) n_items = 102;  // rely on discid_put to return error
++    for (i=3; i&lt;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 =&gt; 54 }
++BEGIN { plan tests =&gt; 56 }

+ # load modules
+ use MusicBrainz::DiscID;
+@@ -16,6 +16,9 @@ my $disc = new MusicBrainz::DiscID();
+ ok( $disc );
+ is(ref $disc, 'MusicBrainz::DiscID');

++ok( !$disc-&gt;put( 1, 140, 1 .. 100 ) );
++
++is( $disc-&gt;error_msg, &quot;Illegal track limits&quot; );

+ ok( $disc-&gt;put( 1, 303602,
+                 150, 9700, 25887, 39297, 53795, 63735, 77517, 94877, 107270,
</ins></span></pre></div>
<a id="trunkdportsperlp5musicbrainzdiscidfilesurlpatch"></a>
<div class="addfile"><h4>Added: trunk/dports/perl/p5-musicbrainz-discid/files/url.patch (0 => 140584)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+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 &lt;gregoa@debian.org&gt;
+Reviewed-by: gregor herrmann &lt;gregoa@debian.org&gt;
+Last-Update: 2013-11-26
+
+--- a/t/10discid.t
++++ b/t/10discid.t
+@@ -28,8 +28,8 @@
+ is( $disc-&gt;freedb_id, '370fce16');
+ is( $disc-&gt;last_track_num, 22);
+ is( $disc-&gt;sectors, 303602);
+-is( $disc-&gt;submission_url, 'http://mm.musicbrainz.org/bare/cdlookup.html?id=xUp1F2NkfP8s8jaeFn_Av3jNEI4-&amp;tracks=22&amp;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-&gt;webservice_url, 'http://mm.musicbrainz.org/ws/1/release?type=xml&amp;discid=xUp1F2NkfP8s8jaeFn_Av3jNEI4-&amp;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-&gt;submission_url, qr{http://(mm\.musicbrainz\.org/bare/cdlookup\.html|musicbrainz\.org/cdtoc/attach)\?id=xUp1F2NkfP8s8jaeFn_Av3jNEI4-&amp;tracks=22&amp;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-&gt;webservice_url, qr{http://(mm\.)?musicbrainz\.org/ws/1/release\?type=xml&amp;discid=xUp1F2NkfP8s8jaeFn_Av3jNEI4-&amp;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-&gt;track_offset(1), 150);
+ is( $disc-&gt;track_offset(2), 9700);
</ins></span></pre>
</div>
</div>

</body>
</html>