Bug 1581621

Summary: [modularity] Removing a profile should not remove packages needed by other profiles
Product: [Fedora] Fedora Reporter: Rafael Fonseca <rdossant>
Component: dnfAssignee: rpm-software-management
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 29CC: dmach, jmracek, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.0.4 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1581624 (view as bug list) Environment:
Last Closed: 2018-11-22 18:13:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1478068, 1581624    

Description Rafael Fonseca 2018-05-23 09:00:09 UTC
Description of problem: if two profiles of a module contain the same package, removing one of the profiles should not remove the common package.


Version-Release number of selected component (if applicable): 2.7.5-13


How reproducible: always


Steps to Reproduce:
1. 
      ---     
      document: modulemd
      version: 2
      data:                                                                                                            
        name: ModuleA
        stream: f26                                                                                                    
        version: 2
        summary: Module ModuleA summary                                                                                
        description: Module ModuleA description
        license:
          module: [MIT]   
        artifacts:
          rpms: ["TestA-0:1-2.modA.noarch", "TestB-0:1-1.modA.noarch", "TestC-0:1-2.modA.noarch", "TestD-0:1-1.modA.noarch"]      
        components:
          rpms: 
            TestA: {rationale: 'rationale for TestA'}                                                                  
            TestB: {rationale: 'rationale for TestB'}                                                                  
            TestC: {rationale: 'rationale for TestC'}                                                                  
            TestD: {rationale: 'rationale for TestD'}
        profiles: 
          default:
            rpms: [TestA, TestB, TestC]                                                                                
          minimal:
            rpms: [TestA]
          client: 
            rpms: [TestA, TestB]
          server: 
            rpms: [TestA, TestC]
          devel:
            rpms: [TestD]  
      ---       
2. dnf module enable ModuleA:f26
3. dnf module install ModuleA/minimal ModuleA/client
4. dnf module remove ModuleA/minimal

Actual results: 
Last metadata expiration check: 0:00:04 ago on Wed May 23 08:54:10 2018.
      Dependencies resolved.
      ================================================================================
       Package       Arch           Version             Repository               Size
      ================================================================================
      Removing:
       TestA         noarch         1-2.modA            @modularityABDE           0  
      
      Transaction Summary
      ================================================================================
      Remove  1 Package
      
      Freed space: 0  
      Running transaction check
      Transaction check succeeded.
      Running transaction test
      Transaction test succeeded.
      Running transaction
        Preparing        :                                                        1/1 
        Erasing          : TestA-1-2.modA.noarch                                  1/1 
        Verifying        : TestA-1-2.modA.noarch                                  1/1 
      
      Removed:
        TestA.noarch 1-2.modA                                                         


Expected results: package is not removed since it's needed by ModuleA/client


Additional info:

Comment 2 Jan Kurik 2018-08-14 11:14:00 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.