1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 22:56:15 +01:00

Merge pull request #1265 from andreas-schwab/master

Pass --force down to delete_package
This commit is contained in:
Daniel Mach 2023-03-09 13:14:12 +01:00 committed by GitHub
commit 8df8ee63aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1061,7 +1061,7 @@ class Project:
if state == 'A':
self.commitNewPackage(pac, msg, todo, verbose=verbose, skip_local_service_run=skip_local_service_run)
elif state == 'D':
self.commitDelPackage(pac)
self.commitDelPackage(pac, force=force)
elif state == ' ':
# display the correct dir when sending the changes
if os_path_samefile(os.path.join(self.dir, pac), os.getcwd()):
@ -1091,7 +1091,7 @@ class Project:
# do a simple commit
Package(os.path.join(self.dir, pac)).commit(msg, verbose=verbose, skip_local_service_run=skip_local_service_run)
elif state == 'D':
self.commitDelPackage(pac)
self.commitDelPackage(pac, force=force)
elif state == 'A':
self.commitNewPackage(pac, msg, verbose=verbose, skip_local_service_run=skip_local_service_run)
finally:
@ -1123,7 +1123,7 @@ class Project:
self.set_state(pac, ' ')
os.chdir(olddir)
def commitDelPackage(self, pac):
def commitDelPackage(self, pac, force=False):
"""deletes a package on the server and in the working copy"""
try:
# display the correct dir when sending the changes
@ -1144,7 +1144,7 @@ class Project:
pass
# print statfrmt('Deleting', getTransActPath(os.path.join(self.dir, pac)))
print(statfrmt('Deleting', getTransActPath(pac_dir)))
delete_package(self.apiurl, self.name, pac)
delete_package(self.apiurl, self.name, pac, force=force)
self.del_package_node(pac)
def commitExtPackage(self, pac, msg, files=None, verbose=False, skip_local_service_run=False):