Bug 750488

Summary: [RFE] packages.removePackage() do not removes srpm package associated to rpm
Product: [Community] Spacewalk Reporter: Jan Hutař <jhutar>
Component: APIAssignee: Tomas Lestach <tlestach>
Status: CLOSED NOTABUG QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 1.6CC: cperry, jdobes, jpazdziora
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-09 12:23:12 UTC Type: ---
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: 737830    

Description Jan Hutař 2011-11-01 10:13:53 UTC
Description of problem:
API call packages.removePackage(key, packageid) removes rpm given by packageid, but do not remove associated src.rpm.


Version-Release number of selected component (if applicable):
spacewalk-java-1.6.68-1.el5
spacewalk-taskomatic-1.6.68-1.el5


How reproducible:
always


Steps to Reproduce:
1. # find /var/satellite/ -name somepackage-x86_64-16318-0.2-2\*
/var/satellite/redhat/1/b2e/somepackage-x86_64-16318/0.2-2/x86_64/b2ede22c9887f7235e996c2ed7cadf16/somepackage-x86_64-16318-0.2-2.x86_64.rpm
/var/satellite/redhat/1/fc2/somepackage-x86_64-16318/0.2-2/SRPMS/fc23e66aa3e2441fc2bb8b6ab19353c1/somepackage-x86_64-16318-0.2-2.src.rpm
2. # python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00) 
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmlrpclib
>>> client = xmlrpclib.Server('https://ibm-x3650-02.ovirt.rhts.eng.bos.redhat.com/rpc/api')
>>> key = client.auth.login('admin', 'nimda')
>>> client.channel.software.removePackages(key, 'test-x86_64-0', [1599])
1
>>> client.packages.removePackage(key, 1599)
1
>>> client.auth.logout(key)
1
3. # find /var/satellite/ -name somepackage-x86_64-16318-0.2-2\*
/var/satellite/redhat/1/fc2/somepackage-x86_64-16318/0.2-2/SRPMS/fc23e66aa3e2441fc2bb8b6ab19353c1/somepackage-x86_64-16318-0.2-2.src.rpm


Actual results:
src.rpm not deleted


Expected results:
src.rpm deleted together with rpm

Comment 1 Tomas Lestach 2011-11-01 12:36:17 UTC
Where did you find the information a src.rpm shall be deleted together with a rpm package?

From API documentation:
Method: removePackage

Description:
Remove a package from the satellite.

Comment 2 Jan Hutař 2011-11-01 13:37:28 UTC
Hmm, if not, we do not have way how to delete src.rpm, or do we?

It looks like src.rpms are deleted from DB, but not from disk storage (/var/satellite).

Comment 3 Jan Pazdziora 2011-12-09 14:48:20 UTC
The problem is that there can be multiple arch/noarch packages for single srpm. So it's not like we always want to delete, more like delete when we delete the last one. Marking as RFE.

Comment 4 Jan Dobes 2016-05-09 12:23:12 UTC
Possibility to delete source RPMs was implemented in bz1192879. There are new API calls for deleting SRPMs, not removing within this API call method because it would require checking if the package is last one who uses this SRPM and even then - it's questionable if the SRPM should be deleted together with RPM. As we provided different way how to delete SRPMs, closing this as NOTABUG.