All of lore.kernel.org
 help / color / mirror / Atom feed
* Problem with dependencies in packages
@ 2011-02-13 22:50 Filip Zyzniewski
  2011-02-14  0:29 ` Graham Gower
  2011-02-14 10:35 ` Andreas Oberritter
  0 siblings, 2 replies; 7+ messages in thread
From: Filip Zyzniewski @ 2011-02-13 22:50 UTC (permalink / raw)
  To: openembedded-devel

Hi,

I think I have found a problem with versioned dependencies (or I don't
unserstand something).

I am trying to switch the jlime distribution from ipk to deb packages.
When debugging do_rootfs problems I stumbled upon this:

The following packages have unmet dependencies:
  libncursesw5: Depends: libtinfo5 (>= 5.7+20110115) but 5.7-r16 is to
be installed
E: Broken packages

The Depends line in deb package control file comes from
classes/package_deb.bbclass:do_package_deb():

rdepends = explode_deps(unicode(bb.data.getVar("RDEPENDS", localdata, 1) or ""))
[...]
ctrlfile.write(u"Depends: %s\n" % ", ".join(rdepends))


The dependency string comes from classes/package.bbclass:766:
dep = "%s (>= %s)" % (dep_pkg, ver_needed)

ver_needed comes (in case of ncurses) from .ver files in the build
tree, generated by the same function a bit earlier using pkgver
variable set in lines 657-661:

                pkgver = bb.data.getVar('PKGV_' + pkg, d, True)
                if not pkgver:
                        pkgver = bb.data.getVar('PV_' + pkg, d, True)
                if not pkgver:
                        pkgver = ver

and in ncurses_5.7.bb we have:

PATCHDATE = "20110115"
PKGV = "${PV}+${PATCHDATE}"


Isn't this an incosistency that ncurses_5.7-r16 depends on
libtinfo5_5.7+20110115 ? Shouldn't it depend on libtinfo5_5.7-r16?

What's the reason for this situation? Does opkg somehow compare these
versions in another way causing the problem to be invisible?

bye,
Filip Zyzniewski



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with dependencies in packages
  2011-02-13 22:50 Problem with dependencies in packages Filip Zyzniewski
@ 2011-02-14  0:29 ` Graham Gower
  2011-02-14  0:51   ` Graham Gower
  2011-02-14 10:35 ` Andreas Oberritter
  1 sibling, 1 reply; 7+ messages in thread
From: Graham Gower @ 2011-02-14  0:29 UTC (permalink / raw)
  To: openembedded-devel

On 14 February 2011 09:20, Filip Zyzniewski <filip.zyzniewski@gmail.com> wrote:
> Hi,
>
> I think I have found a problem with versioned dependencies (or I don't
> unserstand something).
>
> I am trying to switch the jlime distribution from ipk to deb packages.
> When debugging do_rootfs problems I stumbled upon this:
>
> The following packages have unmet dependencies:
>  libncursesw5: Depends: libtinfo5 (>= 5.7+20110115) but 5.7-r16 is to
> be installed
> E: Broken packages
>
> The Depends line in deb package control file comes from
> classes/package_deb.bbclass:do_package_deb():
>
> rdepends = explode_deps(unicode(bb.data.getVar("RDEPENDS", localdata, 1) or ""))
> [...]
> ctrlfile.write(u"Depends: %s\n" % ", ".join(rdepends))
>
>
> The dependency string comes from classes/package.bbclass:766:
> dep = "%s (>= %s)" % (dep_pkg, ver_needed)
>
> ver_needed comes (in case of ncurses) from .ver files in the build
> tree, generated by the same function a bit earlier using pkgver
> variable set in lines 657-661:
>
>                pkgver = bb.data.getVar('PKGV_' + pkg, d, True)
>                if not pkgver:
>                        pkgver = bb.data.getVar('PV_' + pkg, d, True)
>                if not pkgver:
>                        pkgver = ver
>
> and in ncurses_5.7.bb we have:
>
> PATCHDATE = "20110115"
> PKGV = "${PV}+${PATCHDATE}"
>
>
> Isn't this an incosistency that ncurses_5.7-r16 depends on
> libtinfo5_5.7+20110115 ? Shouldn't it depend on libtinfo5_5.7-r16?

Probably.

> What's the reason for this situation? Does opkg somehow compare these
> versions in another way causing the problem to be invisible?

Opkg uses the same version comparison as dpkg. In fact, the
verrevcmp() code in opkg was copied verbatim from dpkg. The ascii
values of '+' and '-' are compared, with '+' being lower than '-'.

# opkg compare-versions 5.7-r16 ">=" 5.7+20110115
# echo $?
0

So, 5.7-r16 would be expected to satisfy the dependency in this case.
I am unsure why the version comparison fails for you... maybe the dpkg
comparison code has been changed since it was copied into ipkg?

> bye,
> Filip Zyzniewski

-Graham



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with dependencies in packages
  2011-02-14  0:29 ` Graham Gower
@ 2011-02-14  0:51   ` Graham Gower
  2011-02-14  8:41     ` Filip Zyzniewski
  0 siblings, 1 reply; 7+ messages in thread
From: Graham Gower @ 2011-02-14  0:51 UTC (permalink / raw)
  To: openembedded-devel

On 14 February 2011 10:59, Graham Gower <graham.gower@gmail.com> wrote:
> On 14 February 2011 09:20, Filip Zyzniewski <filip.zyzniewski@gmail.com> wrote:
>> Hi,
>>
>> I think I have found a problem with versioned dependencies (or I don't
>> unserstand something).
>>
>> I am trying to switch the jlime distribution from ipk to deb packages.
>> When debugging do_rootfs problems I stumbled upon this:
>>
>> The following packages have unmet dependencies:
>>  libncursesw5: Depends: libtinfo5 (>= 5.7+20110115) but 5.7-r16 is to
>> be installed
>> E: Broken packages
>>
>> The Depends line in deb package control file comes from
>> classes/package_deb.bbclass:do_package_deb():
>>
>> rdepends = explode_deps(unicode(bb.data.getVar("RDEPENDS", localdata, 1) or ""))
>> [...]
>> ctrlfile.write(u"Depends: %s\n" % ", ".join(rdepends))
>>
>>
>> The dependency string comes from classes/package.bbclass:766:
>> dep = "%s (>= %s)" % (dep_pkg, ver_needed)
>>
>> ver_needed comes (in case of ncurses) from .ver files in the build
>> tree, generated by the same function a bit earlier using pkgver
>> variable set in lines 657-661:
>>
>>                pkgver = bb.data.getVar('PKGV_' + pkg, d, True)
>>                if not pkgver:
>>                        pkgver = bb.data.getVar('PV_' + pkg, d, True)
>>                if not pkgver:
>>                        pkgver = ver
>>
>> and in ncurses_5.7.bb we have:
>>
>> PATCHDATE = "20110115"
>> PKGV = "${PV}+${PATCHDATE}"
>>
>>
>> Isn't this an incosistency that ncurses_5.7-r16 depends on
>> libtinfo5_5.7+20110115 ? Shouldn't it depend on libtinfo5_5.7-r16?
>
> Probably.
>
>> What's the reason for this situation? Does opkg somehow compare these
>> versions in another way causing the problem to be invisible?
>
> Opkg uses the same version comparison as dpkg. In fact, the
> verrevcmp() code in opkg was copied verbatim from dpkg. The ascii
> values of '+' and '-' are compared, with '+' being lower than '-'.
>
> # opkg compare-versions 5.7-r16 ">=" 5.7+20110115
> # echo $?
> 0

I think I may have just confused the issue with misinformation...

The hyphen is used as a delimiter between the version and the revision.
http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version

So the +date is part of the version, not the revision. Both opkg and
dpkg compare the versions and only if they are the same, the revisions
are compared (with the same verrevcmp function).

Furthermore, I assumed that a return code of 0 from opkg
compare-versions meant the comparison was true (like most success
return codes from applications). This is not the case.

