Unverified Commit ac2b7710 authored by Andrej Shadura's avatar Andrej Shadura
Browse files

Drop the no longer needed code to update retained files

We no longer retain non-source files, so it’s not necessary to inform
the user about them or attempt to update them to the latest version.

Signed-off-by: Andrej Shadura's avatarAndrej Shadura <andrew.shadura@collabora.co.uk>
parent 958ab3d8
Pipeline #39795 passed with stages
in 14 minutes and 39 seconds
......@@ -5,7 +5,7 @@ from __future__ import print_function
import os
from pathlib import Path
from tempfile import TemporaryDirectory
from urllib.request import pathname2url, HTTPError
from urllib.request import pathname2url
import osc.conf as conf
import osc.core
......@@ -218,31 +218,6 @@ def do_dput(self, subcmd, opts, *args):
# we still want to overwrite
retained -= set(local_file_list)
# The temporary checkout we're using doesn't seem to have the
# expected result for latest_rev()?
source_rev = osc.core.get_source_rev(conf.config['apiurl'],
proj_name, package_name)
if 'rev' in source_rev:
latest_revision = source_rev['rev']
for f in retained:
print('retaining non-source file: %r' % f)
if not os.path.exists(f):
print('fetching %r from server' % f)
package.updatefile(f, latest_revision)
except HTTPError as e:
# _link sometimes appears in remote_file_list but can't
# be downloaded
if f == '_link' and e.code == 404:
print('Ignoring 404 error for _link')
# reset the file list, so that we can add files freely without
# osc barking at us each time we re-add an existing file
package.filenamelist = []
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment