Bug 9156

Summary: Adding a package that was a dependency doesn't always look right
Product: [Build System, Metadata & Runtime] Toaster Reporter: Dave Lerner <dave.lerner>
Component: toasterAssignee: Dave Lerner <dave.lerner>
Status: VERIFIED FIXED QA Contact: Alexandru Roman <alexandru.costinx.roman>
Severity: normal    
Priority: Medium CC: alexandru.costinx.roman, belen.barros.pena, jessica.zhang, stanciux.mihail
Version: 2.1   
Target Milestone: 2.1 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Dave Lerner 2016-02-23 20:47:15 UTC
When customising an image, if you 
1) add a package A that is dependent on other packages (B,C) that are not already in the custom image,
2) then remove package A and remove dependency list packages, B,C...
3) then add the package A back to the customised image and again indirectly add all of the manually removed packages B,C...
then the button labels on packages B,C that were indirectly are incorrect, showing "Add Package" as before step 1, and not "Remove Package" as after step 1.

To reproduce this problem, following the steps in 9101
1. Create a toaster project with release master

2. Build core-image-sato

3. Go to the 'new custom image' page, search for core-image-minimal and click the 'customise' button. 

4. Give your custom image a name and build it

5. Once the build completes, go to the project configuration page, and select the 'custom images' link on the left navigation

6. Click on your custom image 

7. Search for the atk package and click its 'add package' button. You will see a list of dependencies, glib-2.0 libffi and libpcre, the packages not already in core-image-minimal.

8. Add atk, note that the banner (after defect 9101 is accepted) says 4 packages added.  

9. Note that atk's button changes from Add Package to Remove Package.  View each of the 3 packages added from the dependency list, glib-.0 libffi and libpcre and note that their buttons say Remove Package.

10. Go back to atk and click and remove that package.  Do the same for glib-2.0 then libffi and libpcre.  Note that the button labels after each operation revert to Add Package.

11. Go back to atk and click Add Package and note that as in step 9, the button reverts to Remove Package, but (the bug) that unlike in step 9, the other 3 packages sill show Add Package and not Remove Package.

The logic in views.py @2630 to remove packages from the excludes_set needs to be added to the logic for dependency list packages @ 2647.
Comment 1 Alexandru Roman 2016-05-04 14:12:25 UTC
Verifide on master: f7b520878babbaa7527151f22c031ae160512753