Returns all the distributions found locally.
(cls, ctx, extra_dist_dirs=[])
| 206 | |
| 207 | @classmethod |
| 208 | def get_distributions(cls, ctx, extra_dist_dirs=[]): |
| 209 | '''Returns all the distributions found locally.''' |
| 210 | if extra_dist_dirs: |
| 211 | raise BuildInterruptingException( |
| 212 | 'extra_dist_dirs argument to get_distributions ' |
| 213 | 'is not yet implemented') |
| 214 | dist_dir = ctx.dist_dir |
| 215 | folders = glob.glob(join(dist_dir, '*')) |
| 216 | for dir in extra_dist_dirs: |
| 217 | folders.extend(glob.glob(join(dir, '*'))) |
| 218 | |
| 219 | dists = [] |
| 220 | for folder in folders: |
| 221 | if exists(join(folder, 'dist_info.json')): |
| 222 | with open(join(folder, 'dist_info.json')) as fileh: |
| 223 | dist_info = json.load(fileh) |
| 224 | dist = cls(ctx) |
| 225 | dist.name = dist_info['dist_name'] |
| 226 | dist.dist_dir = folder |
| 227 | dist.needs_build = False |
| 228 | dist.recipes = dist_info['recipes'] |
| 229 | if 'archs' in dist_info: |
| 230 | dist.archs = dist_info['archs'] |
| 231 | if 'ndk_api' in dist_info: |
| 232 | dist.ndk_api = dist_info['ndk_api'] |
| 233 | else: |
| 234 | dist.ndk_api = None |
| 235 | warning( |
| 236 | "Distribution {distname}: ({distdir}) has been " |
| 237 | "built with an unknown api target, ignoring it, " |
| 238 | "you might want to delete it".format( |
| 239 | distname=dist.name, |
| 240 | distdir=dist.dist_dir |
| 241 | ) |
| 242 | ) |
| 243 | dists.append(dist) |
| 244 | return dists |
| 245 | |
| 246 | def save_info(self, dirn): |
| 247 | ''' |