* Re: [oe-commits] Martin Jansa : xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa [not found] <20120927142926.CA9C5103AC@opal> @ 2012-09-27 15:34 ` Martin Jansa 2012-09-27 17:55 ` Martin Jansa 0 siblings, 1 reply; 13+ messages in thread From: Martin Jansa @ 2012-09-27 15:34 UTC (permalink / raw) To: openembedded-core; +Cc: openembedded-commits [-- Attachment #1: Type: text/plain, Size: 2841 bytes --] On Thu, Sep 27, 2012 at 02:29:25PM +0000, git@git.openembedded.org wrote: > Module: openembedded-core.git > Branch: master > Commit: ed0216d29fc4355c5220f3ad51df04a63cacb0c3 > URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=ed0216d29fc4355c5220f3ad51df04a63cacb0c3 > > Author: Martin Jansa <martin.jansa@gmail.com> > Date: Sat Sep 22 19:13:14 2012 +0200 > > xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa > > * it doesn't make much sense with PV, because xserver-xorg-module-exa > was introduced in > http://git.openembedded.org/openembedded-core/commit/meta/recipes-graphics/xorg-xserver?id=1a666ee1cda3c0b74daba5881fc5f62e13deec66 > so our xserver-xorg-module-exa RCONFLICTS with xserver-xorg (<= 1.11.2-r4) > and (< 1.11.2) is not good enough > > * because we don't know how many PRINC are in BSP/DISTRO layers, > then it's safer to RCONFLICTS with every older version then current > EXTENDPKGV > > Also fixes whitespace to work correctly with opkg The whitespace problem wasn't opkg fault AFAIK, but bb.utils.explode_dep_versions as shown in http://patchwork.openembedded.org/patch/37069/ Cheers > > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> > > -- > > * I haven't really tested this with IPK, since it was changed from > RREPLACES to RCONFLICTS (because of RPM) and all my installed devices > are already upgraded > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> > > --- > > .../recipes-graphics/xorg-xserver/xserver-xorg.inc | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc b/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc > index 643ca70..7513399 100644 > --- a/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc > +++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc > @@ -66,7 +66,7 @@ PACKAGES =+ "${PN}-security-policy \ > > RRECOMMENDS_${PN} += "${PN}-security-policy xkeyboard-config rgb xserver-xf86-config" > RDEPENDS_${PN}-xvfb += "xkeyboard-config" > -RCONFLICTS_${PN}-module-exa = "${PN} (<${PV})" > +RCONFLICTS_${PN}-module-exa = "${PN} (< ${EXTENDPKGV})" > > FILES_${PN} = "${bindir} ${libdir}/X11/Options ${libdir}/X11/Cards ${libdir}/X11/getconfig ${libdir}/X11/etc ${libdir}/modules/*.so ${libdir}/xorg/modules/*.so /etc/X11 ${libdir}/xorg/protocol.txt ${datadir}/X11/xorg.conf.d" > FILES_${PN}-dev += "${libdir}/xorg/modules/*.la ${libdir}/xorg/modules/*/*.la" > > > _______________________________________________ > Openembedded-commits mailing list > Openembedded-commits@lists.openembedded.org > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-commits -- Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 205 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [oe-commits] Martin Jansa : xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa 2012-09-27 15:34 ` [oe-commits] Martin Jansa : xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa Martin Jansa @ 2012-09-27 17:55 ` Martin Jansa 2012-09-27 18:08 ` Otavio Salvador 0 siblings, 1 reply; 13+ messages in thread From: Martin Jansa @ 2012-09-27 17:55 UTC (permalink / raw) To: openembedded-core; +Cc: openembedded-commits [-- Attachment #1: Type: text/plain, Size: 3186 bytes --] On Thu, Sep 27, 2012 at 05:34:19PM +0200, Martin Jansa wrote: > On Thu, Sep 27, 2012 at 02:29:25PM +0000, git@git.openembedded.org wrote: > > Module: openembedded-core.git > > Branch: master > > Commit: ed0216d29fc4355c5220f3ad51df04a63cacb0c3 > > URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=ed0216d29fc4355c5220f3ad51df04a63cacb0c3 > > > > Author: Martin Jansa <martin.jansa@gmail.com> > > Date: Sat Sep 22 19:13:14 2012 +0200 > > > > xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa > > > > * it doesn't make much sense with PV, because xserver-xorg-module-exa > > was introduced in > > http://git.openembedded.org/openembedded-core/commit/meta/recipes-graphics/xorg-xserver?id=1a666ee1cda3c0b74daba5881fc5f62e13deec66 > > so our xserver-xorg-module-exa RCONFLICTS with xserver-xorg (<= 1.11.2-r4) > > and (< 1.11.2) is not good enough > > > > * because we don't know how many PRINC are in BSP/DISTRO layers, > > then it's safer to RCONFLICTS with every older version then current > > EXTENDPKGV > > > > Also fixes whitespace to work correctly with opkg > > The whitespace problem wasn't opkg fault AFAIK, but > bb.utils.explode_dep_versions as shown in > http://patchwork.openembedded.org/patch/37069/ Ah and it was meant to be applied together with this patch, so now it's missing PR bump.. Cheers, > > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> > > > > -- > > > > * I haven't really tested this with IPK, since it was changed from > > RREPLACES to RCONFLICTS (because of RPM) and all my installed devices > > are already upgraded > > Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> > > > > --- > > > > .../recipes-graphics/xorg-xserver/xserver-xorg.inc | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc b/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc > > index 643ca70..7513399 100644 > > --- a/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc > > +++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc > > @@ -66,7 +66,7 @@ PACKAGES =+ "${PN}-security-policy \ > > > > RRECOMMENDS_${PN} += "${PN}-security-policy xkeyboard-config rgb xserver-xf86-config" > > RDEPENDS_${PN}-xvfb += "xkeyboard-config" > > -RCONFLICTS_${PN}-module-exa = "${PN} (<${PV})" > > +RCONFLICTS_${PN}-module-exa = "${PN} (< ${EXTENDPKGV})" > > > > FILES_${PN} = "${bindir} ${libdir}/X11/Options ${libdir}/X11/Cards ${libdir}/X11/getconfig ${libdir}/X11/etc ${libdir}/modules/*.so ${libdir}/xorg/modules/*.so /etc/X11 ${libdir}/xorg/protocol.txt ${datadir}/X11/xorg.conf.d" > > FILES_${PN}-dev += "${libdir}/xorg/modules/*.la ${libdir}/xorg/modules/*/*.la" > > > > > > _______________________________________________ > > Openembedded-commits mailing list > > Openembedded-commits@lists.openembedded.org > > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-commits > > -- > Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com -- Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 205 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [oe-commits] Martin Jansa : xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa 2012-09-27 17:55 ` Martin Jansa @ 2012-09-27 18:08 ` Otavio Salvador 2012-09-27 22:41 ` Mark Hatle 0 siblings, 1 reply; 13+ messages in thread From: Otavio Salvador @ 2012-09-27 18:08 UTC (permalink / raw) To: Martin Jansa; +Cc: openembedded-commits, openembedded-core On Thu, Sep 27, 2012 at 2:55 PM, Martin Jansa <martin.jansa@gmail.com> wrote: > On Thu, Sep 27, 2012 at 05:34:19PM +0200, Martin Jansa wrote: >> On Thu, Sep 27, 2012 at 02:29:25PM +0000, git@git.openembedded.org wrote: >> > Module: openembedded-core.git >> > Branch: master >> > Commit: ed0216d29fc4355c5220f3ad51df04a63cacb0c3 >> > URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=ed0216d29fc4355c5220f3ad51df04a63cacb0c3 >> > >> > Author: Martin Jansa <martin.jansa@gmail.com> >> > Date: Sat Sep 22 19:13:14 2012 +0200 >> > >> > xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa >> > >> > * it doesn't make much sense with PV, because xserver-xorg-module-exa >> > was introduced in >> > http://git.openembedded.org/openembedded-core/commit/meta/recipes-graphics/xorg-xserver?id=1a666ee1cda3c0b74daba5881fc5f62e13deec66 >> > so our xserver-xorg-module-exa RCONFLICTS with xserver-xorg (<= 1.11.2-r4) >> > and (< 1.11.2) is not good enough >> > >> > * because we don't know how many PRINC are in BSP/DISTRO layers, >> > then it's safer to RCONFLICTS with every older version then current >> > EXTENDPKGV >> > >> > Also fixes whitespace to work correctly with opkg >> >> The whitespace problem wasn't opkg fault AFAIK, but >> bb.utils.explode_dep_versions as shown in >> http://patchwork.openembedded.org/patch/37069/ > > Ah and it was meant to be applied together with this patch, so now it's > missing PR bump.. It keeps failing for me. -- Otavio Salvador O.S. Systems E-mail: otavio@ossystems.com.br http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [oe-commits] Martin Jansa : xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa 2012-09-27 18:08 ` Otavio Salvador @ 2012-09-27 22:41 ` Mark Hatle 2012-09-27 22:50 ` Martin Jansa 0 siblings, 1 reply; 13+ messages in thread From: Mark Hatle @ 2012-09-27 22:41 UTC (permalink / raw) To: openembedded-core Just an FYI -- Martin Jansa found a problem with the implement of the package version comparison. In deb and ipk, they do not support '<' or '>', instead it's '<<' and '>>'. (Odd, historical reasons apparently). While RPM doesn't have any idea what '<<' or '>>' is. Talking with RP and others it seems like the best approach is to implement a conversion, in the deb and ipk packaging classes, to convert '<' and '>' to the '<<' and '>>' equivalents. As well as add a sanity check that nobody is using '<<' or '>>'. I'm in the process of doing that now. --Mark On 9/27/12 1:08 PM, Otavio Salvador wrote: > On Thu, Sep 27, 2012 at 2:55 PM, Martin Jansa <martin.jansa@gmail.com> wrote: >> On Thu, Sep 27, 2012 at 05:34:19PM +0200, Martin Jansa wrote: >>> On Thu, Sep 27, 2012 at 02:29:25PM +0000, git@git.openembedded.org wrote: >>>> Module: openembedded-core.git >>>> Branch: master >>>> Commit: ed0216d29fc4355c5220f3ad51df04a63cacb0c3 >>>> URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=ed0216d29fc4355c5220f3ad51df04a63cacb0c3 >>>> >>>> Author: Martin Jansa <martin.jansa@gmail.com> >>>> Date: Sat Sep 22 19:13:14 2012 +0200 >>>> >>>> xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa >>>> >>>> * it doesn't make much sense with PV, because xserver-xorg-module-exa >>>> was introduced in >>>> http://git.openembedded.org/openembedded-core/commit/meta/recipes-graphics/xorg-xserver?id=1a666ee1cda3c0b74daba5881fc5f62e13deec66 >>>> so our xserver-xorg-module-exa RCONFLICTS with xserver-xorg (<= 1.11.2-r4) >>>> and (< 1.11.2) is not good enough >>>> >>>> * because we don't know how many PRINC are in BSP/DISTRO layers, >>>> then it's safer to RCONFLICTS with every older version then current >>>> EXTENDPKGV >>>> >>>> Also fixes whitespace to work correctly with opkg >>> >>> The whitespace problem wasn't opkg fault AFAIK, but >>> bb.utils.explode_dep_versions as shown in >>> http://patchwork.openembedded.org/patch/37069/ >> >> Ah and it was meant to be applied together with this patch, so now it's >> missing PR bump.. > > It keeps failing for me. > ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [oe-commits] Martin Jansa : xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa 2012-09-27 22:41 ` Mark Hatle @ 2012-09-27 22:50 ` Martin Jansa 2012-09-28 12:02 ` Otavio Salvador 0 siblings, 1 reply; 13+ messages in thread From: Martin Jansa @ 2012-09-27 22:50 UTC (permalink / raw) To: Mark Hatle; +Cc: openembedded-core On Fri, Sep 28, 2012 at 12:41 AM, Mark Hatle <mark.hatle@windriver.com> wrote: > Just an FYI -- Martin Jansa found a problem with the implement of the > package version comparison. > > In deb and ipk, they do not support '<' or '>', instead it's '<<' and '>>'. > (Odd, historical reasons apparently). > > While RPM doesn't have any idea what '<<' or '>>' is. > > Talking with RP and others it seems like the best approach is to implement a > conversion, in the deb and ipk packaging classes, to convert '<' and '>' to > the '<<' and '>>' equivalents. As well as add a sanity check that nobody is > using '<<' or '>>'. > > I'm in the process of doing that now. > > --Mark There is still some problem in opkg, now when I'm testing << with opkg which should work as LESS (and < as LESS_EQUAL), it still shows <= in opkg status and behaves like <=. So there is probably some bug in opkg still hidden :/ ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [oe-commits] Martin Jansa : xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa 2012-09-27 22:50 ` Martin Jansa @ 2012-09-28 12:02 ` Otavio Salvador 2012-09-29 8:43 ` Martin Jansa 0 siblings, 1 reply; 13+ messages in thread From: Otavio Salvador @ 2012-09-28 12:02 UTC (permalink / raw) To: Martin Jansa; +Cc: openembedded-core On Thu, Sep 27, 2012 at 7:50 PM, Martin Jansa <martin.jansa@gmail.com> wrote: > On Fri, Sep 28, 2012 at 12:41 AM, Mark Hatle <mark.hatle@windriver.com> wrote: >> Just an FYI -- Martin Jansa found a problem with the implement of the >> package version comparison. >> >> In deb and ipk, they do not support '<' or '>', instead it's '<<' and '>>'. >> (Odd, historical reasons apparently). >> >> While RPM doesn't have any idea what '<<' or '>>' is. >> >> Talking with RP and others it seems like the best approach is to implement a >> conversion, in the deb and ipk packaging classes, to convert '<' and '>' to >> the '<<' and '>>' equivalents. As well as add a sanity check that nobody is >> using '<<' or '>>'. >> >> I'm in the process of doing that now. >> >> --Mark > > There is still some problem in opkg, now when I'm testing << with opkg > which should work as LESS (and < as LESS_EQUAL), it still shows <= in > opkg status and behaves like <=. So there is probably some bug in opkg > still hidden :/ Yes; it seems the right fix is in opkg. Using RCONFLICTS with << also fails to me as said yestarday on IRC. -- Otavio Salvador O.S. Systems E-mail: otavio@ossystems.com.br http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [oe-commits] Martin Jansa : xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa 2012-09-28 12:02 ` Otavio Salvador @ 2012-09-29 8:43 ` Martin Jansa 2012-09-29 17:09 ` [PATCH] opkg: fix version constraints in conflicts, depends, replaces Martin Jansa 0 siblings, 1 reply; 13+ messages in thread From: Martin Jansa @ 2012-09-29 8:43 UTC (permalink / raw) To: Otavio Salvador; +Cc: openembedded-core [-- Attachment #1: Type: text/plain, Size: 1486 bytes --] On Fri, Sep 28, 2012 at 09:02:47AM -0300, Otavio Salvador wrote: > On Thu, Sep 27, 2012 at 7:50 PM, Martin Jansa <martin.jansa@gmail.com> wrote: > > On Fri, Sep 28, 2012 at 12:41 AM, Mark Hatle <mark.hatle@windriver.com> wrote: > >> Just an FYI -- Martin Jansa found a problem with the implement of the > >> package version comparison. > >> > >> In deb and ipk, they do not support '<' or '>', instead it's '<<' and '>>'. > >> (Odd, historical reasons apparently). > >> > >> While RPM doesn't have any idea what '<<' or '>>' is. > >> > >> Talking with RP and others it seems like the best approach is to implement a > >> conversion, in the deb and ipk packaging classes, to convert '<' and '>' to > >> the '<<' and '>>' equivalents. As well as add a sanity check that nobody is > >> using '<<' or '>>'. > >> > >> I'm in the process of doing that now. > >> > >> --Mark > > > > There is still some problem in opkg, now when I'm testing << with opkg > > which should work as LESS (and < as LESS_EQUAL), it still shows <= in > > opkg status and behaves like <=. So there is probably some bug in opkg > > still hidden :/ > > Yes; it seems the right fix is in opkg. > > Using RCONFLICTS with << also fails to me as said yestarday on IRC. Reported upstream with simple test case http://code.google.com/p/opkg/issues/detail?id=94 will attach patch there + send here when I have it. Cheers, -- Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 205 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH] opkg: fix version constraints in conflicts, depends, replaces 2012-09-29 8:43 ` Martin Jansa @ 2012-09-29 17:09 ` Martin Jansa 2012-09-29 17:19 ` [PATCHv2] " Martin Jansa 0 siblings, 1 reply; 13+ messages in thread From: Martin Jansa @ 2012-09-29 17:09 UTC (permalink / raw) To: openembedded-core * http://code.google.com/p/opkg/issues/detail?id=94 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> --- .../0009-pkg_depends-fix-version-constraints.patch | 188 +++++++++++++++++++++ ...depends-fix-version_constraints_satisfied.patch | 37 ++++ meta/recipes-devtools/opkg/opkg_svn.bb | 4 +- 3 files changed, 228 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch create mode 100644 meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch diff --git a/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch b/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch new file mode 100644 index 0000000..27df307 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch @@ -0,0 +1,188 @@ +From b6a4d289499ac4c4def48401edadd775eccc387c Mon Sep 17 00:00:00 2001 +From: Martin Jansa <Martin.Jansa@gmail.com> +Date: Sat, 29 Sep 2012 11:38:03 +0200 +Subject: [PATCH 9/9] pkg_depends: fix version constraints + +* factor parsing version constraint to str_to_constraint and use that + from pkg (pkg_version_satisfied) and also pkg_depends (parseDepends) +* fix constraint_to_str(), for EARLIER and LATER it was using '<' and + '>' which is parsed later as EARLIER_EQUAL and LATER_EQUAL +* show notice when deprecated '<' or '>' is used + +Upstream-Status: Submitted +http://code.google.com/p/opkg/issues/detail?id=94 + +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> +--- + libopkg/pkg.c | 36 +++++++++++-------------- + libopkg/pkg_depends.c | 73 +++++++++++++++++++++++++++++---------------------- + libopkg/pkg_depends.h | 1 + + 3 files changed, 59 insertions(+), 51 deletions(-) + +diff --git a/libopkg/pkg.c b/libopkg/pkg.c +index 255c673..1e98b9c 100644 +--- a/libopkg/pkg.c ++++ b/libopkg/pkg.c +@@ -968,28 +968,24 @@ pkg_version_satisfied(pkg_t *it, pkg_t *ref, const char *op) + int r; + + r = pkg_compare_versions(it, ref); ++ char *op2 = op; ++ enum version_constraint constraint = str_to_constraint(&op2); + +- if (strcmp(op, "<=") == 0 || strcmp(op, "<") == 0) { +- return r <= 0; +- } +- +- if (strcmp(op, ">=") == 0 || strcmp(op, ">") == 0) { +- return r >= 0; +- } +- +- if (strcmp(op, "<<") == 0) { +- return r < 0; +- } +- +- if (strcmp(op, ">>") == 0) { +- return r > 0; +- } +- +- if (strcmp(op, "=") == 0) { +- return r == 0; ++ switch (constraint) ++ { ++ case EARLIER_EQUAL: ++ return r <= 0; ++ case LATER_EQUAL: ++ return r >= 0; ++ case EARLIER: ++ return r < 0; ++ case LATER: ++ return r > 0; ++ case EQUAL: ++ return r == 0; ++ case NONE: ++ opkg_msg(ERROR, "Unknown operator: %s.\n", op); + } +- +- opkg_msg(ERROR, "Unknown operator: %s.\n", op); + return 0; + } + +diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c +index a72eed7..4b7a2a5 100644 +--- a/libopkg/pkg_depends.c ++++ b/libopkg/pkg_depends.c +@@ -781,7 +781,7 @@ constraint_to_str(enum version_constraint c) + case NONE: + return ""; + case EARLIER: +- return "< "; ++ return "<< "; + case EARLIER_EQUAL: + return "<= "; + case EQUAL: +@@ -789,12 +789,51 @@ constraint_to_str(enum version_constraint c) + case LATER_EQUAL: + return ">= "; + case LATER: +- return "> "; ++ return ">> "; + } + + return ""; + } + ++enum version_constraint ++str_to_constraint(char **str) ++{ ++ if(!strncmp(*str, "<<", 2)){ ++ *str += 2; ++ return EARLIER; ++ } ++ else if(!strncmp(*str, "<=", 2)){ ++ *str += 2; ++ return EARLIER_EQUAL; ++ } ++ else if(!strncmp(*str, ">=", 2)){ ++ *str += 2; ++ return LATER_EQUAL; ++ } ++ else if(!strncmp(*str, ">>", 2)){ ++ *str += 2; ++ return LATER; ++ } ++ else if(!strncmp(*str, "=", 1)){ ++ *str++; ++ return EQUAL; ++ } ++ /* should these be here to support deprecated designations; dpkg does */ ++ else if(!strncmp(*str, "<", 1)){ ++ *str++; ++ opkg_msg(NOTICE, "Deprecated version constraint '<' was used with the same meaning as '<='. Use '<<' for EARLIER constraint.\n"); ++ return EARLIER_EQUAL; ++ } ++ else if(!strncmp(*str, ">", 1)){ ++ *str++; ++ opkg_msg(NOTICE, "Deprecated version constraint '>' was used with the same meaning as '>='. Use '>>' for LATER constraint.\n"); ++ return LATER_EQUAL; ++ } ++ else { ++ return NONE; ++ } ++} ++ + /* + * Returns a printable string for pkg's dependency at the specified idx. The + * resultant string must be passed to free() by the caller. +@@ -949,35 +988,7 @@ static int parseDepends(compound_depend_t *compound_depend, + /* extract constraint and version */ + if(*src == '('){ + src++; +- if(!strncmp(src, "<<", 2)){ +- possibilities[i]->constraint = EARLIER; +- src += 2; +- } +- else if(!strncmp(src, "<=", 2)){ +- possibilities[i]->constraint = EARLIER_EQUAL; +- src += 2; +- } +- else if(!strncmp(src, ">=", 2)){ +- possibilities[i]->constraint = LATER_EQUAL; +- src += 2; +- } +- else if(!strncmp(src, ">>", 2)){ +- possibilities[i]->constraint = LATER; +- src += 2; +- } +- else if(!strncmp(src, "=", 1)){ +- possibilities[i]->constraint = EQUAL; +- src++; +- } +- /* should these be here to support deprecated designations; dpkg does */ +- else if(!strncmp(src, "<", 1)){ +- possibilities[i]->constraint = EARLIER_EQUAL; +- src++; +- } +- else if(!strncmp(src, ">", 1)){ +- possibilities[i]->constraint = LATER_EQUAL; +- src++; +- } ++ possibilities[i]->constraint = str_to_constraint(&src); + + /* now we have any constraint, pass space to version string */ + while(isspace(*src)) src++; +diff --git a/libopkg/pkg_depends.h b/libopkg/pkg_depends.h +index ca0801f..685a722 100644 +--- a/libopkg/pkg_depends.h ++++ b/libopkg/pkg_depends.h +@@ -87,6 +87,7 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg); + int pkg_dependence_satisfiable(depend_t *depend); + int pkg_dependence_satisfied(depend_t *depend); + const char* constraint_to_str(enum version_constraint c); ++enum version_constraint str_to_constraint(char **str); + int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg); + + #endif +-- +1.7.12 + diff --git a/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch b/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch new file mode 100644 index 0000000..ffcbc4b --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch @@ -0,0 +1,37 @@ +From 02d96ebf8c6cdbe3402506ad041bbb4806179273 Mon Sep 17 00:00:00 2001 +From: Martin Jansa <Martin.Jansa@gmail.com> +Date: Sat, 29 Sep 2012 18:56:01 +0200 +Subject: [PATCH 10/10] pkg_depends: fix version_constraints_satisfied + +* with + Package: a + Version: 1 + and + Conflicts: a (<< 1) + we have comparison == 0, but constraint EARLIER is not satisfied! + +Upstream-Status: Submitted +http://code.google.com/p/opkg/issues/detail?id=94 + +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> +--- + libopkg/pkg_depends.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c +index 4b7a2a5..58c4a99 100644 +--- a/libopkg/pkg_depends.c ++++ b/libopkg/pkg_depends.c +@@ -464,7 +464,8 @@ int version_constraints_satisfied(depend_t * depends, pkg_t * pkg) + else if((depends->constraint == LATER) && + (comparison > 0)) + return 1; +- else if(comparison == 0) ++ else if((depends->constraint == LATER) && ++ (comparison == 0)) + return 1; + else if((depends->constraint == LATER_EQUAL) && + (comparison >= 0)) +-- +1.7.12 + diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb index 820a224..d89a3f6 100644 --- a/meta/recipes-devtools/opkg/opkg_svn.bb +++ b/meta/recipes-devtools/opkg/opkg_svn.bb @@ -9,6 +9,8 @@ SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \ file://0006-detect-circular-dependencies.patch \ file://0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch \ file://0008-select_higher_version.patch \ + file://0009-pkg_depends-fix-version-constraints.patch \ + file://0010-pkg_depends-fix-version_constraints_satisfied.patch \ " S = "${WORKDIR}/trunk" @@ -16,4 +18,4 @@ S = "${WORKDIR}/trunk" SRCREV = "633" PV = "0.1.8+svnr${SRCPV}" -PR = "${INC_PR}.4" +PR = "${INC_PR}.5" -- 1.7.12 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCHv2] opkg: fix version constraints in conflicts, depends, replaces 2012-09-29 17:09 ` [PATCH] opkg: fix version constraints in conflicts, depends, replaces Martin Jansa @ 2012-09-29 17:19 ` Martin Jansa 2012-09-30 9:06 ` Martin Jansa 0 siblings, 1 reply; 13+ messages in thread From: Martin Jansa @ 2012-09-29 17:19 UTC (permalink / raw) To: openembedded-core * http://code.google.com/p/opkg/issues/detail?id=94 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> --- .../0009-pkg_depends-fix-version-constraints.patch | 188 +++++++++++++++++++++ ...depends-fix-version_constraints_satisfied.patch | 37 ++++ meta/recipes-devtools/opkg/opkg_svn.bb | 4 +- 3 files changed, 228 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch create mode 100644 meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch diff --git a/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch b/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch new file mode 100644 index 0000000..27df307 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch @@ -0,0 +1,188 @@ +From b6a4d289499ac4c4def48401edadd775eccc387c Mon Sep 17 00:00:00 2001 +From: Martin Jansa <Martin.Jansa@gmail.com> +Date: Sat, 29 Sep 2012 11:38:03 +0200 +Subject: [PATCH 9/9] pkg_depends: fix version constraints + +* factor parsing version constraint to str_to_constraint and use that + from pkg (pkg_version_satisfied) and also pkg_depends (parseDepends) +* fix constraint_to_str(), for EARLIER and LATER it was using '<' and + '>' which is parsed later as EARLIER_EQUAL and LATER_EQUAL +* show notice when deprecated '<' or '>' is used + +Upstream-Status: Submitted +http://code.google.com/p/opkg/issues/detail?id=94 + +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> +--- + libopkg/pkg.c | 36 +++++++++++-------------- + libopkg/pkg_depends.c | 73 +++++++++++++++++++++++++++++---------------------- + libopkg/pkg_depends.h | 1 + + 3 files changed, 59 insertions(+), 51 deletions(-) + +diff --git a/libopkg/pkg.c b/libopkg/pkg.c +index 255c673..1e98b9c 100644 +--- a/libopkg/pkg.c ++++ b/libopkg/pkg.c +@@ -968,28 +968,24 @@ pkg_version_satisfied(pkg_t *it, pkg_t *ref, const char *op) + int r; + + r = pkg_compare_versions(it, ref); ++ char *op2 = op; ++ enum version_constraint constraint = str_to_constraint(&op2); + +- if (strcmp(op, "<=") == 0 || strcmp(op, "<") == 0) { +- return r <= 0; +- } +- +- if (strcmp(op, ">=") == 0 || strcmp(op, ">") == 0) { +- return r >= 0; +- } +- +- if (strcmp(op, "<<") == 0) { +- return r < 0; +- } +- +- if (strcmp(op, ">>") == 0) { +- return r > 0; +- } +- +- if (strcmp(op, "=") == 0) { +- return r == 0; ++ switch (constraint) ++ { ++ case EARLIER_EQUAL: ++ return r <= 0; ++ case LATER_EQUAL: ++ return r >= 0; ++ case EARLIER: ++ return r < 0; ++ case LATER: ++ return r > 0; ++ case EQUAL: ++ return r == 0; ++ case NONE: ++ opkg_msg(ERROR, "Unknown operator: %s.\n", op); + } +- +- opkg_msg(ERROR, "Unknown operator: %s.\n", op); + return 0; + } + +diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c +index a72eed7..4b7a2a5 100644 +--- a/libopkg/pkg_depends.c ++++ b/libopkg/pkg_depends.c +@@ -781,7 +781,7 @@ constraint_to_str(enum version_constraint c) + case NONE: + return ""; + case EARLIER: +- return "< "; ++ return "<< "; + case EARLIER_EQUAL: + return "<= "; + case EQUAL: +@@ -789,12 +789,51 @@ constraint_to_str(enum version_constraint c) + case LATER_EQUAL: + return ">= "; + case LATER: +- return "> "; ++ return ">> "; + } + + return ""; + } + ++enum version_constraint ++str_to_constraint(char **str) ++{ ++ if(!strncmp(*str, "<<", 2)){ ++ *str += 2; ++ return EARLIER; ++ } ++ else if(!strncmp(*str, "<=", 2)){ ++ *str += 2; ++ return EARLIER_EQUAL; ++ } ++ else if(!strncmp(*str, ">=", 2)){ ++ *str += 2; ++ return LATER_EQUAL; ++ } ++ else if(!strncmp(*str, ">>", 2)){ ++ *str += 2; ++ return LATER; ++ } ++ else if(!strncmp(*str, "=", 1)){ ++ *str++; ++ return EQUAL; ++ } ++ /* should these be here to support deprecated designations; dpkg does */ ++ else if(!strncmp(*str, "<", 1)){ ++ *str++; ++ opkg_msg(NOTICE, "Deprecated version constraint '<' was used with the same meaning as '<='. Use '<<' for EARLIER constraint.\n"); ++ return EARLIER_EQUAL; ++ } ++ else if(!strncmp(*str, ">", 1)){ ++ *str++; ++ opkg_msg(NOTICE, "Deprecated version constraint '>' was used with the same meaning as '>='. Use '>>' for LATER constraint.\n"); ++ return LATER_EQUAL; ++ } ++ else { ++ return NONE; ++ } ++} ++ + /* + * Returns a printable string for pkg's dependency at the specified idx. The + * resultant string must be passed to free() by the caller. +@@ -949,35 +988,7 @@ static int parseDepends(compound_depend_t *compound_depend, + /* extract constraint and version */ + if(*src == '('){ + src++; +- if(!strncmp(src, "<<", 2)){ +- possibilities[i]->constraint = EARLIER; +- src += 2; +- } +- else if(!strncmp(src, "<=", 2)){ +- possibilities[i]->constraint = EARLIER_EQUAL; +- src += 2; +- } +- else if(!strncmp(src, ">=", 2)){ +- possibilities[i]->constraint = LATER_EQUAL; +- src += 2; +- } +- else if(!strncmp(src, ">>", 2)){ +- possibilities[i]->constraint = LATER; +- src += 2; +- } +- else if(!strncmp(src, "=", 1)){ +- possibilities[i]->constraint = EQUAL; +- src++; +- } +- /* should these be here to support deprecated designations; dpkg does */ +- else if(!strncmp(src, "<", 1)){ +- possibilities[i]->constraint = EARLIER_EQUAL; +- src++; +- } +- else if(!strncmp(src, ">", 1)){ +- possibilities[i]->constraint = LATER_EQUAL; +- src++; +- } ++ possibilities[i]->constraint = str_to_constraint(&src); + + /* now we have any constraint, pass space to version string */ + while(isspace(*src)) src++; +diff --git a/libopkg/pkg_depends.h b/libopkg/pkg_depends.h +index ca0801f..685a722 100644 +--- a/libopkg/pkg_depends.h ++++ b/libopkg/pkg_depends.h +@@ -87,6 +87,7 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg); + int pkg_dependence_satisfiable(depend_t *depend); + int pkg_dependence_satisfied(depend_t *depend); + const char* constraint_to_str(enum version_constraint c); ++enum version_constraint str_to_constraint(char **str); + int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg); + + #endif +-- +1.7.12 + diff --git a/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch b/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch new file mode 100644 index 0000000..841b508 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch @@ -0,0 +1,37 @@ +From 51a45a02a32064c14e0d4d6ef41c1a6276432b29 Mon Sep 17 00:00:00 2001 +From: Martin Jansa <Martin.Jansa@gmail.com> +Date: Sat, 29 Sep 2012 18:56:01 +0200 +Subject: [PATCH 10/10] pkg_depends: fix version_constraints_satisfied + +* with + Package: a + Version: 1 + and + Conflicts: a (<< 1) + we have comparison == 0, but constraint EARLIER is not satisfied! + +Upstream-Status: Submitted +http://code.google.com/p/opkg/issues/detail?id=94 + +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> +--- + libopkg/pkg_depends.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c +index 4b7a2a5..a67579a 100644 +--- a/libopkg/pkg_depends.c ++++ b/libopkg/pkg_depends.c +@@ -464,7 +464,8 @@ int version_constraints_satisfied(depend_t * depends, pkg_t * pkg) + else if((depends->constraint == LATER) && + (comparison > 0)) + return 1; +- else if(comparison == 0) ++ else if((depends->constraint == EQUAL) && ++ (comparison == 0)) + return 1; + else if((depends->constraint == LATER_EQUAL) && + (comparison >= 0)) +-- +1.7.12 + diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb index 820a224..d89a3f6 100644 --- a/meta/recipes-devtools/opkg/opkg_svn.bb +++ b/meta/recipes-devtools/opkg/opkg_svn.bb @@ -9,6 +9,8 @@ SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \ file://0006-detect-circular-dependencies.patch \ file://0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch \ file://0008-select_higher_version.patch \ + file://0009-pkg_depends-fix-version-constraints.patch \ + file://0010-pkg_depends-fix-version_constraints_satisfied.patch \ " S = "${WORKDIR}/trunk" @@ -16,4 +18,4 @@ S = "${WORKDIR}/trunk" SRCREV = "633" PV = "0.1.8+svnr${SRCPV}" -PR = "${INC_PR}.4" +PR = "${INC_PR}.5" -- 1.7.12 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCHv2] opkg: fix version constraints in conflicts, depends, replaces 2012-09-29 17:19 ` [PATCHv2] " Martin Jansa @ 2012-09-30 9:06 ` Martin Jansa 2012-09-30 12:53 ` Martin Jansa 0 siblings, 1 reply; 13+ messages in thread From: Martin Jansa @ 2012-09-30 9:06 UTC (permalink / raw) To: openembedded-core [-- Attachment #1: Type: text/plain, Size: 10043 bytes --] On Sat, Sep 29, 2012 at 07:19:16PM +0200, Martin Jansa wrote: > * http://code.google.com/p/opkg/issues/detail?id=94 It needs a bit more testing, because for some reason I got | * satisfy_dependencies_for: Cannot satisfy the following dependencies for packagegroup-shr-minimal-x: | * xserver-xorg (= = 2:1.11.2-r11) * armv4t/Package looks ok Package: xserver-xorg-module-exa Version: 2:1.11.2-r11 Depends: xserver-xorg (= 2:1.11.2-r11), libc6 (>= 2.16) and it works on target.. > > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> > --- > .../0009-pkg_depends-fix-version-constraints.patch | 188 +++++++++++++++++++++ > ...depends-fix-version_constraints_satisfied.patch | 37 ++++ > meta/recipes-devtools/opkg/opkg_svn.bb | 4 +- > 3 files changed, 228 insertions(+), 1 deletion(-) > create mode 100644 meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch > create mode 100644 meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch > > diff --git a/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch b/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch > new file mode 100644 > index 0000000..27df307 > --- /dev/null > +++ b/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch > @@ -0,0 +1,188 @@ > +From b6a4d289499ac4c4def48401edadd775eccc387c Mon Sep 17 00:00:00 2001 > +From: Martin Jansa <Martin.Jansa@gmail.com> > +Date: Sat, 29 Sep 2012 11:38:03 +0200 > +Subject: [PATCH 9/9] pkg_depends: fix version constraints > + > +* factor parsing version constraint to str_to_constraint and use that > + from pkg (pkg_version_satisfied) and also pkg_depends (parseDepends) > +* fix constraint_to_str(), for EARLIER and LATER it was using '<' and > + '>' which is parsed later as EARLIER_EQUAL and LATER_EQUAL > +* show notice when deprecated '<' or '>' is used > + > +Upstream-Status: Submitted > +http://code.google.com/p/opkg/issues/detail?id=94 > + > +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> > +--- > + libopkg/pkg.c | 36 +++++++++++-------------- > + libopkg/pkg_depends.c | 73 +++++++++++++++++++++++++++++---------------------- > + libopkg/pkg_depends.h | 1 + > + 3 files changed, 59 insertions(+), 51 deletions(-) > + > +diff --git a/libopkg/pkg.c b/libopkg/pkg.c > +index 255c673..1e98b9c 100644 > +--- a/libopkg/pkg.c > ++++ b/libopkg/pkg.c > +@@ -968,28 +968,24 @@ pkg_version_satisfied(pkg_t *it, pkg_t *ref, const char *op) > + int r; > + > + r = pkg_compare_versions(it, ref); > ++ char *op2 = op; > ++ enum version_constraint constraint = str_to_constraint(&op2); > + > +- if (strcmp(op, "<=") == 0 || strcmp(op, "<") == 0) { > +- return r <= 0; > +- } > +- > +- if (strcmp(op, ">=") == 0 || strcmp(op, ">") == 0) { > +- return r >= 0; > +- } > +- > +- if (strcmp(op, "<<") == 0) { > +- return r < 0; > +- } > +- > +- if (strcmp(op, ">>") == 0) { > +- return r > 0; > +- } > +- > +- if (strcmp(op, "=") == 0) { > +- return r == 0; > ++ switch (constraint) > ++ { > ++ case EARLIER_EQUAL: > ++ return r <= 0; > ++ case LATER_EQUAL: > ++ return r >= 0; > ++ case EARLIER: > ++ return r < 0; > ++ case LATER: > ++ return r > 0; > ++ case EQUAL: > ++ return r == 0; > ++ case NONE: > ++ opkg_msg(ERROR, "Unknown operator: %s.\n", op); > + } > +- > +- opkg_msg(ERROR, "Unknown operator: %s.\n", op); > + return 0; > + } > + > +diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c > +index a72eed7..4b7a2a5 100644 > +--- a/libopkg/pkg_depends.c > ++++ b/libopkg/pkg_depends.c > +@@ -781,7 +781,7 @@ constraint_to_str(enum version_constraint c) > + case NONE: > + return ""; > + case EARLIER: > +- return "< "; > ++ return "<< "; > + case EARLIER_EQUAL: > + return "<= "; > + case EQUAL: > +@@ -789,12 +789,51 @@ constraint_to_str(enum version_constraint c) > + case LATER_EQUAL: > + return ">= "; > + case LATER: > +- return "> "; > ++ return ">> "; > + } > + > + return ""; > + } > + > ++enum version_constraint > ++str_to_constraint(char **str) > ++{ > ++ if(!strncmp(*str, "<<", 2)){ > ++ *str += 2; > ++ return EARLIER; > ++ } > ++ else if(!strncmp(*str, "<=", 2)){ > ++ *str += 2; > ++ return EARLIER_EQUAL; > ++ } > ++ else if(!strncmp(*str, ">=", 2)){ > ++ *str += 2; > ++ return LATER_EQUAL; > ++ } > ++ else if(!strncmp(*str, ">>", 2)){ > ++ *str += 2; > ++ return LATER; > ++ } > ++ else if(!strncmp(*str, "=", 1)){ > ++ *str++; > ++ return EQUAL; > ++ } > ++ /* should these be here to support deprecated designations; dpkg does */ > ++ else if(!strncmp(*str, "<", 1)){ > ++ *str++; > ++ opkg_msg(NOTICE, "Deprecated version constraint '<' was used with the same meaning as '<='. Use '<<' for EARLIER constraint.\n"); > ++ return EARLIER_EQUAL; > ++ } > ++ else if(!strncmp(*str, ">", 1)){ > ++ *str++; > ++ opkg_msg(NOTICE, "Deprecated version constraint '>' was used with the same meaning as '>='. Use '>>' for LATER constraint.\n"); > ++ return LATER_EQUAL; > ++ } > ++ else { > ++ return NONE; > ++ } > ++} > ++ > + /* > + * Returns a printable string for pkg's dependency at the specified idx. The > + * resultant string must be passed to free() by the caller. > +@@ -949,35 +988,7 @@ static int parseDepends(compound_depend_t *compound_depend, > + /* extract constraint and version */ > + if(*src == '('){ > + src++; > +- if(!strncmp(src, "<<", 2)){ > +- possibilities[i]->constraint = EARLIER; > +- src += 2; > +- } > +- else if(!strncmp(src, "<=", 2)){ > +- possibilities[i]->constraint = EARLIER_EQUAL; > +- src += 2; > +- } > +- else if(!strncmp(src, ">=", 2)){ > +- possibilities[i]->constraint = LATER_EQUAL; > +- src += 2; > +- } > +- else if(!strncmp(src, ">>", 2)){ > +- possibilities[i]->constraint = LATER; > +- src += 2; > +- } > +- else if(!strncmp(src, "=", 1)){ > +- possibilities[i]->constraint = EQUAL; > +- src++; > +- } > +- /* should these be here to support deprecated designations; dpkg does */ > +- else if(!strncmp(src, "<", 1)){ > +- possibilities[i]->constraint = EARLIER_EQUAL; > +- src++; > +- } > +- else if(!strncmp(src, ">", 1)){ > +- possibilities[i]->constraint = LATER_EQUAL; > +- src++; > +- } > ++ possibilities[i]->constraint = str_to_constraint(&src); > + > + /* now we have any constraint, pass space to version string */ > + while(isspace(*src)) src++; > +diff --git a/libopkg/pkg_depends.h b/libopkg/pkg_depends.h > +index ca0801f..685a722 100644 > +--- a/libopkg/pkg_depends.h > ++++ b/libopkg/pkg_depends.h > +@@ -87,6 +87,7 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg); > + int pkg_dependence_satisfiable(depend_t *depend); > + int pkg_dependence_satisfied(depend_t *depend); > + const char* constraint_to_str(enum version_constraint c); > ++enum version_constraint str_to_constraint(char **str); > + int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg); > + > + #endif > +-- > +1.7.12 > + > diff --git a/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch b/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch > new file mode 100644 > index 0000000..841b508 > --- /dev/null > +++ b/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch > @@ -0,0 +1,37 @@ > +From 51a45a02a32064c14e0d4d6ef41c1a6276432b29 Mon Sep 17 00:00:00 2001 > +From: Martin Jansa <Martin.Jansa@gmail.com> > +Date: Sat, 29 Sep 2012 18:56:01 +0200 > +Subject: [PATCH 10/10] pkg_depends: fix version_constraints_satisfied > + > +* with > + Package: a > + Version: 1 > + and > + Conflicts: a (<< 1) > + we have comparison == 0, but constraint EARLIER is not satisfied! > + > +Upstream-Status: Submitted > +http://code.google.com/p/opkg/issues/detail?id=94 > + > +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> > +--- > + libopkg/pkg_depends.c | 3 ++- > + 1 file changed, 2 insertions(+), 1 deletion(-) > + > +diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c > +index 4b7a2a5..a67579a 100644 > +--- a/libopkg/pkg_depends.c > ++++ b/libopkg/pkg_depends.c > +@@ -464,7 +464,8 @@ int version_constraints_satisfied(depend_t * depends, pkg_t * pkg) > + else if((depends->constraint == LATER) && > + (comparison > 0)) > + return 1; > +- else if(comparison == 0) > ++ else if((depends->constraint == EQUAL) && > ++ (comparison == 0)) > + return 1; > + else if((depends->constraint == LATER_EQUAL) && > + (comparison >= 0)) > +-- > +1.7.12 > + > diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb > index 820a224..d89a3f6 100644 > --- a/meta/recipes-devtools/opkg/opkg_svn.bb > +++ b/meta/recipes-devtools/opkg/opkg_svn.bb > @@ -9,6 +9,8 @@ SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \ > file://0006-detect-circular-dependencies.patch \ > file://0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch \ > file://0008-select_higher_version.patch \ > + file://0009-pkg_depends-fix-version-constraints.patch \ > + file://0010-pkg_depends-fix-version_constraints_satisfied.patch \ > " > > S = "${WORKDIR}/trunk" > @@ -16,4 +18,4 @@ S = "${WORKDIR}/trunk" > SRCREV = "633" > PV = "0.1.8+svnr${SRCPV}" > > -PR = "${INC_PR}.4" > +PR = "${INC_PR}.5" > -- > 1.7.12 > -- Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 205 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCHv2] opkg: fix version constraints in conflicts, depends, replaces 2012-09-30 9:06 ` Martin Jansa @ 2012-09-30 12:53 ` Martin Jansa 2012-10-01 11:41 ` [PATCHv3] " Martin Jansa 0 siblings, 1 reply; 13+ messages in thread From: Martin Jansa @ 2012-09-30 12:53 UTC (permalink / raw) To: openembedded-core [-- Attachment #1: Type: text/plain, Size: 10851 bytes --] On Sun, Sep 30, 2012 at 11:06:35AM +0200, Martin Jansa wrote: > On Sat, Sep 29, 2012 at 07:19:16PM +0200, Martin Jansa wrote: > > * http://code.google.com/p/opkg/issues/detail?id=94 > > It needs a bit more testing, because for some reason I got > > | * satisfy_dependencies_for: Cannot satisfy the following dependencies for packagegroup-shr-minimal-x: > | * xserver-xorg (= = 2:1.11.2-r11) * > > armv4t/Package looks ok > Package: xserver-xorg-module-exa > Version: 2:1.11.2-r11 > Depends: xserver-xorg (= 2:1.11.2-r11), libc6 (>= 2.16) > > and it works on target.. Found it and updated patch in upstream bug tracker, will send v3 after rebuilding from scratch.. Cheers, > > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> > > --- > > .../0009-pkg_depends-fix-version-constraints.patch | 188 +++++++++++++++++++++ > > ...depends-fix-version_constraints_satisfied.patch | 37 ++++ > > meta/recipes-devtools/opkg/opkg_svn.bb | 4 +- > > 3 files changed, 228 insertions(+), 1 deletion(-) > > create mode 100644 meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch > > create mode 100644 meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch > > > > diff --git a/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch b/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch > > new file mode 100644 > > index 0000000..27df307 > > --- /dev/null > > +++ b/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch > > @@ -0,0 +1,188 @@ > > +From b6a4d289499ac4c4def48401edadd775eccc387c Mon Sep 17 00:00:00 2001 > > +From: Martin Jansa <Martin.Jansa@gmail.com> > > +Date: Sat, 29 Sep 2012 11:38:03 +0200 > > +Subject: [PATCH 9/9] pkg_depends: fix version constraints > > + > > +* factor parsing version constraint to str_to_constraint and use that > > + from pkg (pkg_version_satisfied) and also pkg_depends (parseDepends) > > +* fix constraint_to_str(), for EARLIER and LATER it was using '<' and > > + '>' which is parsed later as EARLIER_EQUAL and LATER_EQUAL > > +* show notice when deprecated '<' or '>' is used > > + > > +Upstream-Status: Submitted > > +http://code.google.com/p/opkg/issues/detail?id=94 > > + > > +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> > > +--- > > + libopkg/pkg.c | 36 +++++++++++-------------- > > + libopkg/pkg_depends.c | 73 +++++++++++++++++++++++++++++---------------------- > > + libopkg/pkg_depends.h | 1 + > > + 3 files changed, 59 insertions(+), 51 deletions(-) > > + > > +diff --git a/libopkg/pkg.c b/libopkg/pkg.c > > +index 255c673..1e98b9c 100644 > > +--- a/libopkg/pkg.c > > ++++ b/libopkg/pkg.c > > +@@ -968,28 +968,24 @@ pkg_version_satisfied(pkg_t *it, pkg_t *ref, const char *op) > > + int r; > > + > > + r = pkg_compare_versions(it, ref); > > ++ char *op2 = op; > > ++ enum version_constraint constraint = str_to_constraint(&op2); > > + > > +- if (strcmp(op, "<=") == 0 || strcmp(op, "<") == 0) { > > +- return r <= 0; > > +- } > > +- > > +- if (strcmp(op, ">=") == 0 || strcmp(op, ">") == 0) { > > +- return r >= 0; > > +- } > > +- > > +- if (strcmp(op, "<<") == 0) { > > +- return r < 0; > > +- } > > +- > > +- if (strcmp(op, ">>") == 0) { > > +- return r > 0; > > +- } > > +- > > +- if (strcmp(op, "=") == 0) { > > +- return r == 0; > > ++ switch (constraint) > > ++ { > > ++ case EARLIER_EQUAL: > > ++ return r <= 0; > > ++ case LATER_EQUAL: > > ++ return r >= 0; > > ++ case EARLIER: > > ++ return r < 0; > > ++ case LATER: > > ++ return r > 0; > > ++ case EQUAL: > > ++ return r == 0; > > ++ case NONE: > > ++ opkg_msg(ERROR, "Unknown operator: %s.\n", op); > > + } > > +- > > +- opkg_msg(ERROR, "Unknown operator: %s.\n", op); > > + return 0; > > + } > > + > > +diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c > > +index a72eed7..4b7a2a5 100644 > > +--- a/libopkg/pkg_depends.c > > ++++ b/libopkg/pkg_depends.c > > +@@ -781,7 +781,7 @@ constraint_to_str(enum version_constraint c) > > + case NONE: > > + return ""; > > + case EARLIER: > > +- return "< "; > > ++ return "<< "; > > + case EARLIER_EQUAL: > > + return "<= "; > > + case EQUAL: > > +@@ -789,12 +789,51 @@ constraint_to_str(enum version_constraint c) > > + case LATER_EQUAL: > > + return ">= "; > > + case LATER: > > +- return "> "; > > ++ return ">> "; > > + } > > + > > + return ""; > > + } > > + > > ++enum version_constraint > > ++str_to_constraint(char **str) > > ++{ > > ++ if(!strncmp(*str, "<<", 2)){ > > ++ *str += 2; > > ++ return EARLIER; > > ++ } > > ++ else if(!strncmp(*str, "<=", 2)){ > > ++ *str += 2; > > ++ return EARLIER_EQUAL; > > ++ } > > ++ else if(!strncmp(*str, ">=", 2)){ > > ++ *str += 2; > > ++ return LATER_EQUAL; > > ++ } > > ++ else if(!strncmp(*str, ">>", 2)){ > > ++ *str += 2; > > ++ return LATER; > > ++ } > > ++ else if(!strncmp(*str, "=", 1)){ > > ++ *str++; > > ++ return EQUAL; > > ++ } > > ++ /* should these be here to support deprecated designations; dpkg does */ > > ++ else if(!strncmp(*str, "<", 1)){ > > ++ *str++; > > ++ opkg_msg(NOTICE, "Deprecated version constraint '<' was used with the same meaning as '<='. Use '<<' for EARLIER constraint.\n"); > > ++ return EARLIER_EQUAL; > > ++ } > > ++ else if(!strncmp(*str, ">", 1)){ > > ++ *str++; > > ++ opkg_msg(NOTICE, "Deprecated version constraint '>' was used with the same meaning as '>='. Use '>>' for LATER constraint.\n"); > > ++ return LATER_EQUAL; > > ++ } > > ++ else { > > ++ return NONE; > > ++ } > > ++} > > ++ > > + /* > > + * Returns a printable string for pkg's dependency at the specified idx. The > > + * resultant string must be passed to free() by the caller. > > +@@ -949,35 +988,7 @@ static int parseDepends(compound_depend_t *compound_depend, > > + /* extract constraint and version */ > > + if(*src == '('){ > > + src++; > > +- if(!strncmp(src, "<<", 2)){ > > +- possibilities[i]->constraint = EARLIER; > > +- src += 2; > > +- } > > +- else if(!strncmp(src, "<=", 2)){ > > +- possibilities[i]->constraint = EARLIER_EQUAL; > > +- src += 2; > > +- } > > +- else if(!strncmp(src, ">=", 2)){ > > +- possibilities[i]->constraint = LATER_EQUAL; > > +- src += 2; > > +- } > > +- else if(!strncmp(src, ">>", 2)){ > > +- possibilities[i]->constraint = LATER; > > +- src += 2; > > +- } > > +- else if(!strncmp(src, "=", 1)){ > > +- possibilities[i]->constraint = EQUAL; > > +- src++; > > +- } > > +- /* should these be here to support deprecated designations; dpkg does */ > > +- else if(!strncmp(src, "<", 1)){ > > +- possibilities[i]->constraint = EARLIER_EQUAL; > > +- src++; > > +- } > > +- else if(!strncmp(src, ">", 1)){ > > +- possibilities[i]->constraint = LATER_EQUAL; > > +- src++; > > +- } > > ++ possibilities[i]->constraint = str_to_constraint(&src); > > + > > + /* now we have any constraint, pass space to version string */ > > + while(isspace(*src)) src++; > > +diff --git a/libopkg/pkg_depends.h b/libopkg/pkg_depends.h > > +index ca0801f..685a722 100644 > > +--- a/libopkg/pkg_depends.h > > ++++ b/libopkg/pkg_depends.h > > +@@ -87,6 +87,7 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg); > > + int pkg_dependence_satisfiable(depend_t *depend); > > + int pkg_dependence_satisfied(depend_t *depend); > > + const char* constraint_to_str(enum version_constraint c); > > ++enum version_constraint str_to_constraint(char **str); > > + int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg); > > + > > + #endif > > +-- > > +1.7.12 > > + > > diff --git a/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch b/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch > > new file mode 100644 > > index 0000000..841b508 > > --- /dev/null > > +++ b/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch > > @@ -0,0 +1,37 @@ > > +From 51a45a02a32064c14e0d4d6ef41c1a6276432b29 Mon Sep 17 00:00:00 2001 > > +From: Martin Jansa <Martin.Jansa@gmail.com> > > +Date: Sat, 29 Sep 2012 18:56:01 +0200 > > +Subject: [PATCH 10/10] pkg_depends: fix version_constraints_satisfied > > + > > +* with > > + Package: a > > + Version: 1 > > + and > > + Conflicts: a (<< 1) > > + we have comparison == 0, but constraint EARLIER is not satisfied! > > + > > +Upstream-Status: Submitted > > +http://code.google.com/p/opkg/issues/detail?id=94 > > + > > +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> > > +--- > > + libopkg/pkg_depends.c | 3 ++- > > + 1 file changed, 2 insertions(+), 1 deletion(-) > > + > > +diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c > > +index 4b7a2a5..a67579a 100644 > > +--- a/libopkg/pkg_depends.c > > ++++ b/libopkg/pkg_depends.c > > +@@ -464,7 +464,8 @@ int version_constraints_satisfied(depend_t * depends, pkg_t * pkg) > > + else if((depends->constraint == LATER) && > > + (comparison > 0)) > > + return 1; > > +- else if(comparison == 0) > > ++ else if((depends->constraint == EQUAL) && > > ++ (comparison == 0)) > > + return 1; > > + else if((depends->constraint == LATER_EQUAL) && > > + (comparison >= 0)) > > +-- > > +1.7.12 > > + > > diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb > > index 820a224..d89a3f6 100644 > > --- a/meta/recipes-devtools/opkg/opkg_svn.bb > > +++ b/meta/recipes-devtools/opkg/opkg_svn.bb > > @@ -9,6 +9,8 @@ SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \ > > file://0006-detect-circular-dependencies.patch \ > > file://0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch \ > > file://0008-select_higher_version.patch \ > > + file://0009-pkg_depends-fix-version-constraints.patch \ > > + file://0010-pkg_depends-fix-version_constraints_satisfied.patch \ > > " > > > > S = "${WORKDIR}/trunk" > > @@ -16,4 +18,4 @@ S = "${WORKDIR}/trunk" > > SRCREV = "633" > > PV = "0.1.8+svnr${SRCPV}" > > > > -PR = "${INC_PR}.4" > > +PR = "${INC_PR}.5" > > -- > > 1.7.12 > > > > -- > Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com -- Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 205 bytes --] ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCHv3] opkg: fix version constraints in conflicts, depends, replaces 2012-09-30 12:53 ` Martin Jansa @ 2012-10-01 11:41 ` Martin Jansa 2012-10-02 15:12 ` Saul Wold 0 siblings, 1 reply; 13+ messages in thread From: Martin Jansa @ 2012-10-01 11:41 UTC (permalink / raw) To: openembedded-core * http://code.google.com/p/opkg/issues/detail?id=94 Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> --- .../0009-pkg_depends-fix-version-constraints.patch | 188 +++++++++++++++++++++ ...depends-fix-version_constraints_satisfied.patch | 37 ++++ meta/recipes-devtools/opkg/opkg_svn.bb | 4 +- 3 files changed, 228 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch create mode 100644 meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch diff --git a/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch b/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch new file mode 100644 index 0000000..f7aa4ea --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch @@ -0,0 +1,188 @@ +From b93ce2249751e0d90dab38e91691a6e9f33c3512 Mon Sep 17 00:00:00 2001 +From: Martin Jansa <Martin.Jansa@gmail.com> +Date: Sat, 29 Sep 2012 11:38:03 +0200 +Subject: [PATCH 09/10] pkg_depends: fix version constraints + +* factor parsing version constraint to str_to_constraint and use that + from pkg (pkg_version_satisfied) and also pkg_depends (parseDepends) +* fix constraint_to_str(), for EARLIER and LATER it was using '<' and + '>' which is parsed later as EARLIER_EQUAL and LATER_EQUAL +* show notice when deprecated '<' or '>' is used + +Upstream-Status: Submitted +http://code.google.com/p/opkg/issues/detail?id=94 + +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> +--- + libopkg/pkg.c | 36 +++++++++++-------------- + libopkg/pkg_depends.c | 73 +++++++++++++++++++++++++++++---------------------- + libopkg/pkg_depends.h | 1 + + 3 files changed, 59 insertions(+), 51 deletions(-) + +diff --git a/libopkg/pkg.c b/libopkg/pkg.c +index 255c673..1e98b9c 100644 +--- a/libopkg/pkg.c ++++ b/libopkg/pkg.c +@@ -968,28 +968,24 @@ pkg_version_satisfied(pkg_t *it, pkg_t *ref, const char *op) + int r; + + r = pkg_compare_versions(it, ref); ++ char *op2 = op; ++ enum version_constraint constraint = str_to_constraint(&op2); + +- if (strcmp(op, "<=") == 0 || strcmp(op, "<") == 0) { +- return r <= 0; +- } +- +- if (strcmp(op, ">=") == 0 || strcmp(op, ">") == 0) { +- return r >= 0; +- } +- +- if (strcmp(op, "<<") == 0) { +- return r < 0; +- } +- +- if (strcmp(op, ">>") == 0) { +- return r > 0; +- } +- +- if (strcmp(op, "=") == 0) { +- return r == 0; ++ switch (constraint) ++ { ++ case EARLIER_EQUAL: ++ return r <= 0; ++ case LATER_EQUAL: ++ return r >= 0; ++ case EARLIER: ++ return r < 0; ++ case LATER: ++ return r > 0; ++ case EQUAL: ++ return r == 0; ++ case NONE: ++ opkg_msg(ERROR, "Unknown operator: %s.\n", op); + } +- +- opkg_msg(ERROR, "Unknown operator: %s.\n", op); + return 0; + } + +diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c +index a72eed7..3dd8240 100644 +--- a/libopkg/pkg_depends.c ++++ b/libopkg/pkg_depends.c +@@ -781,7 +781,7 @@ constraint_to_str(enum version_constraint c) + case NONE: + return ""; + case EARLIER: +- return "< "; ++ return "<< "; + case EARLIER_EQUAL: + return "<= "; + case EQUAL: +@@ -789,12 +789,51 @@ constraint_to_str(enum version_constraint c) + case LATER_EQUAL: + return ">= "; + case LATER: +- return "> "; ++ return ">> "; + } + + return ""; + } + ++enum version_constraint ++str_to_constraint(char **str) ++{ ++ if(!strncmp(*str, "<<", 2)){ ++ *str += 2; ++ return EARLIER; ++ } ++ else if(!strncmp(*str, "<=", 2)){ ++ *str += 2; ++ return EARLIER_EQUAL; ++ } ++ else if(!strncmp(*str, ">=", 2)){ ++ *str += 2; ++ return LATER_EQUAL; ++ } ++ else if(!strncmp(*str, ">>", 2)){ ++ *str += 2; ++ return LATER; ++ } ++ else if(!strncmp(*str, "=", 1)){ ++ *str += 1; ++ return EQUAL; ++ } ++ /* should these be here to support deprecated designations; dpkg does */ ++ else if(!strncmp(*str, "<", 1)){ ++ *str += 1; ++ opkg_msg(NOTICE, "Deprecated version constraint '<' was used with the same meaning as '<='. Use '<<' for EARLIER constraint.\n"); ++ return EARLIER_EQUAL; ++ } ++ else if(!strncmp(*str, ">", 1)){ ++ *str += 1; ++ opkg_msg(NOTICE, "Deprecated version constraint '>' was used with the same meaning as '>='. Use '>>' for LATER constraint.\n"); ++ return LATER_EQUAL; ++ } ++ else { ++ return NONE; ++ } ++} ++ + /* + * Returns a printable string for pkg's dependency at the specified idx. The + * resultant string must be passed to free() by the caller. +@@ -949,35 +988,7 @@ static int parseDepends(compound_depend_t *compound_depend, + /* extract constraint and version */ + if(*src == '('){ + src++; +- if(!strncmp(src, "<<", 2)){ +- possibilities[i]->constraint = EARLIER; +- src += 2; +- } +- else if(!strncmp(src, "<=", 2)){ +- possibilities[i]->constraint = EARLIER_EQUAL; +- src += 2; +- } +- else if(!strncmp(src, ">=", 2)){ +- possibilities[i]->constraint = LATER_EQUAL; +- src += 2; +- } +- else if(!strncmp(src, ">>", 2)){ +- possibilities[i]->constraint = LATER; +- src += 2; +- } +- else if(!strncmp(src, "=", 1)){ +- possibilities[i]->constraint = EQUAL; +- src++; +- } +- /* should these be here to support deprecated designations; dpkg does */ +- else if(!strncmp(src, "<", 1)){ +- possibilities[i]->constraint = EARLIER_EQUAL; +- src++; +- } +- else if(!strncmp(src, ">", 1)){ +- possibilities[i]->constraint = LATER_EQUAL; +- src++; +- } ++ possibilities[i]->constraint = str_to_constraint(&src); + + /* now we have any constraint, pass space to version string */ + while(isspace(*src)) src++; +diff --git a/libopkg/pkg_depends.h b/libopkg/pkg_depends.h +index ca0801f..685a722 100644 +--- a/libopkg/pkg_depends.h ++++ b/libopkg/pkg_depends.h +@@ -87,6 +87,7 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg); + int pkg_dependence_satisfiable(depend_t *depend); + int pkg_dependence_satisfied(depend_t *depend); + const char* constraint_to_str(enum version_constraint c); ++enum version_constraint str_to_constraint(char **str); + int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg); + + #endif +-- +1.7.12 + diff --git a/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch b/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch new file mode 100644 index 0000000..a13d658 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch @@ -0,0 +1,37 @@ +From e9add8fe4a63ef14aba8bd238ddde84d5470b611 Mon Sep 17 00:00:00 2001 +From: Martin Jansa <Martin.Jansa@gmail.com> +Date: Sat, 29 Sep 2012 18:56:01 +0200 +Subject: [PATCH 10/10] pkg_depends: fix version_constraints_satisfied + +* with + Package: a + Version: 1 + and + Conflicts: a (<< 1) + we have comparison == 0, but constraint EARLIER is not satisfied! + +Upstream-Status: Submitted +http://code.google.com/p/opkg/issues/detail?id=94 + +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> +--- + libopkg/pkg_depends.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c +index 3dd8240..be81b7f 100644 +--- a/libopkg/pkg_depends.c ++++ b/libopkg/pkg_depends.c +@@ -464,7 +464,8 @@ int version_constraints_satisfied(depend_t * depends, pkg_t * pkg) + else if((depends->constraint == LATER) && + (comparison > 0)) + return 1; +- else if(comparison == 0) ++ else if((depends->constraint == EQUAL) && ++ (comparison == 0)) + return 1; + else if((depends->constraint == LATER_EQUAL) && + (comparison >= 0)) +-- +1.7.12 + diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb index 820a224..d89a3f6 100644 --- a/meta/recipes-devtools/opkg/opkg_svn.bb +++ b/meta/recipes-devtools/opkg/opkg_svn.bb @@ -9,6 +9,8 @@ SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \ file://0006-detect-circular-dependencies.patch \ file://0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch \ file://0008-select_higher_version.patch \ + file://0009-pkg_depends-fix-version-constraints.patch \ + file://0010-pkg_depends-fix-version_constraints_satisfied.patch \ " S = "${WORKDIR}/trunk" @@ -16,4 +18,4 @@ S = "${WORKDIR}/trunk" SRCREV = "633" PV = "0.1.8+svnr${SRCPV}" -PR = "${INC_PR}.4" +PR = "${INC_PR}.5" -- 1.7.12 ^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCHv3] opkg: fix version constraints in conflicts, depends, replaces 2012-10-01 11:41 ` [PATCHv3] " Martin Jansa @ 2012-10-02 15:12 ` Saul Wold 0 siblings, 0 replies; 13+ messages in thread From: Saul Wold @ 2012-10-02 15:12 UTC (permalink / raw) To: Martin Jansa; +Cc: openembedded-core On 10/01/2012 04:41 AM, Martin Jansa wrote: > * http://code.google.com/p/opkg/issues/detail?id=94 > > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> > --- > .../0009-pkg_depends-fix-version-constraints.patch | 188 +++++++++++++++++++++ > ...depends-fix-version_constraints_satisfied.patch | 37 ++++ > meta/recipes-devtools/opkg/opkg_svn.bb | 4 +- > 3 files changed, 228 insertions(+), 1 deletion(-) > create mode 100644 meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch > create mode 100644 meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch > Merged into OE-Core Thanks Sau! > diff --git a/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch b/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch > new file mode 100644 > index 0000000..f7aa4ea > --- /dev/null > +++ b/meta/recipes-devtools/opkg/opkg/0009-pkg_depends-fix-version-constraints.patch > @@ -0,0 +1,188 @@ > +From b93ce2249751e0d90dab38e91691a6e9f33c3512 Mon Sep 17 00:00:00 2001 > +From: Martin Jansa <Martin.Jansa@gmail.com> > +Date: Sat, 29 Sep 2012 11:38:03 +0200 > +Subject: [PATCH 09/10] pkg_depends: fix version constraints > + > +* factor parsing version constraint to str_to_constraint and use that > + from pkg (pkg_version_satisfied) and also pkg_depends (parseDepends) > +* fix constraint_to_str(), for EARLIER and LATER it was using '<' and > + '>' which is parsed later as EARLIER_EQUAL and LATER_EQUAL > +* show notice when deprecated '<' or '>' is used > + > +Upstream-Status: Submitted > +http://code.google.com/p/opkg/issues/detail?id=94 > + > +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> > +--- > + libopkg/pkg.c | 36 +++++++++++-------------- > + libopkg/pkg_depends.c | 73 +++++++++++++++++++++++++++++---------------------- > + libopkg/pkg_depends.h | 1 + > + 3 files changed, 59 insertions(+), 51 deletions(-) > + > +diff --git a/libopkg/pkg.c b/libopkg/pkg.c > +index 255c673..1e98b9c 100644 > +--- a/libopkg/pkg.c > ++++ b/libopkg/pkg.c > +@@ -968,28 +968,24 @@ pkg_version_satisfied(pkg_t *it, pkg_t *ref, const char *op) > + int r; > + > + r = pkg_compare_versions(it, ref); > ++ char *op2 = op; > ++ enum version_constraint constraint = str_to_constraint(&op2); > + > +- if (strcmp(op, "<=") == 0 || strcmp(op, "<") == 0) { > +- return r <= 0; > +- } > +- > +- if (strcmp(op, ">=") == 0 || strcmp(op, ">") == 0) { > +- return r >= 0; > +- } > +- > +- if (strcmp(op, "<<") == 0) { > +- return r < 0; > +- } > +- > +- if (strcmp(op, ">>") == 0) { > +- return r > 0; > +- } > +- > +- if (strcmp(op, "=") == 0) { > +- return r == 0; > ++ switch (constraint) > ++ { > ++ case EARLIER_EQUAL: > ++ return r <= 0; > ++ case LATER_EQUAL: > ++ return r >= 0; > ++ case EARLIER: > ++ return r < 0; > ++ case LATER: > ++ return r > 0; > ++ case EQUAL: > ++ return r == 0; > ++ case NONE: > ++ opkg_msg(ERROR, "Unknown operator: %s.\n", op); > + } > +- > +- opkg_msg(ERROR, "Unknown operator: %s.\n", op); > + return 0; > + } > + > +diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c > +index a72eed7..3dd8240 100644 > +--- a/libopkg/pkg_depends.c > ++++ b/libopkg/pkg_depends.c > +@@ -781,7 +781,7 @@ constraint_to_str(enum version_constraint c) > + case NONE: > + return ""; > + case EARLIER: > +- return "< "; > ++ return "<< "; > + case EARLIER_EQUAL: > + return "<= "; > + case EQUAL: > +@@ -789,12 +789,51 @@ constraint_to_str(enum version_constraint c) > + case LATER_EQUAL: > + return ">= "; > + case LATER: > +- return "> "; > ++ return ">> "; > + } > + > + return ""; > + } > + > ++enum version_constraint > ++str_to_constraint(char **str) > ++{ > ++ if(!strncmp(*str, "<<", 2)){ > ++ *str += 2; > ++ return EARLIER; > ++ } > ++ else if(!strncmp(*str, "<=", 2)){ > ++ *str += 2; > ++ return EARLIER_EQUAL; > ++ } > ++ else if(!strncmp(*str, ">=", 2)){ > ++ *str += 2; > ++ return LATER_EQUAL; > ++ } > ++ else if(!strncmp(*str, ">>", 2)){ > ++ *str += 2; > ++ return LATER; > ++ } > ++ else if(!strncmp(*str, "=", 1)){ > ++ *str += 1; > ++ return EQUAL; > ++ } > ++ /* should these be here to support deprecated designations; dpkg does */ > ++ else if(!strncmp(*str, "<", 1)){ > ++ *str += 1; > ++ opkg_msg(NOTICE, "Deprecated version constraint '<' was used with the same meaning as '<='. Use '<<' for EARLIER constraint.\n"); > ++ return EARLIER_EQUAL; > ++ } > ++ else if(!strncmp(*str, ">", 1)){ > ++ *str += 1; > ++ opkg_msg(NOTICE, "Deprecated version constraint '>' was used with the same meaning as '>='. Use '>>' for LATER constraint.\n"); > ++ return LATER_EQUAL; > ++ } > ++ else { > ++ return NONE; > ++ } > ++} > ++ > + /* > + * Returns a printable string for pkg's dependency at the specified idx. The > + * resultant string must be passed to free() by the caller. > +@@ -949,35 +988,7 @@ static int parseDepends(compound_depend_t *compound_depend, > + /* extract constraint and version */ > + if(*src == '('){ > + src++; > +- if(!strncmp(src, "<<", 2)){ > +- possibilities[i]->constraint = EARLIER; > +- src += 2; > +- } > +- else if(!strncmp(src, "<=", 2)){ > +- possibilities[i]->constraint = EARLIER_EQUAL; > +- src += 2; > +- } > +- else if(!strncmp(src, ">=", 2)){ > +- possibilities[i]->constraint = LATER_EQUAL; > +- src += 2; > +- } > +- else if(!strncmp(src, ">>", 2)){ > +- possibilities[i]->constraint = LATER; > +- src += 2; > +- } > +- else if(!strncmp(src, "=", 1)){ > +- possibilities[i]->constraint = EQUAL; > +- src++; > +- } > +- /* should these be here to support deprecated designations; dpkg does */ > +- else if(!strncmp(src, "<", 1)){ > +- possibilities[i]->constraint = EARLIER_EQUAL; > +- src++; > +- } > +- else if(!strncmp(src, ">", 1)){ > +- possibilities[i]->constraint = LATER_EQUAL; > +- src++; > +- } > ++ possibilities[i]->constraint = str_to_constraint(&src); > + > + /* now we have any constraint, pass space to version string */ > + while(isspace(*src)) src++; > +diff --git a/libopkg/pkg_depends.h b/libopkg/pkg_depends.h > +index ca0801f..685a722 100644 > +--- a/libopkg/pkg_depends.h > ++++ b/libopkg/pkg_depends.h > +@@ -87,6 +87,7 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg); > + int pkg_dependence_satisfiable(depend_t *depend); > + int pkg_dependence_satisfied(depend_t *depend); > + const char* constraint_to_str(enum version_constraint c); > ++enum version_constraint str_to_constraint(char **str); > + int is_pkg_in_pkg_vec(pkg_vec_t * vec, pkg_t * pkg); > + > + #endif > +-- > +1.7.12 > + > diff --git a/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch b/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch > new file mode 100644 > index 0000000..a13d658 > --- /dev/null > +++ b/meta/recipes-devtools/opkg/opkg/0010-pkg_depends-fix-version_constraints_satisfied.patch > @@ -0,0 +1,37 @@ > +From e9add8fe4a63ef14aba8bd238ddde84d5470b611 Mon Sep 17 00:00:00 2001 > +From: Martin Jansa <Martin.Jansa@gmail.com> > +Date: Sat, 29 Sep 2012 18:56:01 +0200 > +Subject: [PATCH 10/10] pkg_depends: fix version_constraints_satisfied > + > +* with > + Package: a > + Version: 1 > + and > + Conflicts: a (<< 1) > + we have comparison == 0, but constraint EARLIER is not satisfied! > + > +Upstream-Status: Submitted > +http://code.google.com/p/opkg/issues/detail?id=94 > + > +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> > +--- > + libopkg/pkg_depends.c | 3 ++- > + 1 file changed, 2 insertions(+), 1 deletion(-) > + > +diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c > +index 3dd8240..be81b7f 100644 > +--- a/libopkg/pkg_depends.c > ++++ b/libopkg/pkg_depends.c > +@@ -464,7 +464,8 @@ int version_constraints_satisfied(depend_t * depends, pkg_t * pkg) > + else if((depends->constraint == LATER) && > + (comparison > 0)) > + return 1; > +- else if(comparison == 0) > ++ else if((depends->constraint == EQUAL) && > ++ (comparison == 0)) > + return 1; > + else if((depends->constraint == LATER_EQUAL) && > + (comparison >= 0)) > +-- > +1.7.12 > + > diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb > index 820a224..d89a3f6 100644 > --- a/meta/recipes-devtools/opkg/opkg_svn.bb > +++ b/meta/recipes-devtools/opkg/opkg_svn.bb > @@ -9,6 +9,8 @@ SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \ > file://0006-detect-circular-dependencies.patch \ > file://0007-merge-newpkg-provides-even-when-oldpkg-provides-exis.patch \ > file://0008-select_higher_version.patch \ > + file://0009-pkg_depends-fix-version-constraints.patch \ > + file://0010-pkg_depends-fix-version_constraints_satisfied.patch \ > " > > S = "${WORKDIR}/trunk" > @@ -16,4 +18,4 @@ S = "${WORKDIR}/trunk" > SRCREV = "633" > PV = "0.1.8+svnr${SRCPV}" > > -PR = "${INC_PR}.4" > +PR = "${INC_PR}.5" > ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2012-10-02 15:26 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20120927142926.CA9C5103AC@opal>
2012-09-27 15:34 ` [oe-commits] Martin Jansa : xserver-xorg: use EXTENDPKGV instead of PV in RCONFLICTS_${PN}-module-exa Martin Jansa
2012-09-27 17:55 ` Martin Jansa
2012-09-27 18:08 ` Otavio Salvador
2012-09-27 22:41 ` Mark Hatle
2012-09-27 22:50 ` Martin Jansa
2012-09-28 12:02 ` Otavio Salvador
2012-09-29 8:43 ` Martin Jansa
2012-09-29 17:09 ` [PATCH] opkg: fix version constraints in conflicts, depends, replaces Martin Jansa
2012-09-29 17:19 ` [PATCHv2] " Martin Jansa
2012-09-30 9:06 ` Martin Jansa
2012-09-30 12:53 ` Martin Jansa
2012-10-01 11:41 ` [PATCHv3] " Martin Jansa
2012-10-02 15:12 ` Saul Wold
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox