Unexpected behaviour, range based dependency update.

George Bartlett <[email protected]> Wed, 1 Feb 2017 22:24:23 +0000
Newsgroups gmane.linux.rpm.yum
Message-ID <DB3PR08MB0155ADB56896C90611253D70B84D0@DB3PR08MB0155.eurprd08.prod.outlook.com>
--===============8120317454688349631==
Content-Language: en-GB
Content-Type: multipart/alternative;
	boundary="_000_DB3PR08MB0155ADB56896C90611253D70B84D0DB3PR08MB0155eurp_"

--_000_DB3PR08MB0155ADB56896C90611253D70B84D0DB3PR08MB0155eurp_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,


I have come across some unexpected behaviour when updating packages which h=
ave dependencies which also need updating. I own a package which is a depen=
dency of a number in house applications. I constantly maintain, update and =
release new versions of this library package. Application packages which de=
pend on this library package specify their requirement as a range i.e. libe=
xample >=3D 1.0.0, libexample < 2.0.0.  I have recreated the scenario as fo=
llows:

  *   I have released libexample-1.0.0, libexample-2.0.0 and libexample-3.0=
.0 to a local yum repo.
  *   I have also released 2 application rpm's which have this library pack=
age as a dependency, to the same repo:
     *   exampleapp-1.0.0 depends on libexample >=3D 1.0.0, libexample < 2.=
0.0 (as specified in the spec file of exampleapp-1.0.0)
     *   exampleapp-2.0.0 depends on libexample >=3D 2.0.0, libexample < 3.=
0.0 (again, as per the apps spec file)
  *   No applications yet use libexample-3.0.0.

This causes the following behaviour, starting from a clean system:

>> yum install exampleapp-1.0.0
Resolving Dependencies
--> Running transaction check
---> Package exampleapp.x86_64 0:1.0.0-1 will be installed
--> Processing Dependency: libexample < 2.0.0 for package: exampleapp-1.0.0=
-1.x86_64
--> Processing Dependency: libexample >=3D 1.0.0 for package: exampleapp-1.=
0.0-1.x86_64
--> Running transaction check
---> Package libexample.x86_64 0:1.0.0-1 will be installed
--> Finished Dependency Resolution

All works fine, then try and update:

>> yum update exampleapp
--> Running transaction check
---> Package exampleapp.x86_64 0:1.0.0-1 will be updated
---> Package exampleapp.x86_64 0:2.0.0-1 will be an update
--> Processing Dependency: libexample >=3D 2.0.0 for package: exampleapp-2.=
0.0-1.x86_64
--> Running transaction check
---> Package libexample.x86_64 0:1.0.0-1 will be updated
--> Processing Dependency: libexample < 3.0.0 for package: exampleapp-2.0.0=
-1.x86_64
---> Package libexample.x86_64 0:3.0.0-1 will be an update
--> Finished Dependency Resolution
Error: Package: exampleapp-2.0.0-1.x86_64 (local)
           Requires: libexample < 3.0.0
           Removing: libexample-1.0.0-1.x86_64 (@local)
               libexample =3D 1.0.0-1
           Updated By: libexample-3.0.0-1.x86_64 (local)
               libexample =3D 3.0.0-1
           Available: libexample-2.0.0-1.x86_64 (local)
               libexample =3D 2.0.0-1
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest


The output suggests that yum has realised that libexample should be less th=
an (and not include) 3.0.0, but it appears to ignore it and attempt to upda=
te to the latest available version of libexample. Am I missing something he=
re? Any help would be greatly appreciated.

Many thanks

George

--_000_DB3PR08MB0155ADB56896C90611253D70B84D0DB3PR08MB0155eurp_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"><!-- P {margin-top:0;margi=
n-bottom:0;} --></style>
</head>
<body dir=3D"ltr">
<div id=3D"divtagdefaultwrapper" style=3D"font-size:12pt;color:#000000;font=
-family:Calibri,Arial,Helvetica,sans-serif;" dir=3D"ltr">
<p>Hi,</p>
<p><br>
</p>
<p>I have come across some unexpected behaviour when&nbsp;updating&nbsp;pac=
kages which have dependencies which also need updating.&nbsp;<span style=3D=
"font-size: 12pt;">I own a package which is a dependency</span><span style=
=3D"font-size: 12pt;">&nbsp;of a number&nbsp;</span><span style=3D"font-siz=
e: 12pt;">in
 house applications. I constantly maintain,&nbsp;</span><span style=3D"font=
