def ensure_linked_actions(dists, prefix): actions = defaultdict(list) actions[PREFIX] = prefix for dist in dists: if install.is_linked(prefix, dist): continue actions[LINK].append(dist) if install.is_extracted(config.pkgs_dir, dist): continue actions[EXTRACT].append(dist) if install.is_fetched(config.pkgs_dir, dist): continue actions[FETCH].append(dist) return actions
def app_info_packages(fn): """ given the filename of a package, return which packages (and their sizes) still need to be downloaded, in order to install the package. That is, the package itself and it's dependencies. Returns a list of tuples (pkg_name, pkg_version, size, fetched? True or False). """ from resolve import Resolve index = get_index() r = Resolve(index) res = [] for fn2 in r.solve([fn2spec(fn)]): info = index[fn2] res.append((info['name'], info['version'], info['size'], install.is_fetched(config.pkgs_dir, fn2[:-8]))) return res