<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:384766828;
mso-list-type:hybrid;
mso-list-template-ids:1004176098 128072004 67895299 67895301 67895297 67895299 67895301 67895297 67895299 67895301;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US">I am having an issue with pkgutil when trying to install a package with a specific version of a dependency.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Basically my use case is very simple:<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">I have created two revisions of a package bar:
<o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US">bar-0.1,REV=2017.06.21-SunOS5.10-i386-XYZ.pkg.gz<o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US">bar-0.1,REV=2017.06.25-SunOS5.10-i386-XYZ.pkg.gz<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">I have created a package foo where I specified in the depend file a dependency to bar-0.1,REV=2017.06.21:<o:p></o:p></span></p>
<p class="MsoListParagraph"><span lang="EN-US">P bar-0.1,REV=2017.06.21 bar - my bar package<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span lang="EN-US"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span lang="EN-US">I try to install foo and I expect to have it install specifically the version 0.1,REV=2017.06.21 of the bar package<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">It fails and I end up with a very weird output in pkgutil:<o:p></o:p></span></p>
<div style="mso-element:para-border-div;border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt">
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">$ pkgutil -i -y -D foo
<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">Install 1 NEW packages:<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">DEBUG:Parsing catalog ... looking for: bar-0.1,REV=2017.06.21-0.1,REV=2017.06.21 (mode 3)<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">DEBUG: pkg: bar-0.1,REV=2017.06.21-0.1,REV=2017.06.21<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">DEBUG: vers: 0.1,REV=2017.06.21<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">DEBUG: tryname: bar-0.1,REV=2017.06.21<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">DEBUG:Return value: not in catalog<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">Can't use an undefined value as an ARRAY reference at /opt/csw/bin/pkgutil line 687.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The issue seems to be that somehow pkgutil ends up looking for my package with two times the version in its name.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I tried to debug to find out why but I could not pinpoint the origin of the problem.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">As a workaround, I patched pkgutil to add the following lines in the parse_catalog function to suppress this redundant version token:<o:p></o:p></span></p>
<div style="mso-element:para-border-div;border:solid windowtext 1.0pt;padding:1.0pt 4.0pt 1.0pt 4.0pt">
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US"># Do we have an embedded version?<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">my @p = split /-/, $pkg ;<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">my $vers = pop @p;<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">if(scalar @p > 1) {<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US"> print STDERR "DEBUG: too many version tokens found\n" if $debug;<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US"> @p = $p[0];<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">}<o:p></o:p></span></p>
<p class="MsoNormal" style="border:none;padding:0cm"><span lang="EN-US">my $tryname = join( '-', @p );<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">My question is, did I made a mistake in the bar dependency definition in the foo package depend file?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">The <a href="https://docs.oracle.com/cd/E26505_01/html/816-5174/depend-4.html#REFMAN4depend-4">
depend documentation</a> says that the version should be specified on a new line starting with some whitespace but it did not work in my case (it ended taking the latest revision).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">What is the correct way to specify the revision of a package dependency?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:FR">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:FR">Antoine<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<p class="ecxMsoNormal" style="line-height: 19px; margin: 0px 0px 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; color: #2a2a2a; ">*******************************</p><p class="ecxMsoNormal" style="line-height: 19px; margin: 0px 0px 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif; color: #2a2a2a; "><span lang="EN-GB" style="line-height: 17px; font-size: 10pt; color: black; font-family: Arial; ">This e-mail contains information for the intended recipient only. It may contain proprietary material or confidential information. If you are not the intended recipient you are not authorised to distribute, copy or use this e-mail or any attachment to it. </span><span style="font-family: Arial" color="black" size="2"><span style="line-height: 17px; font-size: 10pt; ">Murex cannot guarantee that it is virus free and accepts no responsibility for any loss or damage arising from its use. If you have received this e-mail in error please notify immediately the sender and delete the original email received, any attachments and all copies from your system.</span></span></p></body>
</html>