The existing implementation of rhn-delete-package takes as an argument a binary rpm name, and an optional flag saying if you should delete the source rpm for that rpm. This means that you can't delete a SRPM if you deleted the RPM first.
*** Bug 362681 has been marked as a duplicate of this bug. ***
Test plan: Use the webui to find a package that has an associated source rpm. use rhn-delete-package-internal to delete the rpm: rhn-delete-package --orgid="" --package=foo-1.2.3.noarch now delete the source rpm (no longer has a matching rpm): rhn-delete-package --orgid="" --package=foo-1.2.3.src.rpm --sources --commit verify that the entry is removed from the database using a sql client: select org_id from rhnPackageSource ps, rhnSourceRpm sr where ps.source_rpm_id = sr.id and sr.name='foo-1.2.3.src.rpm The result should be a non NULL value (the recycled org id)