Skip to content
Snippets Groups Projects
Commit 38b73717 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[mirror] Do not remove remove/revoke sessions from patch (good to keep)

parent 3a065d15
No related branches found
No related tags found
No related merge requests found
Pipeline #34666 passed
...@@ -319,17 +319,3 @@ def copy_and_clean_json(url, dest_dir, arch, name): ...@@ -319,17 +319,3 @@ def copy_and_clean_json(url, dest_dir, arch, name):
packages = get_local_contents(dest_dir, arch) packages = get_local_contents(dest_dir, arch)
data = _cleanup_json(data, packages) data = _cleanup_json(data, packages)
return _save_json(data, dest_dir, arch, name) return _save_json(data, dest_dir, arch, name)
def copy_and_clean_patch(url, dest_dir, arch, name):
"""Copies and cleans conda JSON file"""
data = get_json(url, arch, name)
packages = get_local_contents(dest_dir, arch)
data = _cleanup_json(data, packages)
# cleanup specific patch_instructions.json fields
for key in ["remove", "revoke"]:
data[key] = [k for k in data[key] if k in packages]
return _save_json(data, dest_dir, arch, name)
...@@ -17,7 +17,7 @@ from ..mirror import ( ...@@ -17,7 +17,7 @@ from ..mirror import (
whitelist_filter, whitelist_filter,
download_packages, download_packages,
remove_packages, remove_packages,
copy_and_clean_patch, copy_and_clean_json,
) )
from ..log import verbosity_option, get_logger, echo_info, echo_warning from ..log import verbosity_option, get_logger, echo_info, echo_warning
...@@ -187,8 +187,7 @@ def mirror( ...@@ -187,8 +187,7 @@ def mirror(
# go crazy. Do this before the indexing, that will use that file # go crazy. Do this before the indexing, that will use that file
# to do its magic. # to do its magic.
patch_file = 'patch_instructions.json' patch_file = 'patch_instructions.json'
name = copy_and_clean_patch(channel_url, dest_dir, arch, name = copy_and_clean_json(channel_url, dest_dir, arch, patch_file)
patch_file)
echo_info("Cleaned copy of %s/%s/%s installed at %s" % echo_info("Cleaned copy of %s/%s/%s installed at %s" %
(channel_url, arch, patch_file, name)) (channel_url, arch, patch_file, name))
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
bob.devtools.changelog bob.devtools.changelog
bob.devtools.bootstrap bob.devtools.bootstrap
bob.devtools.build bob.devtools.build
bob.devtools.mirror
bob.devtools.webdav3.client bob.devtools.webdav3.client
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment