Skip to content

Commit daae83c

Browse files
committed
format
1 parent 76d49ba commit daae83c

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

llvm_ir_dataset_utils/builders/portage_builder.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from llvm_ir_dataset_utils.util import portage as portage_utils
1818
from llvm_ir_dataset_utils.util import extract_source_lib
1919

20-
2120
BUILD_LOG_NAME = './portage_build.log'
2221

2322

@@ -73,7 +72,7 @@ def extract_ir(package_spec, corpus_dir, build_dir, threads):
7372
build_directory = build_dir + "/portage/"
7473
package_spec = package_spec + "*"
7574
match = glob.glob(os.path.join(build_directory, package_spec))
76-
assert(len(match) == 1)
75+
assert (len(match) == 1)
7776
package_name_with_version = os.path.basename(match[0])
7877
build_directory = match[0] + "/work/" + package_name_with_version
7978
if build_directory is not None:

llvm_ir_dataset_utils/util/portage.py

+16-18
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,20 @@
66

77

88
def get_portage_compiler_config(filename):
9-
content = (
10-
'COMMON_FLAGS="-O2 -pipe -Xclang -fembed-bitcode=all"\n'
11-
'\n'
12-
'CC="/root/ir-dataset/utils/compiler_wrapper"\n'
13-
'CXX="/root/ir-dataset/utils/compiler_wrapper++"\n'
14-
'CFLAGS="${COMMON_FLAGS}"\n'
15-
'CXXFLAGS="${COMMON_FLAGS}"\n'
16-
'FCFLAGS="${COMMON_FLAGS}"\n'
17-
'FFLAGS="${COMMON_FLAGS}"\n'
18-
'\n'
19-
'FEATURES="noclean"\n'
20-
'\n'
21-
'LC_MESSAGES=C.utf8'
22-
)
23-
with open(filename, 'w') as file:
24-
file.write(content)
25-
9+
content = ('COMMON_FLAGS="-O2 -pipe -Xclang -fembed-bitcode=all"\n'
10+
'\n'
11+
'CC="/root/ir-dataset/utils/compiler_wrapper"\n'
12+
'CXX="/root/ir-dataset/utils/compiler_wrapper++"\n'
13+
'CFLAGS="${COMMON_FLAGS}"\n'
14+
'CXXFLAGS="${COMMON_FLAGS}"\n'
15+
'FCFLAGS="${COMMON_FLAGS}"\n'
16+
'FFLAGS="${COMMON_FLAGS}"\n'
17+
'\n'
18+
'FEATURES="noclean"\n'
19+
'\n'
20+
'LC_MESSAGES=C.utf8')
21+
with open(filename, 'w') as file:
22+
file.write(content)
2623

2724

2825
def portage_setup_compiler(build_dir):
@@ -41,8 +38,9 @@ def portage_setup_compiler(build_dir):
4138
os.symlink('/etc/portage/make.profile', make_profile_path)
4239
get_portage_compiler_config(make_conf_path)
4340

41+
4442
def clean_binpkg(package_spec):
4543
command_vector = ['rm', '-rf', '/var/cache/binpkgs/' + package_spec]
4644
subprocess.run(command_vector)
4745
sync_command = ['emaint', '--fix', 'binhost']
48-
subprocess.run(sync_command)
46+
subprocess.run(sync_command)

0 commit comments

Comments
 (0)