From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B718EC433F5 for ; Wed, 25 May 2022 11:01:45 +0000 (UTC) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mx.groups.io with SMTP id smtpd.web12.5343.1653476496352086823 for ; Wed, 25 May 2022 04:01:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XGf6iSAB; spf=pass (domain: gmail.com, ip: 209.85.167.50, mailfrom: alex.kanavin@gmail.com) Received: by mail-lf1-f50.google.com with SMTP id c19so22328138lfv.5 for ; Wed, 25 May 2022 04:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Jw4k40BLx3mgUtMVPBR082sIolHghTtnu4NdvxHRA6s=; b=XGf6iSABkRrcgcoWA4dOpkFju9POA+Wn9ZNmqMTrDCKJXzrjGD6QAVMtB58bBS8an3 3nARSKUQ52adDncf6WgBz9LF0o5K90JRMNx5jMeQIjLtW03meEn8YZOYqMud9+uuTYeJ hJQYo8lCWYYYxOTfsAArxNqOEoeinYllsNAZ8WV4HHSBS6b36Gx+bAYVhVPbCbMguim8 b+xKTAATNJTHVVdWvrJs0lIjdsPbNssv4qJy+pBgcWHNzk2xxcJ6EuD50cE1NxB5fIOX jr8RxCHOs3cI+rMt7q7euDV4irFbRZAYlG6y14A0r6lEM2AT6DX7768G2IDouebJ/bZq 1MyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Jw4k40BLx3mgUtMVPBR082sIolHghTtnu4NdvxHRA6s=; b=geB31tN1rgEb/dvsfeOdTg5LfzAJmyE0AjdQVjbjm1PUZIGw/v4xlseLbceNzVK/Xl W67oLebeO5+Z1bdmdqvsdRYBju9nJRw/fwS3tyCditRssww9DSJt0XBlP55518H3Wku8 aW8KFCfGMuIuksf1DE/YTUJ5rh+LyeTLHBThyYvYUaMh3N/Ynct1VJbwciuHBiC+xT5+ cbYR65JTib8zj0Cub51+nLFA3rDyX1RCc/fWvfEYREIOZgcdhAyi4vGRbAsg/zh9AUO1 34hJsgzQ545+gpH5t/j0NO+pTOBFpAgJsNvWdyNQ+4fpKG/eK8oAYwt2rGKJCw5ueIkv /QkQ== X-Gm-Message-State: AOAM531tnIvkscmcSKWCrgmnIjIa7KZ8tZKdoQH/+qNap4QfuU/8PEy/ W+CpODI01Sv1uj3diJI80G6sFOs2sbuRHOj9gks= X-Google-Smtp-Source: ABdhPJzVXTOsVyGEJeV6aaBk+Sx3oNEG1XZzcfeThCEhPL9qu0ye26BbIq1394TEanbDCE1hGGLKH2WfjsCx/b5luzQ= X-Received: by 2002:a05:6512:2348:b0:478:5ad6:af37 with SMTP id p8-20020a056512234800b004785ad6af37mr16633030lfu.26.1653476494513; Wed, 25 May 2022 04:01:34 -0700 (PDT) MIME-Version: 1.0 References: <20220524173622.4033177-1-alex@linutronix.de> <20220525102904.016e5c61@melee> In-Reply-To: <20220525102904.016e5c61@melee> From: Alexander Kanavin Date: Wed, 25 May 2022 13:01:23 +0200 Message-ID: Subject: Re: [OE-core] [PATCH] apt: fix upstream version check To: Luca Ceresoli Cc: Alexander Kanavin , openembedded-core@lists.openembedded.org Content-Type: multipart/alternative; boundary="000000000000199b3205dfd3ffa2" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 25 May 2022 11:01:45 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/166116 --000000000000199b3205dfd3ffa2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I haven=E2=80=99t seen it written explicitly, it comes from what stable Deb= ian releases actually carry. There=E2=80=99s no harm in having a check that=E2= =80=99s too strict, but there is harm in updating to versions that are actually intended for testing or unstable (and that=E2=80=99s what 2.4 is). Alex On Wed 25. May 2022 at 10.29, Luca Ceresoli wrote: > Hi Alex, > > Il giorno Tue, 24 May 2022 19:36:22 +0200 > "Alexander Kanavin" ha scritto: > > > Signed-off-by: Alexander Kanavin > > --- > > meta/recipes-devtools/apt/apt_2.4.5.bb | 10 ++++++++-- > > 1 file changed, 8 insertions(+), 2 deletions(-) > > > > diff --git a/meta/recipes-devtools/apt/apt_2.4.5.bb > b/meta/recipes-devtools/apt/apt_2.4.5.bb > > index 95c25e3036..1d94dd118c 100644 > > --- a/meta/recipes-devtools/apt/apt_2.4.5.bb > > +++ b/meta/recipes-devtools/apt/apt_2.4.5.bb > > @@ -31,8 +31,14 @@ LIC_FILES_CHKSUM =3D > "file://COPYING.GPL;md5=3Db234ee4d69f5fce4486a80fdaf4a4263" > > # the package is taken from snapshots.debian.org; that source is > static and goes stale > > # so we check the latest upstream from a directory that does get updat= ed > > UPSTREAM_CHECK_URI =3D "${DEBIAN_MIRROR}/main/a/apt/" > > - > > -inherit cmake perlnative bash-completion upstream-version-is-even > useradd > > +# apt seems to follow a peculiar version policy, where every *other* > even version > > +# is considered stable, e.g. 1.0, 1.4, 1.8, 2.2, 2.6, etc. As there is > no way > > +# to express 'divisible by 4 plus 2' in regex (that I know of), let's > hardcode a few. > > Or, "how to reinvent the wheel in order to uselessly complicate other > people's lives". > > I'm taking your patch for testing, but I have a question. > > Is this policy documented? If so, IMO a URL here would be nice. > Otherwise, is it wise to encode future stable releases here without > really knowing whether the practice seen so far will go on in the > future? > > > +UPSTREAM_CHECK_REGEX =3D > "[^\d\.](?P((2\.2)|(2\.6)|(3\.0)|(3\.4)|(3\.8)|(4\.2))(\.\d+)+)\.ta= r" > > Maybe this would be more generic (untested): > > (([2468\.[26])|([3579]\.[048])) > > -- > Luca Ceresoli, Bootlin > Embedded Linux and Kernel engineering > https://bootlin.com > --000000000000199b3205dfd3ffa2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I haven=E2=80=99t seen it written explicitly, it comes fr= om what stable Debian releases actually carry. There=E2=80=99s no harm in h= aving a check that=E2=80=99s too strict, but there is harm in updating to v= ersions that are actually intended for testing or unstable (and that=E2=80= =99s what 2.4 is).

Alex<= /div>

On Wed 25. May 2022 at 10.29, Luca Ceresoli <luca.ceresoli@bootlin.com> wrote:
Hi Alex,

Il giorno Tue, 24 May 2022 19:36:22 +0200
"Alexander Kanavin" <alex.kanavin@gmail.com> ha scritto:

> Signed-off-by: Alexander Kanavin <alex@linutronix.de>
> ---
>=C2=A0 meta/recipes-devtools/apt/apt_2.4.5.bb | 10 ++++++++--
>=C2=A0 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-devtools/apt/apt_2.4.5.bb b/meta/recipes-devto= ols/apt/apt_2.4.5.bb
> index 95c25e3036..1d94dd118c 100644
> --- a/meta/recipes-devtools/apt/apt_2.4.5.bb
> +++ b/meta/recipes-devtools/apt/apt_2.4.5.bb
> @@ -31,8 +31,14 @@ LIC_FILES_CHKSUM =3D "file://COPYING.GPL;md5= =3Db234ee4d69f5fce4486a80fdaf4a4263"
>=C2=A0 # the package is taken from snapshots.debian.org; that sou= rce is static and goes stale
>=C2=A0 # so we check the latest upstream from a directory that does get= updated
>=C2=A0 UPSTREAM_CHECK_URI =3D "${DEBIAN_MIRROR}/main/a/apt/"<= br> > -
> -inherit cmake perlnative bash-completion upstream-version-is-even use= radd
> +# apt seems to follow a peculiar version policy, where every *other* = even version
> +# is considered stable, e.g. 1.0, 1.4, 1.8, 2.2, 2.6, etc. As there i= s no way
> +# to express 'divisible by 4 plus 2' in regex (that I know of= ), let's hardcode a few.

Or, "how to reinvent the wheel in order to uselessly complicate other<= br> people's lives".

I'm taking your patch for testing, but I have a question.

Is this=C2=A0 policy documented? If so, IMO a URL here would be nice.
Otherwise, is it wise to encode future stable releases here without
really knowing whether the practice seen so far will go on in the
future?

> +UPSTREAM_CHECK_REGEX =3D "[^\d\.](?P<pver>((2\.2)|(2\.6)|(= 3\.0)|(3\.4)|(3\.8)|(4\.2))(\.\d+)+)\.tar"

Maybe this would be more generic (untested):

=C2=A0 (([2468\.[26])|([3579]\.[048]))

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https:= //bootlin.com
--000000000000199b3205dfd3ffa2--