From 950054d5fbcf2593ea8c8c0967fbada6f1753728 Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Tue, 23 Jan 2024 14:32:58 +0100 Subject: [PATCH] Don't abort if weakremover.inc don't exist on source project For ALP, weakremover.inc might not be part of the staging parent project. Just ignore 404 error in that case. --- osclib/freeze_command.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osclib/freeze_command.py b/osclib/freeze_command.py index cf734f642..bb784b57b 100644 --- a/osclib/freeze_command.py +++ b/osclib/freeze_command.py @@ -243,13 +243,13 @@ def copy_weakremovers(self): targeturl = self.api.makeurl(['source', self.prj, '000release-packages', 'weakremovers.inc'], {'comment': 'Update weakremovers.inc'}) oldinc = osc.core.http_GET(targeturl).read() + sourceurl = self.api.makeurl(['source', self.api.project, '000release-packages', 'weakremovers.inc']) + inc = osc.core.http_GET(sourceurl).read() + if inc != oldinc: + osc.core.http_PUT(targeturl, data=inc) except HTTPError: # if it doesn't exist, don't update return - sourceurl = self.api.makeurl(['source', self.api.project, '000release-packages', 'weakremovers.inc']) - inc = osc.core.http_GET(sourceurl).read() - if inc != oldinc: - osc.core.http_PUT(targeturl, data=inc) def is_bootstrap(self): """Check if there is a bootstrap copy repository."""