28 Commits

Author SHA1 Message Date
Mario Fetka
7072c00a77 Python 3 modernization: low-hanging fruit cleanup
- hashlib: add usedforsecurity=False to all md5/sha1/sha256/sha512 calls
  (FIPS-mode compatibility, ~34 call sites across 13 files)
- join([listcomp]): convert to generator expressions (~15 sites)
- class Foo(object): -> class Foo: across all files (Python 3 style)
- collections.OrderedDict() -> {} in db/skel.py (Python 3.7+ dicts ordered)
- open() without context manager: fix 3 bare open/close in misc.py
- Exception chaining: add 'from err' to raise statements in portage_plugin
- const_is_python3() dead code removal:
  * Simplify 7 compat functions in const.py (const_is_python3,
    const_get_stringtype, const_isunicode, const_israwstring,
    const_get_buffer, const_convert_to_unicode, const_convert_to_rawstring,
    const_isstring, const_get_int) — remove Python 2 branches
  * Remove 100+ const_is_python3() if/else branches across 27 files,
    keeping only the Python 3 path
  * Remove cPickle import in dump.py, use plain pickle with fix_imports=True
  * Remove urllib2 dead imports in misc.py, fetchers.py
  * Clean up const_is_python3 from all import lines

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-26 11:51:29 +02:00
Fabio Erculiani
574a30bd98 [eit.commands.command] add missing import 2014-01-28 14:39:16 +01:00
Fabio Erculiani
976c5e72c4 [eit.commands.command] make possible to avoid dealing with the Entropy Resources Lock 2014-01-28 14:00:15 +01:00
Fabio Erculiani
a8e902b0a5 [eit.commands] rename call_unlocked to call_shared, call_locked to call_exclusive 2013-12-12 22:17:36 +01:00
Fabio Erculiani
ebf63e6060 [entropy.locks] fix shared/exclusive locking mix due to reentrancy, add tests 2013-12-08 16:15:39 +01:00
Fabio Erculiani
1917771b54 [entropy.locks] move Entropy Resources Lock code to a separate module 2013-12-08 14:37:57 +01:00
Fabio Erculiani
81dca7339e [eit.commands.command] use the Entropy class object to acquire the Entropy Resources Lock 2013-12-05 22:19:21 +01:00
Fabio Erculiani
6a249d4f11 [eit.commands.command] call shutdown() before releasing locks
shutdown() calls EntropyCacher.sync() and stop()...
2013-08-10 11:02:17 +02:00
Fabio Erculiani
5afdea550d [eit.commands] EitCommand: reset repositories states after lock acquisition 2013-07-16 16:07:32 +02:00
Fabio Erculiani
897799201f [eit] wait indefinitely to acquire the resources lock using a spinner 2013-05-03 09:12:51 +02:00
Fabio Erculiani
763ca45a54 [eit.commands.command] add _entropy_class() method 2013-04-05 14:32:33 +01:00
Fabio Erculiani
1e53daf23d [eit] monkey patch argparse.ArgumentParser to fix UTF-8 strings handling
See bug 4049.
2013-03-11 01:02:22 +00:00
Fabio Erculiani
a1e59c352f [server] fix --help output when redirected through pipes, fix bug 4049 2013-03-08 12:55:59 +01:00
Fabio Erculiani
a67a52f49a [eit] enable shared locking usage for "unlocked" methods 2012-02-15 20:08:09 +01:00
Fabio Erculiani
6a69307f4c [eit] add eit-notice man page (and improve automatic man generation functions) 2011-11-14 23:34:37 +01:00
Fabio Erculiani
e5d6980267 [eit.commands.command] move man() from eit.commands.commit to eit.commands.command (rename to _eit()) 2011-11-10 16:22:03 +01:00
Fabio Erculiani
44471c5ba3 [entropy.server] move Makefile logic to server/, add man support to eit, move matter to server/ 2011-11-10 15:33:43 +01:00
Fabio Erculiani
25323d4a07 [eit] implement initial bash-completion support 2011-10-28 19:47:19 +02:00
Fabio Erculiani
a1010fb6ca [eit.*] more code cleanup 2011-10-18 05:52:42 +02:00
Fabio Erculiani
86fdfbaba0 [eit.*] split ArgumentParser object creation from parsing code 2011-10-17 15:36:49 +02:00
Fabio Erculiani
4cc4407eaa [entropy.server] drop etpConst['community']['mode'], move setting into server.conf 2011-10-17 11:26:46 +02:00
Fabio Erculiani
d936971f6a [eit.commands.command] add support for unprivileged commands execution 2011-10-17 11:26:44 +02:00
Fabio Erculiani
4dab61739b [eit.commands.command] add _call_unlocked() method 2011-10-17 11:26:43 +02:00
Fabio Erculiani
412fab0f9b [eit.commands.command] add missing import 2011-10-17 11:26:42 +02:00
Fabio Erculiani
b70222133f [eit.commands.*] drop unused imports 2011-10-17 11:26:41 +02:00
Fabio Erculiani
419e980538 [eit.commands.command] move general entropy resources locking method to EitCommand 2011-10-17 11:26:41 +02:00
Fabio Erculiani
f4c29b8489 [eit.main] automatically build the list of available commands, add command aliases support 2011-10-17 11:26:41 +02:00
Fabio Erculiani
70551c22d6 [eit] first chunk of code for the new server-side repository management toolkit (greatly inspired to git) 2011-10-17 11:26:40 +02:00