Message ID | 20230719180811.3229999-1-JPEWhacker@gmail.com |
---|---|
State | Accepted |
Delegated to: | Stefano Babic |
Headers | show |
Series | [meta-swupdate] classes/swupdate-common.bbclass: Add SRC_URI exclusions | expand |
On 19.07.23 20:08, Joshua Watt wrote: > Adds a variable which can be used to exclude specific files in SRC_URI > from being placed in the CPIO archive. This can be useful if a recipe > has extra actions it takes based on SRC_URI files, but doesn't want to > have those files in the CPIO archive (e.g. expanding a sw-description > using Jinja2 templates). > > Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> > --- > classes-recipe/swupdate-common.bbclass | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/classes-recipe/swupdate-common.bbclass b/classes-recipe/swupdate-common.bbclass > index d7139a3..0ededad 100644 > --- a/classes-recipe/swupdate-common.bbclass > +++ b/classes-recipe/swupdate-common.bbclass > @@ -215,6 +215,7 @@ def swupdate_add_src_uri(d, list_for_cpio): > import shutil > > s = d.getVar('S', True) > + exclude = (d.getVar("SWUPDATE_SRC_URI_EXCLUDE") or "").split() > > fetch = bb.fetch2.Fetch([], d) > > @@ -222,6 +223,8 @@ def swupdate_add_src_uri(d, list_for_cpio): > for url in fetch.urls: > local = fetch.localpath(url) > filename = os.path.basename(local) > + if filename in exclude: > + continue > aes_file = d.getVar('SWUPDATE_AES_FILE', True) > if aes_file: > key,iv = swupdate_extract_keys(d.getVar('SWUPDATE_AES_FILE', True)) Applied to -master, -mickledore, thanks ! Best regards, Stefano Babic
On 19.07.23 20:08, Joshua Watt wrote: > Adds a variable which can be used to exclude specific files in SRC_URI > from being placed in the CPIO archive. This can be useful if a recipe > has extra actions it takes based on SRC_URI files, but doesn't want to > have those files in the CPIO archive (e.g. expanding a sw-description > using Jinja2 templates). > > Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> > --- > classes-recipe/swupdate-common.bbclass | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/classes-recipe/swupdate-common.bbclass b/classes-recipe/swupdate-common.bbclass > index d7139a3..0ededad 100644 > --- a/classes-recipe/swupdate-common.bbclass > +++ b/classes-recipe/swupdate-common.bbclass > @@ -215,6 +215,7 @@ def swupdate_add_src_uri(d, list_for_cpio): > import shutil > > s = d.getVar('S', True) > + exclude = (d.getVar("SWUPDATE_SRC_URI_EXCLUDE") or "").split() > > fetch = bb.fetch2.Fetch([], d) > > @@ -222,6 +223,8 @@ def swupdate_add_src_uri(d, list_for_cpio): > for url in fetch.urls: > local = fetch.localpath(url) > filename = os.path.basename(local) > + if filename in exclude: > + continue > aes_file = d.getVar('SWUPDATE_AES_FILE', True) > if aes_file: > key,iv = swupdate_extract_keys(d.getVar('SWUPDATE_AES_FILE', True)) Applied to -master, -micledore, thanks ! Best regards, Stefano Babic
Would you mind also backporting it to the LTS branches (kirkstone and dunfell)? Thanks On Thu, Jul 20, 2023 at 5:47 AM Stefano Babic <stefano.babic@swupdate.org> wrote: > > On 19.07.23 20:08, Joshua Watt wrote: > > Adds a variable which can be used to exclude specific files in SRC_URI > > from being placed in the CPIO archive. This can be useful if a recipe > > has extra actions it takes based on SRC_URI files, but doesn't want to > > have those files in the CPIO archive (e.g. expanding a sw-description > > using Jinja2 templates). > > > > Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> > > --- > > classes-recipe/swupdate-common.bbclass | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/classes-recipe/swupdate-common.bbclass b/classes-recipe/swupdate-common.bbclass > > index d7139a3..0ededad 100644 > > --- a/classes-recipe/swupdate-common.bbclass > > +++ b/classes-recipe/swupdate-common.bbclass > > @@ -215,6 +215,7 @@ def swupdate_add_src_uri(d, list_for_cpio): > > import shutil > > > > s = d.getVar('S', True) > > + exclude = (d.getVar("SWUPDATE_SRC_URI_EXCLUDE") or "").split() > > > > fetch = bb.fetch2.Fetch([], d) > > > > @@ -222,6 +223,8 @@ def swupdate_add_src_uri(d, list_for_cpio): > > for url in fetch.urls: > > local = fetch.localpath(url) > > filename = os.path.basename(local) > > + if filename in exclude: > > + continue > > aes_file = d.getVar('SWUPDATE_AES_FILE', True) > > if aes_file: > > key,iv = swupdate_extract_keys(d.getVar('SWUPDATE_AES_FILE', True)) > > > Applied to -master, -micledore, thanks ! > > Best regards, > Stefano Babic >
On 20.07.23 16:15, Joshua Watt wrote: > Would you mind also backporting it to the LTS branches (kirkstone and dunfell)? > Done - just check it. Best regards, Stefano Babic > Thanks > > On Thu, Jul 20, 2023 at 5:47 AM Stefano Babic > <stefano.babic@swupdate.org> wrote: >> >> On 19.07.23 20:08, Joshua Watt wrote: >>> Adds a variable which can be used to exclude specific files in SRC_URI >>> from being placed in the CPIO archive. This can be useful if a recipe >>> has extra actions it takes based on SRC_URI files, but doesn't want to >>> have those files in the CPIO archive (e.g. expanding a sw-description >>> using Jinja2 templates). >>> >>> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> >>> --- >>> classes-recipe/swupdate-common.bbclass | 3 +++ >>> 1 file changed, 3 insertions(+) >>> >>> diff --git a/classes-recipe/swupdate-common.bbclass b/classes-recipe/swupdate-common.bbclass >>> index d7139a3..0ededad 100644 >>> --- a/classes-recipe/swupdate-common.bbclass >>> +++ b/classes-recipe/swupdate-common.bbclass >>> @@ -215,6 +215,7 @@ def swupdate_add_src_uri(d, list_for_cpio): >>> import shutil >>> >>> s = d.getVar('S', True) >>> + exclude = (d.getVar("SWUPDATE_SRC_URI_EXCLUDE") or "").split() >>> >>> fetch = bb.fetch2.Fetch([], d) >>> >>> @@ -222,6 +223,8 @@ def swupdate_add_src_uri(d, list_for_cpio): >>> for url in fetch.urls: >>> local = fetch.localpath(url) >>> filename = os.path.basename(local) >>> + if filename in exclude: >>> + continue >>> aes_file = d.getVar('SWUPDATE_AES_FILE', True) >>> if aes_file: >>> key,iv = swupdate_extract_keys(d.getVar('SWUPDATE_AES_FILE', True)) >> >> >> Applied to -master, -micledore, thanks ! >> >> Best regards, >> Stefano Babic >>
Thanks! On Thu, Jul 20, 2023 at 8:26 AM Stefano Babic <stefano.babic@swupdate.org> wrote: > > On 20.07.23 16:15, Joshua Watt wrote: > > Would you mind also backporting it to the LTS branches (kirkstone and dunfell)? > > > > Done - just check it. > > Best regards, > Stefano Babic > > > Thanks > > > > On Thu, Jul 20, 2023 at 5:47 AM Stefano Babic > > <stefano.babic@swupdate.org> wrote: > >> > >> On 19.07.23 20:08, Joshua Watt wrote: > >>> Adds a variable which can be used to exclude specific files in SRC_URI > >>> from being placed in the CPIO archive. This can be useful if a recipe > >>> has extra actions it takes based on SRC_URI files, but doesn't want to > >>> have those files in the CPIO archive (e.g. expanding a sw-description > >>> using Jinja2 templates). > >>> > >>> Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> > >>> --- > >>> classes-recipe/swupdate-common.bbclass | 3 +++ > >>> 1 file changed, 3 insertions(+) > >>> > >>> diff --git a/classes-recipe/swupdate-common.bbclass b/classes-recipe/swupdate-common.bbclass > >>> index d7139a3..0ededad 100644 > >>> --- a/classes-recipe/swupdate-common.bbclass > >>> +++ b/classes-recipe/swupdate-common.bbclass > >>> @@ -215,6 +215,7 @@ def swupdate_add_src_uri(d, list_for_cpio): > >>> import shutil > >>> > >>> s = d.getVar('S', True) > >>> + exclude = (d.getVar("SWUPDATE_SRC_URI_EXCLUDE") or "").split() > >>> > >>> fetch = bb.fetch2.Fetch([], d) > >>> > >>> @@ -222,6 +223,8 @@ def swupdate_add_src_uri(d, list_for_cpio): > >>> for url in fetch.urls: > >>> local = fetch.localpath(url) > >>> filename = os.path.basename(local) > >>> + if filename in exclude: > >>> + continue > >>> aes_file = d.getVar('SWUPDATE_AES_FILE', True) > >>> if aes_file: > >>> key,iv = swupdate_extract_keys(d.getVar('SWUPDATE_AES_FILE', True)) > >> > >> > >> Applied to -master, -micledore, thanks ! > >> > >> Best regards, > >> Stefano Babic > >> >
diff --git a/classes-recipe/swupdate-common.bbclass b/classes-recipe/swupdate-common.bbclass index d7139a3..0ededad 100644 --- a/classes-recipe/swupdate-common.bbclass +++ b/classes-recipe/swupdate-common.bbclass @@ -215,6 +215,7 @@ def swupdate_add_src_uri(d, list_for_cpio): import shutil s = d.getVar('S', True) + exclude = (d.getVar("SWUPDATE_SRC_URI_EXCLUDE") or "").split() fetch = bb.fetch2.Fetch([], d) @@ -222,6 +223,8 @@ def swupdate_add_src_uri(d, list_for_cpio): for url in fetch.urls: local = fetch.localpath(url) filename = os.path.basename(local) + if filename in exclude: + continue aes_file = d.getVar('SWUPDATE_AES_FILE', True) if aes_file: key,iv = swupdate_extract_keys(d.getVar('SWUPDATE_AES_FILE', True))
Adds a variable which can be used to exclude specific files in SRC_URI from being placed in the CPIO archive. This can be useful if a recipe has extra actions it takes based on SRC_URI files, but doesn't want to have those files in the CPIO archive (e.g. expanding a sw-description using Jinja2 templates). Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> --- classes-recipe/swupdate-common.bbclass | 3 +++ 1 file changed, 3 insertions(+)