forked from bears-bugs/bears-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_subject_scripts.py
30 lines (22 loc) · 1.22 KB
/
generate_subject_scripts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
from os.path import join
from pprint import pprint
import shutil
import urllib.request
import json
from pprint import pprint
metadata = open("meta-data.json","r")
projects = json.load(metadata)
metadata.close()
for project in projects:
os.makedirs(project["subject"],exist_ok=True)
os.makedirs(join(project["subject"],project["bug_id"]),exist_ok=True)
shutil.copy2("build_subject",join(project["subject"],project["bug_id"],"build_subject"))
shutil.copy2("clean_subject",join(project["subject"],project["bug_id"],"clean_subject"))
shutil.copy2("compress_deps",join(project["subject"],project["bug_id"],"compress_deps"))
shutil.copy2("config_subject",join(project["subject"],project["bug_id"],"config_subject"))
shutil.copy2("install_deps",join(project["subject"],project["bug_id"],"install_deps"))
shutil.copy2("test_subject",join(project["subject"],project["bug_id"],"test_subject"))
shutil.copy2("setup_subject",join(project["subject"],project["bug_id"],"setup_subject"))
shutil.copy2("verify_dev",join(project["subject"],project["bug_id"],"verify_dev"))
os.system("sed -i 's/<BRANCH>/{}/' {}".format(project['bug_id'],join(project["subject"],project["bug_id"],"setup_subject")))