1 |
commit: 7748284a8002b4d3cf44cc0cd24738aebeb8b548 |
2 |
Author: Mike Frysinger <vapier <AT> chromium <DOT> org> |
3 |
AuthorDate: Fri Apr 16 01:13:13 2021 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 16 01:13:13 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=7748284a |
7 |
|
8 |
lddtree: require Python 3.6+ |
9 |
|
10 |
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> |
11 |
|
12 |
lddtree.py | 16 +++------------- |
13 |
1 file changed, 3 insertions(+), 13 deletions(-) |
14 |
|
15 |
diff --git a/lddtree.py b/lddtree.py |
16 |
index 3420b7d..b65c3f2 100755 |
17 |
--- a/lddtree.py |
18 |
+++ b/lddtree.py |
19 |
@@ -1,5 +1,4 @@ |
20 |
#!/usr/bin/env python |
21 |
-# -*- coding: utf-8 -*- |
22 |
# Copyright 2012-2014 Gentoo Foundation |
23 |
# Copyright 2012-2014 Mike Frysinger <vapier@g.o> |
24 |
# Copyright 2012-2014 The Chromium OS Authors |
25 |
@@ -40,8 +39,6 @@ This will place bash, lspci, and lsof into /foo/bin/. All the libraries |
26 |
they need will be placed into /foo/lib/ only. |
27 |
""" |
28 |
|
29 |
-from __future__ import print_function |
30 |
- |
31 |
import argparse |
32 |
import glob |
33 |
import errno |
34 |
@@ -49,6 +46,8 @@ import os |
35 |
import shutil |
36 |
import sys |
37 |
|
38 |
+assert sys.version_info >= (3, 6), f'Python 3.6+ required, but found {sys.version}' |
39 |
+ |
40 |
from elftools.elf.elffile import ELFFile |
41 |
from elftools.common import exceptions |
42 |
|
43 |
@@ -116,15 +115,6 @@ def readlink(path, root, prefixed=False): |
44 |
return normpath((root + path) if prefixed else path) |
45 |
|
46 |
|
47 |
-def makedirs(path): |
48 |
- """Like os.makedirs(), but ignore EEXIST errors""" |
49 |
- try: |
50 |
- os.makedirs(path) |
51 |
- except OSError as e: |
52 |
- if e.errno != errno.EEXIST: |
53 |
- raise |
54 |
- |
55 |
- |
56 |
def dedupe(items): |
57 |
"""Remove all duplicates from |items| (keeping order)""" |
58 |
seen = {} |
59 |
@@ -596,7 +586,7 @@ def _ActionCopy(options, elf): |
60 |
if options.verbose: |
61 |
print('%s -> %s' % (src, dst)) |
62 |
|
63 |
- makedirs(os.path.dirname(dst)) |
64 |
+ os.makedirs(os.path.dirname(dst), exist_ok=True) |
65 |
try: |
66 |
shutil.copy2(realsrc, dst) |
67 |
except IOError: |