From ac0e27af6a172e2af8e5c9be22dd24e153e16396 Mon Sep 17 00:00:00 2001
From: Andrej Shadura <andrew.shadura@collabora.co.uk>
Date: Fri, 13 May 2022 15:56:29 +0200
Subject: [PATCH] Only mark existent remote files as superseded

Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
---
 osc_plugin_dput/main.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/osc_plugin_dput/main.py b/osc_plugin_dput/main.py
index 40bf8fb..29e107a 100644
--- a/osc_plugin_dput/main.py
+++ b/osc_plugin_dput/main.py
@@ -205,7 +205,8 @@ def do_dput(self, subcmd, opts, *args):
                 remote_dsc = Dsc(osc.core.streamfile(u, bufsize='line'))
 
                 for entry in remote_dsc.get('Files'):
-                    superseded.add(entry['name'])
+                    if entry['name'] in remote_file_list:
+                        superseded.add(entry['name'])
 
                 superseded.add(f)
             elif f.endswith('.changes'):
-- 
GitLab