Skip to contentSkip to conversation

fixup dependency excludes_set for custom image

review-request Superseded Dave Lerner 3 participants 4 messages Feb 29, 2016 – Mar 3, 2016

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

Branch: master
Defect: 9156
Summary: toaster: fixup dependency excludes for customimage

commit b234dae9f3023af71814d9bb8f7052013b9400e8

Author: Dave Lerner <[email protected]>
Date:   Mon Feb 29 14:58:35 2016 -0600

toaster: fixup dependency excludes for customimage

[YOCTO #9156]

For a customized image when adding a dependent package X that depends on dependency package Y, in addition to adding X to appends_set and Y to includes_set, make sure that Y is no longer in the excludes_set. Y may have been added to the excludes_set by a prior package removal.

Test setup
----------
Build core-image-sato.
Create a new project 'myproject' on master.
Create a custom image 'myimage' based on core-image-minimal. Build core-image-minimal.
Customize myimage.

Test steps and expected results
-------------------------------
Search for atk, add the package accept the additional packages. for each of the following verify that buttons switch to Remove Package:
glib-2.0, libpcre, libffi, bash
Search for atk, click the remove package button.
for each of the following verify that buttons switch to Add Package:
glib-2.0, libpcre, libffi, bash

Exit browser then re-enter browser
Pick All-Projects, pick 'myproject', click on Custom image, then select 'myimage'. Search again for 'atk' and add the package.
for each of the following verify that buttons switch to Remove Package:
glib-2.0, libpcre, libffi, bash

#1 lore raw

PATCH 1/1 toaster: fixup dependency excludes for customimage

[YOCTO #9156]

For a customized image when adding a dependent package X that depends on dependency package Y, in addition to adding X to appends_set and Y to includes_set, make sure that Y is no longer in the excludes_set. Y may have been added to the excludes_set by a prior package removal.

---
 bitbake/lib/toaster/toastergui/views.py | 7 +++++++
 1 file changed, 7 insertions(+)
bitbake/lib/toaster/toastergui/views.py +7 -0
index 28b03d3..4670139 100755
@@ -2653,6 +2653,13 @@ if True:
                                            name=dep.depends_on.name)
 
                         recipe.includes_set.add(cust_package)
+                        try:
+                            # when adding the pre-requisite package make sure it's not in the
+                            #   excluded list from a prior removal.
+                            recipe.excludes_set.remove(cust_package)
+                        except Package.DoesNotExist:
+                            #   Don't care if the package had never been excluded
+                            return {"error": "ok"}
                     except:
                         logger.warning("Could not add package's suggested"
                                        "dependencies to the list")
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH 1/1] toaster: fixup dependency excludes for customimage

Thanks for the patch. Just a small fix needed here.

Quoted 17 lines · Dave Lerner

[YOCTO #9156]

For a customized image when adding a dependent package X that depends on dependency package Y, in addition to adding X to appends_set and Y to includes_set, make sure that Y is no longer in the excludes_set. Y may have been added to the excludes_set by a prior package removal.

---
  bitbake/lib/toaster/toastergui/views.py | 7 +++++++
  1 file changed, 7 insertions(+)
bitbake/lib/toaster/toastergui/views.py +0 -0
index 28b03d3..4670139 100755

bitbake/lib/toaster/toastergui/views.py if True: · line 2662

Quoted 10 lines
bitbake/lib/toaster/toastergui/views.py +7 -0
@@ -2653,6 +2653,13 @@ if True:
                                             name=dep.depends_on.name)
 
                          recipe.includes_set.add(cust_package)
+                        try:
+                            # when adding the pre-requisite package make sure it's not in the
+                            #   excluded list from a prior removal.
+                            recipe.excludes_set.remove(cust_package)
+                        except Package.DoesNotExist:
+                            #   Don't care if the package had never been excluded
+                            return {"error": "ok"}

We don't want to /return/ as we would end up exiting the loop on the first package that causes the DoesNotExist exception a /pass/ would be fine here.

Quoted 3 lines
bitbake/lib/toaster/toastergui/views.py +0 -0
                      except:
                          logger.warning("Could not add package's suggested"
                                         "dependencies to the list")
#3 lore raw
In reply to Dave Lerner
Quoted 30 lines · On 29/02/2016 21:26, "[email protected] on behalf of Dave…

Branch: master
Defect: 9156
Summary: toaster: fixup dependency excludes for customimage

commit b234dae9f3023af71814d9bb8f7052013b9400e8

Author: Dave Lerner <[email protected]>
Date:   Mon Feb 29 14:58:35 2016 -0600

toaster: fixup dependency excludes for customimage

[YOCTO #9156]

For a customized image when adding a dependent package X that depends
on
dependency package Y, in addition to adding X to appends_set and Y to includes_set, make sure that Y is no longer in the excludes_set. Y may have been added to the excludes_set by a prior package removal.

Test setup
----------
Build core-image-sato.
Create a new project 'myproject' on master.
Create a custom image 'myimage' based on core-image-minimal. Build core-image-minimal.
Customize myimage.

Quoted 8 lines

Test steps and expected results
-------------------------------
Search for atk, add the package accept the additional packages. for each of the following verify that buttons switch to Remove Package:
glib-2.0, libpcre, libffi, bash
Search for atk, click the remove package button.
for each of the following verify that buttons switch to Add Package:
glib-2.0, libpcre, libffi, bash

After this step, the buttons are still showing as 'remove package', which is the expected behaviour at the moment and until
https://bugzilla.yoctoproject.org/show_bug.cgi?id=9121 is fixed.

Apart from that, this seems to be working properly for me.

Thanks!

Belén

Quoted 13 lines

Exit browser then re-enter browser
Pick All-Projects, pick 'myproject', click on Custom image, then select 'myimage'.
Search again for 'atk' and add the package.
for each of the following verify that buttons switch to Remove Package:
glib-2.0, libpcre, libffi, bash

Signature · 4 lines
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster