All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] recipeutils: use UPSTREAM_CHECK_URI in get_recipe_upstream_version
@ 2024-03-28 15:32 Jon Mason
  2024-03-28 15:54 ` [OE-core] " Alexander Kanavin
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Mason @ 2024-03-28 15:32 UTC (permalink / raw)
  To: openembedded-core

Currently, get_recipe_upstream_version blindly takes the first entry in
SRC_URI to see if the recipe is at the latest version.  If
UPSTREAM_CHECK_URI is specified in a recipe, it is probably what should
be used to check for the latest version.  Use that as the first check,
otherwise default back to the first entry in SRC_URI.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
---
 meta/lib/oe/recipeutils.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index de1fbdd3a8c8..a42609060cd9 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -1041,8 +1041,13 @@ def get_recipe_upstream_version(rd):
         ru['datetime'] = datetime.now()
         return ru
 
-    # XXX: we suppose that the first entry points to the upstream sources
-    src_uri = src_uris.split()[0]
+    # If UPSTREAM_CHECK_URI is specified, assume it is correct and use
+    # it.  Otherwise, use the first SRC_URI specified to determine the
+    # latest version.
+    if rd.getVar('UPSTREAM_CHECK_URI'):
+        src_uri = str(rd.getVar('UPSTREAM_CHECK_URI'))
+    else:
+        src_uri = src_uris.split()[0]
     uri_type, _, _, _, _, _ =  decodeurl(src_uri)
 
     (pv, pfx, sfx) = get_recipe_pv_with_pfx_sfx(rd.getVar('PV'), uri_type)
-- 
2.30.2



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

* Re: [OE-core] [PATCH] recipeutils: use UPSTREAM_CHECK_URI in get_recipe_upstream_version
  2024-03-28 15:32 [PATCH] recipeutils: use UPSTREAM_CHECK_URI in get_recipe_upstream_version Jon Mason
@ 2024-03-28 15:54 ` Alexander Kanavin
  2024-04-02 18:07   ` Jon Mason
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Kanavin @ 2024-03-28 15:54 UTC (permalink / raw)
  To: Jon Mason; +Cc: openembedded-core

Unfortunately this isn't correct either. UPSTREAM_CHECK_URI is already
checked by the wget fetcher to override the default (which is first
entry in SRC_URI), so if you need it in other fetchers (e.g git), you
should either add support for it there as well, or remove the code
from wget fetcher at the same time. Otherwise, this change will make
things very inconsistent and confusing.

Alex

On Thu, 28 Mar 2024 at 16:32, Jon Mason <jdmason@kudzu.us> wrote:
>
> Currently, get_recipe_upstream_version blindly takes the first entry in
> SRC_URI to see if the recipe is at the latest version.  If
> UPSTREAM_CHECK_URI is specified in a recipe, it is probably what should
> be used to check for the latest version.  Use that as the first check,
> otherwise default back to the first entry in SRC_URI.
>
> Signed-off-by: Jon Mason <jdmason@kudzu.us>
> ---
>  meta/lib/oe/recipeutils.py | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
> index de1fbdd3a8c8..a42609060cd9 100644
> --- a/meta/lib/oe/recipeutils.py
> +++ b/meta/lib/oe/recipeutils.py
> @@ -1041,8 +1041,13 @@ def get_recipe_upstream_version(rd):
>          ru['datetime'] = datetime.now()
>          return ru
>
> -    # XXX: we suppose that the first entry points to the upstream sources
> -    src_uri = src_uris.split()[0]
> +    # If UPSTREAM_CHECK_URI is specified, assume it is correct and use
> +    # it.  Otherwise, use the first SRC_URI specified to determine the
> +    # latest version.
> +    if rd.getVar('UPSTREAM_CHECK_URI'):
> +        src_uri = str(rd.getVar('UPSTREAM_CHECK_URI'))
> +    else:
> +        src_uri = src_uris.split()[0]
>      uri_type, _, _, _, _, _ =  decodeurl(src_uri)
>
>      (pv, pfx, sfx) = get_recipe_pv_with_pfx_sfx(rd.getVar('PV'), uri_type)
> --
> 2.30.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#197580): https://lists.openembedded.org/g/openembedded-core/message/197580
> Mute This Topic: https://lists.openembedded.org/mt/105198896/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


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

* Re: [OE-core] [PATCH] recipeutils: use UPSTREAM_CHECK_URI in get_recipe_upstream_version
  2024-03-28 15:54 ` [OE-core] " Alexander Kanavin
