diff options
author | Chih-Hsuan Yen | 2023-09-02 11:31:07 +0800 |
---|---|---|
committer | Chih-Hsuan Yen | 2023-09-02 11:31:07 +0800 |
commit | b232c9ab251d4c23436a3e678017a9e08fc129dc (patch) | |
tree | 6a5381cbf232168b37783d1d0d9062eb159992ff | |
parent | f05463d2cb5ea91b9f487ae50d2d7d6169853f75 (diff) | |
download | aur-b232c9ab251d4c23436a3e678017a9e08fc129dc.tar.gz |
upgpkg: 2.13.15-1; support the latest python-ruamel-yaml
-rw-r--r-- | PKGBUILD | 15 | ||||
-rw-r--r-- | ruamel-yaml-0.17.32.patch | 77 |
2 files changed, 85 insertions, 7 deletions
@@ -4,7 +4,7 @@ pkgname=aws-cli-v2 # https://github.com/aws/aws-cli/raw/v2/CHANGELOG.rst -pkgver=2.13.13 +pkgver=2.13.15 pkgrel=1 pkgdesc='Unified command line interface for Amazon Web Services (version 2)' arch=(any) @@ -23,14 +23,14 @@ source=("https://awscli.amazonaws.com/awscli-$pkgver.tar.gz"{,.sig} fix-env.diff "$pkgname-tz-fix.patch::https://github.com/aws/aws-cli/commit/95aa5ccc7bfaeafc0373e8472c8459030ac18920.patch" "${pkgname}-fix-zsh-completions.patch::https://github.com/aws/aws-cli/commit/006957ebf258e39fd1692151166a1d245e06a32f.patch" - "${pkgname}-ruamel-yaml-0.17.22.patch::https://github.com/aws/aws-cli/commit/96c855c44a6bd05e52cf98fa3c8e00db637f0a7b.patch") -sha256sums=('d49d54dbff13baa476f4c5525a73831823a75296ee5a8cc34f522fb77ae4500a' + ruamel-yaml-0.17.32.patch) +sha256sums=('ac63e8f42c7f8775edccdc004921420159420de9185cf011952dba8fda5895ff' 'SKIP' '0267e41561ab2c46a97ebfb024f0b047aabc9e6b9866f204b2c1a84ee5810d63' '893d61d7e958c3c02bfa1e03bf58f6f6abd98849d248cc661f1c56423df9f312' '4fc614b8550d7363bb2d578c6b49326c9255203eb2f933fd0551f96ed5fb1f30' '0e4064c45e8f987fd8aaa48e1b289de413d96168fc14432c2072a03068358742' - '12f9aacb46e5754ea3935b29e07033285cdf66047fc39520d9f716b33edb5a7e') + '0f37f599a75ef6010b657e49badaf05b26228c4cf555b77a8b86e1167a8e130a') validpgpkeys=( 'FB5DB77FD5C118B80511ADA8A6310ACC4672475C' # the key mentioned on https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html ) @@ -54,9 +54,10 @@ prepare() { # From https://github.com/aws/aws-cli/pull/2708 (unmerged) patch -Np1 -i ../${pkgname}-fix-zsh-completions.patch - # Fix tests with ruamel.yaml >= 0.17.22 - # https://github.com/aws/aws-cli/pull/8072 (unmerged) - patch -Np1 -i ../${pkgname}-ruamel-yaml-0.17.22.patch + # Fix compatibility with ruamel.yaml >= 0.17.30 + # The patch is from Fedora https://src.fedoraproject.org/rpms/awscli2/blob/rawhide/f/ruamel-yaml-0.17.32.patch + # TODO: investigate and submit it to upstream, probably along with earlier ruamel.yaml fixes in https://github.com/aws/aws-cli/pull/8072 + patch -Np1 -i ../ruamel-yaml-0.17.32.patch } build() { diff --git a/ruamel-yaml-0.17.32.patch b/ruamel-yaml-0.17.32.patch new file mode 100644 index 000000000000..eee82b99922f --- /dev/null +++ b/ruamel-yaml-0.17.32.patch @@ -0,0 +1,77 @@ +diff --git a/awscli/customizations/cloudformation/yamlhelper.py b/awscli/customizations/cloudformation/yamlhelper.py +index abdc749..ef32415 100644 +--- a/awscli/customizations/cloudformation/yamlhelper.py ++++ b/awscli/customizations/cloudformation/yamlhelper.py +@@ -92,6 +92,7 @@ def yaml_dump(dict_to_dump): + yaml.Representer = FlattenAliasRepresenter + _add_yaml_1_1_boolean_resolvers(yaml.Resolver) + yaml.Representer.add_representer(OrderedDict, _dict_representer) ++ yaml.Representer.add_representer(dict, _dict_representer) + + return dump_yaml_to_str(yaml, dict_to_dump) + +diff --git a/awscli/customizations/eks/kubeconfig.py b/awscli/customizations/eks/kubeconfig.py +index 5130f7f..64526a7 100644 +--- a/awscli/customizations/eks/kubeconfig.py ++++ b/awscli/customizations/eks/kubeconfig.py +@@ -44,7 +44,7 @@ def _get_new_kubeconfig_content(): + ("contexts", []), + ("current-context", ""), + ("kind", "Config"), +- ("preferences", OrderedDict()), ++ ("preferences", {}), + ("users", []) + ]) + +@@ -121,7 +121,7 @@ class KubeconfigValidator(object): + if (key in config.content and + type(config.content[key]) == list): + for element in config.content[key]: +- if not isinstance(element, OrderedDict): ++ if not isinstance(element, dict): + raise KubeconfigCorruptedError( + f"Entry in {key} not a {dict}. ") + +diff --git a/awscli/customizations/eks/ordered_yaml.py b/awscli/customizations/eks/ordered_yaml.py +index 23834e0..1ea6341 100644 +--- a/awscli/customizations/eks/ordered_yaml.py ++++ b/awscli/customizations/eks/ordered_yaml.py +@@ -46,8 +46,10 @@ def ordered_yaml_dump(to_dump, stream=None): + :type stream: file + """ + yaml = ruamel.yaml.YAML(typ="safe", pure=True) ++ yaml.width = 99999 + yaml.default_flow_style = False + yaml.Representer.add_representer(OrderedDict, _ordered_representer) ++ yaml.Representer.add_representer(dict, _ordered_representer) + + if stream is None: + return dump_yaml_to_str(yaml, to_dump) +diff --git a/tests/unit/customizations/cloudformation/test_yamlhelper.py b/tests/unit/customizations/cloudformation/test_yamlhelper.py +index 9f511b0..29a93a5 100644 +--- a/tests/unit/customizations/cloudformation/test_yamlhelper.py ++++ b/tests/unit/customizations/cloudformation/test_yamlhelper.py +@@ -139,10 +139,10 @@ class TestYaml(BaseYAMLTest): + ' Name: name1\n' + ) + output_dict = yaml_parse(input_template) +- expected_dict = OrderedDict([ +- ('B_Resource', OrderedDict([('Key2', {'Name': 'name2'}), ('Key1', {'Name': 'name1'})])), +- ('A_Resource', OrderedDict([('Key2', {'Name': 'name2'}), ('Key1', {'Name': 'name1'})])) +- ]) ++ expected_dict = { ++ 'B_Resource': {'Key2': {'Name': 'name2'}, 'Key1': {'Name': 'name1'}}, ++ 'A_Resource': {'Key2': {'Name': 'name2'}, 'Key1': {'Name': 'name1'}} ++ } + self.assertEqual(expected_dict, output_dict) + + output_template = yaml_dump(output_dict) +@@ -156,7 +156,7 @@ class TestYaml(BaseYAMLTest): + <<: *base + """ + output = yaml_parse(test_yaml) +- self.assertTrue(isinstance(output, OrderedDict)) ++ self.assertTrue(isinstance(output, dict)) + self.assertEqual(output.get('test').get('property'), 'value') + + def test_unroll_yaml_anchors(self): |