# opkg compare-versions 1 ">=" 2 ; echo $?
0
# opkg compare-versions 2 ">=" 1 ; echo $?
1

> So, 5.7-r16 would be expected to satisfy the dependency in this case.
> I am unsure why the version comparison fails for you... maybe the dpkg
> comparison code has been changed since it was copied into ipkg?
>

In fact the dependency shouldn't be satisfied here. Opkg should fail
the same way as dpkg is failing.

-Graham



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with dependencies in packages
  2011-02-14  0:51   ` Graham Gower
@ 2011-02-14  8:41     ` Filip Zyzniewski
  0 siblings, 0 replies; 7+ messages in thread
From: Filip Zyzniewski @ 2011-02-14  8:41 UTC (permalink / raw)
  To: openembedded-devel

On 2/14/11, Graham Gower <graham.gower@gmail.com> wrote:

> In fact the dependency shouldn't be satisfied here. Opkg should fail
> the same way as dpkg is failing.

What should be done then? Should the ncurses recipe be fixed or package.bbclass?

bye,
Filip Zyzniewski



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Problem with dependencies in packages
  2011-02-13 22:50 Problem with dependencies in packages Filip Zyzniewski
  2011-02-14  0:29 ` Graham Gower
@ 2011-02-14 10:35 ` Andreas Oberritter
  2011-02-14 18:52   ` [PATCH] package_deb.bbclass: Use PKGV/PKGR variables where applicable Filip Zyzniewski
  1 sibling, 1 reply; 7+ messages in thread
From: Andreas Oberritter @ 2011-02-14 10:35 UTC (permalink / raw)
  To: openembedded-devel

On 02/13/2011 11:50 PM, Filip Zyzniewski wrote:
> Hi,
> 
> I think I have found a problem with versioned dependencies (or I don't
> unserstand something).
> 
> I am trying to switch the jlime distribution from ipk to deb packages.
> When debugging do_rootfs problems I stumbled upon this:
> 
> The following packages have unmet dependencies:
>   libncursesw5: Depends: libtinfo5 (>= 5.7+20110115) but 5.7-r16 is to
> be installed
> E: Broken packages
> 
> The Depends line in deb package control file comes from
> classes/package_deb.bbclass:do_package_deb():
> 
> rdepends = explode_deps(unicode(bb.data.getVar("RDEPENDS", localdata, 1) or ""))
> [...]
> ctrlfile.write(u"Depends: %s\n" % ", ".join(rdepends))
> 
> 
> The dependency string comes from classes/package.bbclass:766:
> dep = "%s (>= %s)" % (dep_pkg, ver_needed)
> 
> ver_needed comes (in case of ncurses) from .ver files in the build
> tree, generated by the same function a bit earlier using pkgver
> variable set in lines 657-661:
> 
>                 pkgver = bb.data.getVar('PKGV_' + pkg, d, True)
>                 if not pkgver:
>                         pkgver = bb.data.getVar('PV_' + pkg, d, True)
>                 if not pkgver:
>                         pkgver = ver
> 
> and in ncurses_5.7.bb we have:
> 
> PATCHDATE = "20110115"
> PKGV = "${PV}+${PATCHDATE}"
> 
> 
> Isn't this an incosistency that ncurses_5.7-r16 depends on
> libtinfo5_5.7+20110115 ? Shouldn't it depend on libtinfo5_5.7-r16?
> 
> What's the reason for this situation? Does opkg somehow compare these
> versions in another way causing the problem to be invisible?

It looks like deb packages currently use PV where PKGV should be used
instead:

package_ipk.bbclass:
fields.append(["Version: %s:%s-%s\n", ['PE', 'PKGV', 'PKGR']])

package_deb.bbclass:
fields.append(["Version: %s:%s-%s%s\n", ['PE', 'PV', 'PR',  'DISTRO_PR']])

Maybe it's worth factoring out common code for deb and ipk into a new
file to avoid future bit rot.

Regards,
Andreas



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] package_deb.bbclass: Use PKGV/PKGR variables where applicable.
  2011-02-14 10:35 ` Andreas Oberritter
