| 135 | f.write(line) |
| 136 | |
| 137 | def bsp_update_kconfig_library(dist_dir): |
| 138 | # change RTT_ROOT in Kconfig |
| 139 | if not os.path.isfile(os.path.join(dist_dir, 'Kconfig')): |
| 140 | return |
| 141 | |
| 142 | with open(os.path.join(dist_dir, 'Kconfig'), 'r') as f: |
| 143 | data = f.readlines() |
| 144 | with open(os.path.join(dist_dir, 'Kconfig'), 'w') as f: |
| 145 | for line in data: |
| 146 | if line.find('source') != -1 and line.find('../libraries') != -1: |
| 147 | line = line.replace('../libraries', 'libraries') |
| 148 | f.write(line) |
| 149 | |
| 150 | # change board/kconfig path |
| 151 | if not os.path.isfile(os.path.join(dist_dir, 'board/Kconfig')): |
| 152 | return |
| 153 | |
| 154 | with open(os.path.join(dist_dir, 'board/Kconfig'), 'r') as f: |
| 155 | data = f.readlines() |
| 156 | with open(os.path.join(dist_dir, 'board/Kconfig'), 'w') as f: |
| 157 | for line in data: |
| 158 | if line.find('source') != -1 and line.find('../libraries') != -1: |
| 159 | line = line.replace('../libraries', 'libraries') |
| 160 | f.write(line) |
| 161 | |
| 162 | def zip_dist(dist_dir, dist_name): |
| 163 | import zipfile |