-size: 12pt;">update and release new versions of this library package</span=
><span style=3D"font-size: 12pt;">.&nbsp;</span><span style=3D"font-size: 1=
2pt;">Application packages&nbsp;</span><span style=3D"font-size: 12pt;">whi=
ch
 depend</span><span style=3D"font-size: 12pt;">&nbsp;on&nbsp;</span><span s=
tyle=3D"font-size: 12pt;">this library package&nbsp;</span><span style=3D"f=
ont-size: 12pt;">specify their requirement as a range i.e. libexample &gt;=
=3D 1.0.0, libexample&nbsp;</span><span style=3D"font-size: 12pt;">&lt;
 2.0.0. &nbsp;I have recreated the scenario as follows:</span></p>
<p></p>
<div>
<ul>
<li>I have released libexample-1.0.0, libexample-2.0.0 and libexample-3.0.0=
 to a local yum repo.</li><li>I have also released 2 application rpm's whic=
h have this library package as a dependency, to the same repo:
<ul>
<li>exampleapp-1.0.0 depends on libexample &gt;=3D 1.0.0, libexample &lt; 2=
.0.0 (as specified in the spec file of exampleapp-1.0.0)</li><li>exampleapp=
-2.0.0 depends on libexample &gt;=3D 2.0.0, libexample &lt; 3.0.0 (again, a=
s per the apps spec&nbsp;file)</li></ul>
</li><li>No applications yet use libexample-3.0.0.</li></ul>
<div>This causes the following behaviour, starting from a clean system:</di=
v>
<div><br>
</div>
<div><span style=3D"font-size: 12pt;">&gt;&gt; <b>yum install exampleapp-1.=
0.0</b></span></div>
<div><span style=3D"font-size: 12pt;">
<div>Resolving Dependencies</div>
<div>--&gt; Running transaction check</div>
<div>---&gt; Package exampleapp.x86_64 0:1.0.0-1 will be installed</div>
<div>--&gt; Processing Dependency: libexample &lt; 2.0.0 for package: examp=
leapp-1.0.0-1.x86_64</div>
<div>--&gt; Processing Dependency: libexample &gt;=3D 1.0.0 for package: ex=
ampleapp-1.0.0-1.x86_64</div>
<div>--&gt; Running transaction check</div>
<div>---&gt; Package libexample.x86_64 0:1.0.0-1 will be installed</div>
<div>--&gt; Finished Dependency Resolution</div>
<div><br>
</div>
<div>All works fine, then try and update:</div>
<div><br>
</div>
<div>&gt;&gt; <b>yum update exampleapp</b></div>
<div>
<div>--&gt; Running transaction check</div>
<div>---&gt; Package exampleapp.x86_64 0:1.0.0-1 will be updated</div>
<div>---&gt; Package exampleapp.x86_64 0:2.0.0-1 will be an update</div>
<div>--&gt; Processing Dependency: libexample &gt;=3D 2.0.0 for package: ex=
ampleapp-2.0.0-1.x86_64</div>
<div>--&gt; Running transaction check</div>
<div>---&gt; Package libexample.x86_64 0:1.0.0-1 will be updated</div>
<div>--&gt; Processing Dependency: <b>libexample &lt; 3.0.0</b> for package=
: exampleapp-2.0.0-1.x86_64</div>
<div>---&gt; Package <b>libexample.x86_64 0:3.0.0-1 will be an update</b></=
div>
<div>--&gt; Finished Dependency Resolution</div>
<div>Error: Package: exampleapp-2.0.0-1.x86_64 (local)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Requires: libexample &lt; 3.0=
.0</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Removing: libexample-1.0.0-1.=
x86_64 (@local)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;libexample =3D =
1.0.0-1</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Updated By: libexample-3.0.0-=
1.x86_64 (local)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;libexample =3D =
3.0.0-1</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Available: libexample-2.0.0-1=
.x86_64 (local)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;libexample =3D =
2.0.0-1</div>
<div>&nbsp;You could try using --skip-broken to work around the problem</di=
v>
<div>&nbsp;You could try running: rpm -Va --nofiles --nodigest</div>
<div><br>
</div>
<div><br>
</div>
<div>The output suggests that yum has realised that libexample should be le=
ss than (and not include)&nbsp;3.0.0, but it appears&nbsp;to ignore it and =
attempt to&nbsp;update to the latest available version of libexample. Am I =
missing something here? Any help would be greatly
 appreciated.&nbsp;</div>
<div><br>
</div>
<div>Many thanks</div>
<div><br>
</div>
<div>George</div>
</div>
</span></div>
</div>
<p></p>
</div>
</body>
</html>

--_000_DB3PR08MB0155ADB56896C90611253D70B84D0DB3PR08MB0155eurp_--

--===============8120317454688349631==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Yum mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum

--===============8120317454688349631==--