@ 2011-02-14 18:52   ` Filip Zyzniewski
  2011-02-14 19:57     ` [PATCH] package_deb.bbclass: remove double DISTRO_PR from the package version Filip Zyzniewski
  0 siblings, 1 reply; 7+ messages in thread
From: Filip Zyzniewski @ 2011-02-14 18:52 UTC (permalink / raw)
  To: openembedded-devel

Using PV/PR causes problems like libncursesw5_5.7-r16 depending on
libtinfo5 (>= 5.7+20110115).

Signed-off-by: Filip Zyzniewski <filip.zyzniewski@gmail.com>
---
 classes/package_deb.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/classes/package_deb.bbclass b/classes/package_deb.bbclass
index a98ec9d..1f36246 100644
--- a/classes/package_deb.bbclass
+++ b/classes/package_deb.bbclass
@@ -146,9 +146,9 @@ python do_package_deb () {
         fields = []
         pe = bb.data.getVar('PE', d, 1)
         if pe and int(pe) > 0:
-            fields.append(["Version: %s:%s-%s%s\n", ['PE', 'PV', 'PR', 'DISTRO_PR']])
+            fields.append(["Version: %s:%s-%s%s\n", ['PE', 'PKGV', 'PKGR', 'DISTRO_PR']])
         else:
-            fields.append(["Version: %s-%s%s\n", ['PV', 'PR', 'DISTRO_PR']])
+            fields.append(["Version: %s-%s%s\n", ['PKGV', 'PKGR', 'DISTRO_PR']])
         fields.append(["Description: %s\n", ['DESCRIPTION']])
         fields.append(["Section: %s\n", ['SECTION']])
         fields.append(["Priority: %s\n", ['PRIORITY']])
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] package_deb.bbclass: remove double DISTRO_PR from the package version.
  2011-02-14 18:52   ` [PATCH] package_deb.bbclass: Use PKGV/PKGR variables where applicable Filip Zyzniewski
@ 2011-02-14 19:57     ` Filip Zyzniewski
  0 siblings, 0 replies; 7+ messages in thread
From: Filip Zyzniewski @ 2011-02-14 19:57 UTC (permalink / raw)
  To: openembedded-devel

PKGR already contains DISTRO_PR, so no need to add it twice.

Signed-off-by: Filip Zyzniewski <filip.zyzniewski@gmail.com>
---
 classes/package_deb.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/classes/package_deb.bbclass b/classes/package_deb.bbclass
index 1f36246..60e759d 100644
--- a/classes/package_deb.bbclass
+++ b/classes/package_deb.bbclass
@@ -146,9 +146,9 @@ python do_package_deb () {
         fields = []
         pe = bb.data.getVar('PE', d, 1)
         if pe and int(pe) > 0:
-            fields.append(["Version: %s:%s-%s%s\n", ['PE', 'PKGV', 'PKGR', 'DISTRO_PR']])
+            fields.append(["Version: %s:%s-%s\n", ['PE', 'PKGV', 'PKGR']])
         else:
-            fields.append(["Version: %s-%s%s\n", ['PKGV', 'PKGR', 'DISTRO_PR']])
+            fields.append(["Version: %s-%s\n", ['PKGV', 'PKGR']])
         fields.append(["Description: %s\n", ['DESCRIPTION']])
         fields.append(["Section: %s\n", ['SECTION']])
         fields.append(["Priority: %s\n", ['PRIORITY']])
-- 
1.7.1




^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-02-14 19:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-13 22:50 Problem with dependencies in packages Filip Zyzniewski
2011-02-14  0:29 ` Graham Gower
2011-02-14  0:51   ` Graham Gower
2011-02-14  8:41     ` Filip Zyzniewski
2011-02-14 10:35 ` Andreas Oberritter
2011-02-14 18:52   ` [PATCH] package_deb.bbclass: Use PKGV/PKGR variables where applicable Filip Zyzniewski
2011-02-14 19:57     ` [PATCH] package_deb.bbclass: remove double DISTRO_PR from the package version Filip Zyzniewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.