1 |
commit: 118df436abd49eecfeaf95df8a052861d463a896 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Dec 30 10:57:12 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 31 13:33:04 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=118df436 |
7 |
|
8 |
Report a warning when unaccelerated Whirlpool is being used |
9 |
|
10 |
The warning serves two purposes: it informs the user that they should |
11 |
expect very slow hashing (i.e. Portage did not hang) and that they |
12 |
should inform the repository owner about the problem. Far from ideal |
13 |
but probably good enough given how rare Whirlpool-only ebuilds are. |
14 |
|
15 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
16 |
Closes: https://github.com/gentoo/portage/pull/967 |
17 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
18 |
|
19 |
lib/portage/util/whirlpool.py | 11 +++++++++++ |
20 |
1 file changed, 11 insertions(+) |
21 |
|
22 |
diff --git a/lib/portage/util/whirlpool.py b/lib/portage/util/whirlpool.py |
23 |
index 8454a874a..d26780604 100644 |
24 |
--- a/lib/portage/util/whirlpool.py |
25 |
+++ b/lib/portage/util/whirlpool.py |
26 |
@@ -30,6 +30,10 @@ |
27 |
|
28 |
# pylint: disable=mixed-indentation |
29 |
|
30 |
+import warnings |
31 |
+ |
32 |
+from portage.localization import _ |
33 |
+ |
34 |
try: |
35 |
from ._whirlpool import Whirlpool as WhirlpoolExt |
36 |
except ImportError: |
37 |
@@ -47,6 +51,13 @@ class PyWhirlpool: |
38 |
hashed.""" |
39 |
|
40 |
def __init__(self, arg=b""): |
41 |
+ warnings.warn( |
42 |
+ _( |
43 |
+ "The last-resort unaccelerated Whirlpool implementation is " |
44 |
+ "being used. It is known to be absurdly slow. Please report " |
45 |
+ "that the Whirlpool hash is deprecated to the repository owner." |
46 |
+ ) |
47 |
+ ) |
48 |
self.ctx = WhirlpoolStruct() |
49 |
self.update(arg) |