/[packages]/updates/6/rust-packaging/current/SOURCES/0001-Replace-f-strings-by-old-format-for-Python-3.5-compa.patch
ViewVC logotype

Contents of /updates/6/rust-packaging/current/SOURCES/0001-Replace-f-strings-by-old-format-for-Python-3.5-compa.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1258325 - (show annotations) (download)
Tue Sep 11 08:37:02 2018 UTC (6 years, 2 months ago) by akien
File size: 3087 byte(s)
Version 6
1 From 208244ce1b01c1e2639be3386e2cdfd7c476fc18 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= <rverschelde@gmail.com>
3 Date: Tue, 11 Sep 2018 10:18:56 +0200
4 Subject: [PATCH] Replace f-strings by old format for Python 3.5 compat
5
6 ---
7 rust2rpm/__main__.py | 6 +++---
8 rust2rpm/licensing.py | 8 ++++----
9 rust2rpm/metadata.py | 2 +-
10 3 files changed, 8 insertions(+), 8 deletions(-)
11
12 diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
13 index e993e7b..e44a9a4 100644
14 --- a/rust2rpm/__main__.py
15 +++ b/rust2rpm/__main__.py
16 @@ -180,7 +180,7 @@ def make_diff_metadata(crate, version, patch=False, store=False):
17 diff = make_patch(toml, enabled=patch)
18 metadata = Metadata.from_file(toml)
19 if store:
20 - shutil.copy2(cratef, os.path.join(os.getcwd(), f"{crate}-{version}.crate"))
21 + shutil.copy2(cratef, os.path.join(os.getcwd(), "{}-{}.crate".format(crate, version)))
22 return crate, diff, metadata
23
24 def main():
25 diff --git a/rust2rpm/licensing.py b/rust2rpm/licensing.py
26 index 964603e..c2855f6 100644
27 --- a/rust2rpm/licensing.py
28 +++ b/rust2rpm/licensing.py
29 @@ -23,7 +23,7 @@ def spdx_to_fedora_map():
30
31 def dump_sdpx_to_fedora_map(file):
32 for k,v in spdx_to_fedora_map().items():
33 - print(f"{k} → {v}", file=file)
34 + print("{} → {}".format(k, v), file=file)
35
36 def translate_license_fedora(license):
37 comments = ''
38 @@ -37,16 +37,16 @@ def translate_license_fedora(license):
39 else:
40 mapped = spdx_to_fedora_map().get(tag, None)
41 if mapped is None:
42 - comments += f'# FIXME: Upstream uses unknown SPDX tag {tag}!'
43 + comments += '# FIXME: Upstream uses unknown SPDX tag {}!'.format(tag)
44 final.append(tag)
45 elif mapped is '':
46 - comments += f"# FIXME: Upstream SPDX tag {tag} not listed in Fedora's good licenses list.\n"
47 + comments += "# FIXME: Upstream SPDX tag {} not listed in Fedora's good licenses list.\n".format(tag)
48 comments += "# FIXME: This package might not be allowed in Fedora!\n"
49 final.append(tag)
50 else:
51 final.append(mapped)
52 if mapped != tag:
53 - print(f'Upstream license tag {tag} translated to {mapped}',
54 + print('Upstream license tag {} translated to {}'.format(tag, mapped),
55 file=_sys.stderr)
56 return (' '.join(final), comments or None)
57
58 diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py
59 index f52d968..2926e33 100644
60 --- a/rust2rpm/metadata.py
61 +++ b/rust2rpm/metadata.py
62 @@ -193,7 +193,7 @@ class Metadata(object):
63 else:
64 cond = ev.parse_and_eval(target)
65 if not cond:
66 - print(f'Dependency {dep["name"]} for target {target!r} is not needed, ignoring.',
67 + print('Dependency {} for target {!r} is not needed, ignoring.'.format(dep["name"], target),
68 file=sys.stderr)
69 continue
70
71 --
72 2.13.7
73

  ViewVC Help
Powered by ViewVC 1.1.30