Bug 9156 - Adding a package that was a dependency doesn't always look right
Summary: Adding a package that was a dependency doesn't always look right
Status: VERIFIED FIXED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 2.1
Hardware: x86 Multiple
: Medium normal
Target Milestone: 2.1 M4
Assignee: Dave Lerner
QA Contact: Alexandru Roman
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-02-23 20:47 UTC by Dave Lerner
Modified: 2016-05-04 14:12 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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