@ 2024-04-02 18:07   ` Jon Mason
  0 siblings, 0 replies; 3+ messages in thread
From: Jon Mason @ 2024-04-02 18:07 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: openembedded-core

On Thu, Mar 28, 2024 at 11:54 AM Alexander Kanavin
<alex.kanavin@gmail.com> wrote:
>
> Unfortunately this isn't correct either. UPSTREAM_CHECK_URI is already
> checked by the wget fetcher to override the default (which is first
> entry in SRC_URI), so if you need it in other fetchers (e.g git), you
> should either add support for it there as well, or remove the code
> from wget fetcher at the same time. Otherwise, this change will make
> things very inconsistent and confusing.

Since you can specify a UPSTREAM_CHECK_URI that is a different fetch
methodology (e.g, git, cvs, wget, etc) than the SRC_URI now, it is
already inconsistent.  Performing the check for UPSTREAM_CHECK_URI
should be done in the get_upstream_version, so it can then use
whatever fetch methodology is specified.  So, I think it best to
remove the logic in wget.

I'll do a v2 to make the above change.

Thank you for taking the time to review my patch, and providing guidance.

Thanks,
Jon

> Alex
>
> On Thu, 28 Mar 2024 at 16:32, Jon Mason <jdmason@kudzu.us> wrote:
> >
> > Currently, get_recipe_upstream_version blindly takes the first entry in
> > SRC_URI to see if the recipe is at the latest version.  If
> > UPSTREAM_CHECK_URI is specified in a recipe, it is probably what should
> > be used to check for the latest version.  Use that as the first check,
> > otherwise default back to the first entry in SRC_URI.
> >
> > Signed-off-by: Jon Mason <jdmason@kudzu.us>
> > ---
> >  meta/lib/oe/recipeutils.py | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
> > index de1fbdd3a8c8..a42609060cd9 100644
> > --- a/meta/lib/oe/recipeutils.py
> > +++ b/meta/lib/oe/recipeutils.py
> > @@ -1041,8 +1041,13 @@ def get_recipe_upstream_version(rd):
> >          ru['datetime'] = datetime.now()
> >          return ru
> >
> > -    # XXX: we suppose that the first entry points to the upstream sources
> > -    src_uri = src_uris.split()[0]
> > +    # If UPSTREAM_CHECK_URI is specified, assume it is correct and use
> > +    # it.  Otherwise, use the first SRC_URI specified to determine the
> > +    # latest version.
> > +    if rd.getVar('UPSTREAM_CHECK_URI'):
> > +        src_uri = str(rd.getVar('UPSTREAM_CHECK_URI'))
> > +    else:
> > +        src_uri = src_uris.split()[0]
> >      uri_type, _, _, _, _, _ =  decodeurl(src_uri)
> >
> >      (pv, pfx, sfx) = get_recipe_pv_with_pfx_sfx(rd.getVar('PV'), uri_type)
> > --
> > 2.30.2
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#197580): https://lists.openembedded.org/g/openembedded-core/message/197580
> > Mute This Topic: https://lists.openembedded.org/mt/105198896/1686489
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >


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

end of thread, other threads:[~2024-04-02 18:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28 15:32 [PATCH] recipeutils: use UPSTREAM_CHECK_URI in get_recipe_upstream_version Jon Mason
2024-03-28 15:54 ` [OE-core] " Alexander Kanavin
2024-04-02 18:07   ` Jon Mason

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.