* [PATCH] git: add SRC_URI name @ 2010-02-21 15:32 Bernhard Reutner-Fischer 2010-02-22 16:24 ` Denys Dmytriyenko 0 siblings, 1 reply; 12+ messages in thread From: Bernhard Reutner-Fischer @ 2010-02-21 15:32 UTC (permalink / raw) To: openembedded-devel Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> --- recipes/git/git.inc | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/recipes/git/git.inc b/recipes/git/git.inc index 644e159..fd7b708 100644 --- a/recipes/git/git.inc +++ b/recipes/git/git.inc @@ -2,7 +2,7 @@ DESCRIPTION = "The git revision control system used by the Linux kernel develope SECTION = "console/utils" LICENSE = "GPL" -SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2" +SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2;name=git" S = "${WORKDIR}/git-${PV}" -- 1.6.6 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] git: add SRC_URI name 2010-02-21 15:32 [PATCH] git: add SRC_URI name Bernhard Reutner-Fischer @ 2010-02-22 16:24 ` Denys Dmytriyenko 2010-02-22 16:55 ` Phil Blundell 0 siblings, 1 reply; 12+ messages in thread From: Denys Dmytriyenko @ 2010-02-22 16:24 UTC (permalink / raw) To: openembedded-devel On Sun, Feb 21, 2010 at 04:32:32PM +0100, Bernhard Reutner-Fischer wrote: > Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> > --- > recipes/git/git.inc | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/recipes/git/git.inc b/recipes/git/git.inc > index 644e159..fd7b708 100644 > --- a/recipes/git/git.inc > +++ b/recipes/git/git.inc > @@ -2,7 +2,7 @@ DESCRIPTION = "The git revision control system used by the Linux kernel develope > SECTION = "console/utils" > LICENSE = "GPL" > > -SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2" > +SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2;name=git" Is there a patch to add checksums in corresponding recipes to use the name? Or what is the purpose of adding one? -- Denys ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git: add SRC_URI name 2010-02-22 16:24 ` Denys Dmytriyenko @ 2010-02-22 16:55 ` Phil Blundell 2010-02-22 17:06 ` Chris Larson 0 siblings, 1 reply; 12+ messages in thread From: Phil Blundell @ 2010-02-22 16:55 UTC (permalink / raw) To: openembedded-devel On Mon, 2010-02-22 at 11:24 -0500, Denys Dmytriyenko wrote: > On Sun, Feb 21, 2010 at 04:32:32PM +0100, Bernhard Reutner-Fischer wrote: > > Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> > > --- > > recipes/git/git.inc | 2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/recipes/git/git.inc b/recipes/git/git.inc > > index 644e159..fd7b708 100644 > > --- a/recipes/git/git.inc > > +++ b/recipes/git/git.inc > > @@ -2,7 +2,7 @@ DESCRIPTION = "The git revision control system used by the Linux kernel develope > > SECTION = "console/utils" > > LICENSE = "GPL" > > > > -SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2" > > +SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2;name=git" > > Is there a patch to add checksums in corresponding recipes to use the name? Or > what is the purpose of adding one? I guess the idea is to make it possible for new recipes (which use this .inc file) to include their own checksums. Seems like a reasonable enough plan even if the old recipes are not converted. p. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git: add SRC_URI name 2010-02-22 16:55 ` Phil Blundell @ 2010-02-22 17:06 ` Chris Larson 2010-02-22 18:17 ` Martin Jansa 0 siblings, 1 reply; 12+ messages in thread From: Chris Larson @ 2010-02-22 17:06 UTC (permalink / raw) To: openembedded-devel On Mon, Feb 22, 2010 at 9:55 AM, Phil Blundell <philb@gnu.org> wrote: > On Mon, 2010-02-22 at 11:24 -0500, Denys Dmytriyenko wrote: >> On Sun, Feb 21, 2010 at 04:32:32PM +0100, Bernhard Reutner-Fischer wrote: >> > Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> >> > --- >> > recipes/git/git.inc | 2 +- >> > 1 files changed, 1 insertions(+), 1 deletions(-) >> > >> > diff --git a/recipes/git/git.inc b/recipes/git/git.inc >> > index 644e159..fd7b708 100644 >> > --- a/recipes/git/git.inc >> > +++ b/recipes/git/git.inc >> > @@ -2,7 +2,7 @@ DESCRIPTION = "The git revision control system used by the Linux kernel develope >> > SECTION = "console/utils" >> > LICENSE = "GPL" >> > >> > -SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2" >> > +SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2;name=git" >> >> Is there a patch to add checksums in corresponding recipes to use the name? Or >> what is the purpose of adding one? > > I guess the idea is to make it possible for new recipes (which use > this .inc file) to include their own checksums. Seems like a reasonable > enough plan even if the old recipes are not converted. Has anyone thought about programmatically injecting a name to the first tarball/zip in the SRC_URI if no sources have that name yet? It seems like adding a name to the primary tarball is becoming common boilerplate, and the common case is for that to be the first source. -- Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git: add SRC_URI name 2010-02-22 17:06 ` Chris Larson @ 2010-02-22 18:17 ` Martin Jansa 2010-02-22 19:41 ` Bernhard Reutner-Fischer 0 siblings, 1 reply; 12+ messages in thread From: Martin Jansa @ 2010-02-22 18:17 UTC (permalink / raw) To: openembedded-devel On Mon, Feb 22, 2010 at 10:06:00AM -0700, Chris Larson wrote: > On Mon, Feb 22, 2010 at 9:55 AM, Phil Blundell <philb@gnu.org> wrote: > > On Mon, 2010-02-22 at 11:24 -0500, Denys Dmytriyenko wrote: > >> On Sun, Feb 21, 2010 at 04:32:32PM +0100, Bernhard Reutner-Fischer wrote: > >> > Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> > >> > --- > >> > recipes/git/git.inc | 2 +- > >> > 1 files changed, 1 insertions(+), 1 deletions(-) > >> > > >> > diff --git a/recipes/git/git.inc b/recipes/git/git.inc > >> > index 644e159..fd7b708 100644 > >> > --- a/recipes/git/git.inc > >> > +++ b/recipes/git/git.inc > >> > @@ -2,7 +2,7 @@ DESCRIPTION = "The git revision control system used by the Linux kernel develope > >> > SECTION = "console/utils" > >> > LICENSE = "GPL" > >> > > >> > -SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2" > >> > +SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2;name=git" > >> > >> Is there a patch to add checksums in corresponding recipes to use the name? Or > >> what is the purpose of adding one? > > > > I guess the idea is to make it possible for new recipes (which use > > this .inc file) to include their own checksums. Seems like a reasonable > > enough plan even if the old recipes are not converted. > > Has anyone thought about programmatically injecting a name to the > first tarball/zip in the SRC_URI if no sources have that name yet? It > seems like adding a name to the primary tarball is becoming common > boilerplate, and the common case is for that to be the first source. Also would be great to have unified names where possible. It would make adding new recipes a bit easier (no need to check/copy&paster name used in .inc and also base.bbclass could easily generate those checksum sections with right name easier. I'm using "archive" as few others also used. Regards, -- uin:136542059 jid:Martin.Jansa@gmail.com Jansa Martin sip:jamasip@voip.wengo.fr JaMa ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git: add SRC_URI name 2010-02-22 18:17 ` Martin Jansa @ 2010-02-22 19:41 ` Bernhard Reutner-Fischer 2010-02-22 21:43 ` Bernhard Reutner-Fischer 0 siblings, 1 reply; 12+ messages in thread From: Bernhard Reutner-Fischer @ 2010-02-22 19:41 UTC (permalink / raw) To: openembedded-devel On Mon, Feb 22, 2010 at 07:17:54PM +0100, Martin Jansa wrote: >On Mon, Feb 22, 2010 at 10:06:00AM -0700, Chris Larson wrote: >> On Mon, Feb 22, 2010 at 9:55 AM, Phil Blundell <philb@gnu.org> wrote: >> > On Mon, 2010-02-22 at 11:24 -0500, Denys Dmytriyenko wrote: >> >> On Sun, Feb 21, 2010 at 04:32:32PM +0100, Bernhard Reutner-Fischer wrote: >> >> > Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> >> >> > --- >> >> > recipes/git/git.inc | 2 +- >> >> > 1 files changed, 1 insertions(+), 1 deletions(-) >> >> > >> >> > diff --git a/recipes/git/git.inc b/recipes/git/git.inc >> >> > index 644e159..fd7b708 100644 >> >> > --- a/recipes/git/git.inc >> >> > +++ b/recipes/git/git.inc >> >> > @@ -2,7 +2,7 @@ DESCRIPTION = "The git revision control system used by the Linux kernel develope >> >> > SECTION = "console/utils" >> >> > LICENSE = "GPL" >> >> > >> >> > -SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2" >> >> > +SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2;name=git" >> >> >> >> Is there a patch to add checksums in corresponding recipes to use the name? Or >> >> what is the purpose of adding one? >> > >> > I guess the idea is to make it possible for new recipes (which use >> > this .inc file) to include their own checksums. Seems like a reasonable >> > enough plan even if the old recipes are not converted. >> >> Has anyone thought about programmatically injecting a name to the >> first tarball/zip in the SRC_URI if no sources have that name yet? It >> seems like adding a name to the primary tarball is becoming common >> boilerplate, and the common case is for that to be the first source. For recipes that have only one fetched source, could we perhaps default to plain SRC_URI[md5sum], without a name. If a second fetched source is added, this would transparently break (i.e. require adding two names). > >Also would be great to have unified names where possible. For recipes that have two or more fetched sources, i personally would use PN but, as you say, that has the disadvantage that you have to potentially lookup the package name in an .inc. Not my call though. >It would make adding new recipes a bit easier (no need to >check/copy&paster name used in .inc and also base.bbclass could easily >generate those checksum sections with right name easier. > >I'm using "archive" as few others also used. and some use tarball, some pn .... ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git: add SRC_URI name 2010-02-22 19:41 ` Bernhard Reutner-Fischer @ 2010-02-22 21:43 ` Bernhard Reutner-Fischer 2010-02-22 22:06 ` Denys Dmytriyenko 0 siblings, 1 reply; 12+ messages in thread From: Bernhard Reutner-Fischer @ 2010-02-22 21:43 UTC (permalink / raw) To: openembedded-devel [-- Attachment #1: Type: text/plain, Size: 2882 bytes --] On Mon, Feb 22, 2010 at 08:41:59PM +0100, Bernhard Reutner-Fischer wrote: >On Mon, Feb 22, 2010 at 07:17:54PM +0100, Martin Jansa wrote: >>On Mon, Feb 22, 2010 at 10:06:00AM -0700, Chris Larson wrote: >>> On Mon, Feb 22, 2010 at 9:55 AM, Phil Blundell <philb@gnu.org> wrote: >>> > On Mon, 2010-02-22 at 11:24 -0500, Denys Dmytriyenko wrote: >>> >> On Sun, Feb 21, 2010 at 04:32:32PM +0100, Bernhard Reutner-Fischer wrote: >>> >> > Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> >>> >> > --- >>> >> > recipes/git/git.inc | 2 +- >>> >> > 1 files changed, 1 insertions(+), 1 deletions(-) >>> >> > >>> >> > diff --git a/recipes/git/git.inc b/recipes/git/git.inc >>> >> > index 644e159..fd7b708 100644 >>> >> > --- a/recipes/git/git.inc >>> >> > +++ b/recipes/git/git.inc >>> >> > @@ -2,7 +2,7 @@ DESCRIPTION = "The git revision control system used by the Linux kernel develope >>> >> > SECTION = "console/utils" >>> >> > LICENSE = "GPL" >>> >> > >>> >> > -SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2" >>> >> > +SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2;name=git" >>> >> >>> >> Is there a patch to add checksums in corresponding recipes to use the name? Or >>> >> what is the purpose of adding one? >>> > >>> > I guess the idea is to make it possible for new recipes (which use >>> > this .inc file) to include their own checksums. Seems like a reasonable >>> > enough plan even if the old recipes are not converted. >>> >>> Has anyone thought about programmatically injecting a name to the >>> first tarball/zip in the SRC_URI if no sources have that name yet? It >>> seems like adding a name to the primary tarball is becoming common >>> boilerplate, and the common case is for that to be the first source. > >For recipes that have only one fetched source, could we perhaps default >to plain SRC_URI[md5sum], without a name. If a second fetched source is >added, this would transparently break (i.e. require adding two names). >> >>Also would be great to have unified names where possible. > >For recipes that have two or more fetched sources, i personally would >use PN but, as you say, that has the disadvantage that you have to >potentially lookup the package name in an .inc. Not my call though. > >>It would make adding new recipes a bit easier (no need to >>check/copy&paster name used in .inc and also base.bbclass could easily >>generate those checksum sections with right name easier. >> >>I'm using "archive" as few others also used. > >and some use tarball, some pn .... Not using "archive" as Martin likes as default, but uri%d, but what do you all think about the attached proposal (including docs!:)? cheers, PS: does the ftps fetcher work, i didn't bother to try, i admit.. docs seem to be inconsistent about it WRT wget.. [-- Attachment #2: default_checksums_SRC_URI.00.patch --] [-- Type: text/x-diff, Size: 4200 bytes --] diff --git a/classes/base.bbclass b/classes/base.bbclass index c8ee722..769cf2d 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -61,11 +61,15 @@ def base_chk_file_vars(parser, localpath, params, data): name = params["name"] except KeyError: return False - flagName = "%s.md5sum" % name - want_md5sum = bb.data.getVarFlag("SRC_URI", flagName, data) - flagName = "%s.sha256sum" % name - want_sha256sum = bb.data.getVarFlag("SRC_URI", flagName, data) - + if name: + md5flag = "%s.md5sum" % name + sha256flag = "%s.sha256sum" % name + else: + md5flag = "md5sum" + sha256flag = "sha256sum" + want_md5sum = bb.data.getVarFlag("SRC_URI", md5flag, data) + want_sha256sum = bb.data.getVarFlag("SRC_URI", sha256flag, data) + bb.note("sha=%s, md5=%s" % (want_md5sum, want_sha256sum)) if (want_sha256sum == None and want_md5sum == None): # no checksums to check, nothing to do return False @@ -702,12 +706,21 @@ python base_do_fetch() { pn = bb.data.getVar('PN', d, True) # Check each URI + uri_num = 0 for url in src_uri.split(): localpath = bb.data.expand(bb.fetch.localpath(url, localdata), localdata) (type,host,path,_,_,params) = bb.decodeurl(url) uri = "%s://%s%s" % (type,host,path) try: if type in [ "http", "https", "ftp", "ftps" ]: + # We provide a default shortcut of plain [] for the first fetch uri + # and default to uri%d for subsequent fetch uris. + # Explicit names in any uri overrides this default. + if not "name" in params: + if uri_num: + params["name"] = "uri%d" % uri_num + else: + params["name"] = "" if not (base_chk_file_vars(parser, localpath, params, d) or base_chk_file(parser, pn, pv,uri, localpath, d)): if not bb.data.getVar("OE_ALLOW_INSECURE_DOWNLOADS", d, True): bb.fatal("%s-%s: %s has no checksum defined, cannot check archive integrity" % (pn,pv,uri)) @@ -715,6 +728,7 @@ python base_do_fetch() { bb.note("%s-%s: %s has no checksum defined, archive integrity not checked" % (pn,pv,uri)) except Exception: raise bb.build.FuncFailed("Checksum of '%s' failed" % uri) + uri_num += 1 } addtask fetchall after do_fetch diff --git a/docs/usermanual/reference/var_src_uri.xml b/docs/usermanual/reference/var_src_uri.xml index a35e1ee..132bce8 100644 --- a/docs/usermanual/reference/var_src_uri.xml +++ b/docs/usermanual/reference/var_src_uri.xml @@ -29,7 +29,16 @@ be used in preference to retrieving a new version . Any source that is retrieved from a remote URI will be stored in the download source directory and an appropriate md5 sum generated and stored alongside it.</para> - + <para>Checksums for http/https/ftp/ftps uris are stored in each recipe in + the form of<screen>SRC_URI[md5sum] = "9a7a11ffd52d9c4553ea8c0134a6fa86" +SRC_URI[sha256sum] = "36bdb85c97b39ac604bc58cb7857ee08295242c78a12848ef8a31701921b9434"</screen> + for the first remote SRC_URI that has <emphasis>no</emphasis> explicit <command>name=foo</command> + associated with it. Following <emphasis>unnamed</emphasis> SRC_URIs default to<screen> +SRC_URI[uri1.md5sum] = +SRC_URI[uri1.sha256sum] = +SRC_URI[uri2.md5sum] = +SRC_URI[uri2.sha256sum] =</screen> + etc.</para> <para>Each URI supports a set of additional options. These options are tag/value pairs of the form <command>"a=b"</command> and are semi-colon separated from each other and from the URI. The follow examples shows two @@ -38,7 +47,7 @@ <variablelist> <varlistentry> - <term>http, https, ftps</term> + <term>http, https, ftp, ftps</term> <listitem> <para>Used to download files and source code via the specified URL. @@ -164,6 +173,7 @@ <term>md5sum</term> <listitem> + <para><note>DEPRECATED<!-- isn't it? --></note></para> <para>If an md5sum is provided then the downloaded files will only be considered valid if the md5sum of the downloaded file matches the md5sum option provided.</para> ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] git: add SRC_URI name 2010-02-22 21:43 ` Bernhard Reutner-Fischer @ 2010-02-22 22:06 ` Denys Dmytriyenko 2010-02-22 22:45 ` Bernhard Reutner-Fischer 0 siblings, 1 reply; 12+ messages in thread From: Denys Dmytriyenko @ 2010-02-22 22:06 UTC (permalink / raw) To: openembedded-devel On Mon, Feb 22, 2010 at 10:43:35PM +0100, Bernhard Reutner-Fischer wrote: > On Mon, Feb 22, 2010 at 08:41:59PM +0100, Bernhard Reutner-Fischer wrote: > >On Mon, Feb 22, 2010 at 07:17:54PM +0100, Martin Jansa wrote: > >>On Mon, Feb 22, 2010 at 10:06:00AM -0700, Chris Larson wrote: > >>> On Mon, Feb 22, 2010 at 9:55 AM, Phil Blundell <philb@gnu.org> wrote: > >>> > On Mon, 2010-02-22 at 11:24 -0500, Denys Dmytriyenko wrote: > >>> >> On Sun, Feb 21, 2010 at 04:32:32PM +0100, Bernhard Reutner-Fischer wrote: > >>> >> > Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> > >>> >> > --- > >>> >> > recipes/git/git.inc | 2 +- > >>> >> > 1 files changed, 1 insertions(+), 1 deletions(-) > >>> >> > > >>> >> > diff --git a/recipes/git/git.inc b/recipes/git/git.inc > >>> >> > index 644e159..fd7b708 100644 > >>> >> > --- a/recipes/git/git.inc > >>> >> > +++ b/recipes/git/git.inc > >>> >> > @@ -2,7 +2,7 @@ DESCRIPTION = "The git revision control system used by the Linux kernel develope > >>> >> > SECTION = "console/utils" > >>> >> > LICENSE = "GPL" > >>> >> > > >>> >> > -SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2" > >>> >> > +SRC_URI = "http://www.kernel.org/pub/software/scm/git/git-${PV}.tar.bz2;name=git" > >>> >> > >>> >> Is there a patch to add checksums in corresponding recipes to use the name? Or > >>> >> what is the purpose of adding one? > >>> > > >>> > I guess the idea is to make it possible for new recipes (which use > >>> > this .inc file) to include their own checksums. Seems like a reasonable > >>> > enough plan even if the old recipes are not converted. > >>> > >>> Has anyone thought about programmatically injecting a name to the > >>> first tarball/zip in the SRC_URI if no sources have that name yet? It > >>> seems like adding a name to the primary tarball is becoming common > >>> boilerplate, and the common case is for that to be the first source. > > > >For recipes that have only one fetched source, could we perhaps default > >to plain SRC_URI[md5sum], without a name. If a second fetched source is > >added, this would transparently break (i.e. require adding two names). > >> > >>Also would be great to have unified names where possible. > > > >For recipes that have two or more fetched sources, i personally would > >use PN but, as you say, that has the disadvantage that you have to > >potentially lookup the package name in an .inc. Not my call though. > > > >>It would make adding new recipes a bit easier (no need to > >>check/copy&paster name used in .inc and also base.bbclass could easily > >>generate those checksum sections with right name easier. > >> > >>I'm using "archive" as few others also used. > > > >and some use tarball, some pn .... > > Not using "archive" as Martin likes as default, but uri%d, but For multiple SRC_URIs, using uri1/uri2 can be more confusing and may be not much better than looking up real names in .inc file... > what do you all think about the attached proposal (including docs!:)? > > cheers, > > PS: does the ftps fetcher work, i didn't bother to try, i admit.. > docs seem to be inconsistent about it WRT wget.. > diff --git a/classes/base.bbclass b/classes/base.bbclass > index c8ee722..769cf2d 100644 > --- a/classes/base.bbclass > +++ b/classes/base.bbclass > @@ -61,11 +61,15 @@ def base_chk_file_vars(parser, localpath, params, data): > name = params["name"] > except KeyError: > return False > - flagName = "%s.md5sum" % name > - want_md5sum = bb.data.getVarFlag("SRC_URI", flagName, data) > - flagName = "%s.sha256sum" % name > - want_sha256sum = bb.data.getVarFlag("SRC_URI", flagName, data) > - > + if name: > + md5flag = "%s.md5sum" % name > + sha256flag = "%s.sha256sum" % name > + else: > + md5flag = "md5sum" > + sha256flag = "sha256sum" > + want_md5sum = bb.data.getVarFlag("SRC_URI", md5flag, data) > + want_sha256sum = bb.data.getVarFlag("SRC_URI", sha256flag, data) > + bb.note("sha=%s, md5=%s" % (want_md5sum, want_sha256sum)) > if (want_sha256sum == None and want_md5sum == None): > # no checksums to check, nothing to do > return False > @@ -702,12 +706,21 @@ python base_do_fetch() { > pn = bb.data.getVar('PN', d, True) > > # Check each URI > + uri_num = 0 > for url in src_uri.split(): > localpath = bb.data.expand(bb.fetch.localpath(url, localdata), localdata) > (type,host,path,_,_,params) = bb.decodeurl(url) > uri = "%s://%s%s" % (type,host,path) > try: > if type in [ "http", "https", "ftp", "ftps" ]: > + # We provide a default shortcut of plain [] for the first fetch uri > + # and default to uri%d for subsequent fetch uris. > + # Explicit names in any uri overrides this default. > + if not "name" in params: > + if uri_num: > + params["name"] = "uri%d" % uri_num > + else: > + params["name"] = "" > if not (base_chk_file_vars(parser, localpath, params, d) or base_chk_file(parser, pn, pv,uri, localpath, d)): > if not bb.data.getVar("OE_ALLOW_INSECURE_DOWNLOADS", d, True): > bb.fatal("%s-%s: %s has no checksum defined, cannot check archive integrity" % (pn,pv,uri)) > @@ -715,6 +728,7 @@ python base_do_fetch() { > bb.note("%s-%s: %s has no checksum defined, archive integrity not checked" % (pn,pv,uri)) > except Exception: > raise bb.build.FuncFailed("Checksum of '%s' failed" % uri) > + uri_num += 1 > } > > addtask fetchall after do_fetch > diff --git a/docs/usermanual/reference/var_src_uri.xml b/docs/usermanual/reference/var_src_uri.xml > index a35e1ee..132bce8 100644 > --- a/docs/usermanual/reference/var_src_uri.xml > +++ b/docs/usermanual/reference/var_src_uri.xml > @@ -29,7 +29,16 @@ > be used in preference to retrieving a new version . Any source that is > retrieved from a remote URI will be stored in the download source directory > and an appropriate md5 sum generated and stored alongside it.</para> > - > + <para>Checksums for http/https/ftp/ftps uris are stored in each recipe in > + the form of<screen>SRC_URI[md5sum] = "9a7a11ffd52d9c4553ea8c0134a6fa86" > +SRC_URI[sha256sum] = "36bdb85c97b39ac604bc58cb7857ee08295242c78a12848ef8a31701921b9434"</screen> > + for the first remote SRC_URI that has <emphasis>no</emphasis> explicit <command>name=foo</command> > + associated with it. Following <emphasis>unnamed</emphasis> SRC_URIs default to<screen> > +SRC_URI[uri1.md5sum] = > +SRC_URI[uri1.sha256sum] = > +SRC_URI[uri2.md5sum] = > +SRC_URI[uri2.sha256sum] =</screen> > + etc.</para> > <para>Each URI supports a set of additional options. These options are > tag/value pairs of the form <command>"a=b"</command> and are semi-colon > separated from each other and from the URI. The follow examples shows two > @@ -38,7 +47,7 @@ > > <variablelist> > <varlistentry> > - <term>http, https, ftps</term> > + <term>http, https, ftp, ftps</term> > > <listitem> > <para>Used to download files and source code via the specified URL. > @@ -164,6 +173,7 @@ > <term>md5sum</term> > > <listitem> > + <para><note>DEPRECATED<!-- isn't it? --></note></para> > <para>If an md5sum is provided then the downloaded files will only > be considered valid if the md5sum of the downloaded file matches the > md5sum option provided.</para> > _______________________________________________ > Openembedded-devel mailing list > Openembedded-devel@lists.openembedded.org > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git: add SRC_URI name 2010-02-22 22:06 ` Denys Dmytriyenko @ 2010-02-22 22:45 ` Bernhard Reutner-Fischer 2010-02-24 17:18 ` Bernhard Reutner-Fischer 0 siblings, 1 reply; 12+ messages in thread From: Bernhard Reutner-Fischer @ 2010-02-22 22:45 UTC (permalink / raw) To: openembedded-devel On Mon, Feb 22, 2010 at 05:06:21PM -0500, Denys Dmytriyenko wrote: >> Not using "archive" as Martin likes as default, but uri%d, but > >For multiple SRC_URIs, using uri1/uri2 can be more confusing and may be not >much better than looking up real names in .inc file... ok, so let's drop that superfluous .note and the url%d handling. Other opinions? ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git: add SRC_URI name 2010-02-22 22:45 ` Bernhard Reutner-Fischer @ 2010-02-24 17:18 ` Bernhard Reutner-Fischer 2010-03-05 20:53 ` Bernhard Reutner-Fischer 0 siblings, 1 reply; 12+ messages in thread From: Bernhard Reutner-Fischer @ 2010-02-24 17:18 UTC (permalink / raw) To: openembedded-devel [-- Attachment #1: Type: text/plain, Size: 485 bytes --] On Mon, Feb 22, 2010 at 11:45:43PM +0100, Bernhard Reutner-Fischer wrote: >On Mon, Feb 22, 2010 at 05:06:21PM -0500, Denys Dmytriyenko wrote: > >>> Not using "archive" as Martin likes as default, but uri%d, but >> >>For multiple SRC_URIs, using uri1/uri2 can be more confusing and may be not >>much better than looking up real names in .inc file... > >ok, so let's drop that superfluous .note and the url%d handling. >Other opinions? I'm using this now, fwiw. cheers, [-- Attachment #2: default-sum_for_first_uri.01.patch --] [-- Type: text/x-diff, Size: 3046 bytes --] diff --git a/classes/base.bbclass b/classes/base.bbclass index c8ee722..0b0a2d8 100644 --- a/classes/base.bbclass +++ b/classes/base.bbclass @@ -61,10 +61,14 @@ def base_chk_file_vars(parser, localpath, params, data): name = params["name"] except KeyError: return False - flagName = "%s.md5sum" % name - want_md5sum = bb.data.getVarFlag("SRC_URI", flagName, data) - flagName = "%s.sha256sum" % name - want_sha256sum = bb.data.getVarFlag("SRC_URI", flagName, data) + if name: + md5flag = "%s.md5sum" % name + sha256flag = "%s.sha256sum" % name + else: + md5flag = "md5sum" + sha256flag = "sha256sum" + want_md5sum = bb.data.getVarFlag("SRC_URI", md5flag, data) + want_sha256sum = bb.data.getVarFlag("SRC_URI", sha256flag, data) if (want_sha256sum == None and want_md5sum == None): # no checksums to check, nothing to do @@ -702,12 +706,18 @@ python base_do_fetch() { pn = bb.data.getVar('PN', d, True) # Check each URI + first_uri = True for url in src_uri.split(): localpath = bb.data.expand(bb.fetch.localpath(url, localdata), localdata) (type,host,path,_,_,params) = bb.decodeurl(url) uri = "%s://%s%s" % (type,host,path) try: if type in [ "http", "https", "ftp", "ftps" ]: + # We provide a default shortcut of plain [] for the first fetch uri + # Explicit names in any uri overrides this default. + if not "name" in params and first_uri: + first_uri = False + params["name"] = "" if not (base_chk_file_vars(parser, localpath, params, d) or base_chk_file(parser, pn, pv,uri, localpath, d)): if not bb.data.getVar("OE_ALLOW_INSECURE_DOWNLOADS", d, True): bb.fatal("%s-%s: %s has no checksum defined, cannot check archive integrity" % (pn,pv,uri)) diff --git a/docs/usermanual/reference/var_src_uri.xml b/docs/usermanual/reference/var_src_uri.xml index a35e1ee..7b51b56 100644 --- a/docs/usermanual/reference/var_src_uri.xml +++ b/docs/usermanual/reference/var_src_uri.xml @@ -29,7 +29,12 @@ be used in preference to retrieving a new version . Any source that is retrieved from a remote URI will be stored in the download source directory and an appropriate md5 sum generated and stored alongside it.</para> - + <para>Checksums for http/https/ftp/ftps uris are stored in each recipe in + the form of<screen>SRC_URI[md5sum] = "9a7a11ffd52d9c4553ea8c0134a6fa86" +SRC_URI[sha256sum] = "36bdb85c97b39ac604bc58cb7857ee08295242c78a12848ef8a31701921b9434"</screen> + for the first remote SRC_URI that has <emphasis>no</emphasis> explicit <command>name=foo</command> + associated with it. Following <emphasis>unnamed</emphasis> SRC_URIs without + a checksum will throw errors.</para> <para>Each URI supports a set of additional options. These options are tag/value pairs of the form <command>"a=b"</command> and are semi-colon separated from each other and from the URI. The follow examples shows two ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] git: add SRC_URI name 2010-02-24 17:18 ` Bernhard Reutner-Fischer @ 2010-03-05 20:53 ` Bernhard Reutner-Fischer 2010-03-22 11:07 ` Roman Khimov 0 siblings, 1 reply; 12+ messages in thread From: Bernhard Reutner-Fischer @ 2010-03-05 20:53 UTC (permalink / raw) To: Phil Blundell, Chris Larson, Martin Jansa; +Cc: openembedded-devel On Wed, Feb 24, 2010 at 06:18:32PM +0100, Bernhard Reutner-Fischer wrote: >On Mon, Feb 22, 2010 at 11:45:43PM +0100, Bernhard Reutner-Fischer wrote: >>On Mon, Feb 22, 2010 at 05:06:21PM -0500, Denys Dmytriyenko wrote: >> >>>> Not using "archive" as Martin likes as default, but uri%d, but >>> >>>For multiple SRC_URIs, using uri1/uri2 can be more confusing and may be not >>>much better than looking up real names in .inc file... >> >>ok, so let's drop that superfluous .note and the url%d handling. >>Other opinions? > >I'm using this now, fwiw. ping? > >cheers, >diff --git a/classes/base.bbclass b/classes/base.bbclass >index c8ee722..0b0a2d8 100644 >--- a/classes/base.bbclass >+++ b/classes/base.bbclass >@@ -61,10 +61,14 @@ def base_chk_file_vars(parser, localpath, params, data): > name = params["name"] > except KeyError: > return False >- flagName = "%s.md5sum" % name >- want_md5sum = bb.data.getVarFlag("SRC_URI", flagName, data) >- flagName = "%s.sha256sum" % name >- want_sha256sum = bb.data.getVarFlag("SRC_URI", flagName, data) >+ if name: >+ md5flag = "%s.md5sum" % name >+ sha256flag = "%s.sha256sum" % name >+ else: >+ md5flag = "md5sum" >+ sha256flag = "sha256sum" >+ want_md5sum = bb.data.getVarFlag("SRC_URI", md5flag, data) >+ want_sha256sum = bb.data.getVarFlag("SRC_URI", sha256flag, data) > > if (want_sha256sum == None and want_md5sum == None): > # no checksums to check, nothing to do >@@ -702,12 +706,18 @@ python base_do_fetch() { > pn = bb.data.getVar('PN', d, True) > > # Check each URI >+ first_uri = True > for url in src_uri.split(): > localpath = bb.data.expand(bb.fetch.localpath(url, localdata), localdata) > (type,host,path,_,_,params) = bb.decodeurl(url) > uri = "%s://%s%s" % (type,host,path) > try: > if type in [ "http", "https", "ftp", "ftps" ]: >+ # We provide a default shortcut of plain [] for the first fetch uri >+ # Explicit names in any uri overrides this default. >+ if not "name" in params and first_uri: >+ first_uri = False >+ params["name"] = "" > if not (base_chk_file_vars(parser, localpath, params, d) or base_chk_file(parser, pn, pv,uri, localpath, d)): > if not bb.data.getVar("OE_ALLOW_INSECURE_DOWNLOADS", d, True): > bb.fatal("%s-%s: %s has no checksum defined, cannot check archive integrity" % (pn,pv,uri)) >diff --git a/docs/usermanual/reference/var_src_uri.xml b/docs/usermanual/reference/var_src_uri.xml >index a35e1ee..7b51b56 100644 >--- a/docs/usermanual/reference/var_src_uri.xml >+++ b/docs/usermanual/reference/var_src_uri.xml >@@ -29,7 +29,12 @@ > be used in preference to retrieving a new version . Any source that is > retrieved from a remote URI will be stored in the download source directory > and an appropriate md5 sum generated and stored alongside it.</para> >- >+ <para>Checksums for http/https/ftp/ftps uris are stored in each recipe in >+ the form of<screen>SRC_URI[md5sum] = "9a7a11ffd52d9c4553ea8c0134a6fa86" >+SRC_URI[sha256sum] = "36bdb85c97b39ac604bc58cb7857ee08295242c78a12848ef8a31701921b9434"</screen> >+ for the first remote SRC_URI that has <emphasis>no</emphasis> explicit <command>name=foo</command> >+ associated with it. Following <emphasis>unnamed</emphasis> SRC_URIs without >+ a checksum will throw errors.</para> > <para>Each URI supports a set of additional options. These options are > tag/value pairs of the form <command>"a=b"</command> and are semi-colon > separated from each other and from the URI. The follow examples shows two ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] git: add SRC_URI name 2010-03-05 20:53 ` Bernhard Reutner-Fischer @ 2010-03-22 11:07 ` Roman Khimov 0 siblings, 0 replies; 12+ messages in thread From: Roman Khimov @ 2010-03-22 11:07 UTC (permalink / raw) To: openembedded-devel В сообщении от Пятница 05 марта 2010 23:53:57 автор Bernhard Reutner-Fischer написал: > On Wed, Feb 24, 2010 at 06:18:32PM +0100, Bernhard Reutner-Fischer wrote: > >On Mon, Feb 22, 2010 at 11:45:43PM +0100, Bernhard Reutner-Fischer wrote: > >>On Mon, Feb 22, 2010 at 05:06:21PM -0500, Denys Dmytriyenko wrote: > >>>> Not using "archive" as Martin likes as default, but uri%d, but > >>> > >>>For multiple SRC_URIs, using uri1/uri2 can be more confusing and may be > >>> not much better than looking up real names in .inc file... > >> > >>ok, so let's drop that superfluous .note and the url%d handling. > >>Other opinions? > > > >I'm using this now, fwiw. > > ping? Acked-by: Roman I Khimov <khimov@altell.ru> ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2010-03-22 11:11 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-02-21 15:32 [PATCH] git: add SRC_URI name Bernhard Reutner-Fischer 2010-02-22 16:24 ` Denys Dmytriyenko 2010-02-22 16:55 ` Phil Blundell 2010-02-22 17:06 ` Chris Larson 2010-02-22 18:17 ` Martin Jansa 2010-02-22 19:41 ` Bernhard Reutner-Fischer 2010-02-22 21:43 ` Bernhard Reutner-Fischer 2010-02-22 22:06 ` Denys Dmytriyenko 2010-02-22 22:45 ` Bernhard Reutner-Fischer 2010-02-24 17:18 ` Bernhard Reutner-Fischer 2010-03-05 20:53 ` Bernhard Reutner-Fischer 2010-03-22 11:07 ` Roman Khimov
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.