def products(): products = reposadocommon.getProductInfo() catalog_branches = reposadocommon.getCatalogBranches() prodlist = [] for prodid in products.keys(): if 'title' in products[prodid] and 'version' in products[prodid] and 'PostDate' in products[prodid]: prod = { 'title': products[prodid]['title'], 'version': products[prodid]['version'], 'PostDate': products[prodid]['PostDate'].strftime('%Y-%m-%d'), 'description': get_description_content(products[prodid]['description']), 'id': prodid, 'depr': len(products[prodid].get('AppleCatalogs', [])) < 1, 'branches': [], 'oscatalogs': sorted(versions_from_catalogs(products[prodid].get('OriginalAppleCatalogs')), key=LooseVersion, reverse=True), 'packages': product_urls(products[prodid]['CatalogEntry']), } for branch in catalog_branches.keys(): if prodid in catalog_branches[branch]: prod['branches'].append(branch) prodlist.append(prod) else: print 'Invalid update!' sprodlist = sorted(prodlist, key=itemgetter('PostDate'), reverse=True) return json_response({'products': sprodlist, 'branches': catalog_branches.keys()})
def products(): products = reposadocommon.getProductInfo() catalog_branches = reposadocommon.getCatalogBranches() prodlist = [] for prodid in products.keys(): if 'title' in products[prodid] and 'version' in products[prodid] \ and 'PostDate' in products[prodid]: prod = { 'title': products[prodid]['title'], 'version': products[prodid]['version'], 'PostDate': products[prodid]['PostDate'].strftime('%Y-%m-%d'), 'description': get_description_content( products[prodid]['description']), 'id': prodid, 'depr': len(products[prodid].get('AppleCatalogs', [])) < 1, 'branches': [], 'oscatalogs': sorted( versions_from_catalogs(products[prodid].get( 'OriginalAppleCatalogs')), key=LooseVersion, reverse=True), 'packages': product_urls(products[prodid]['CatalogEntry']), } for branch in catalog_branches.keys(): if prodid in catalog_branches[branch]: prod['branches'].append(branch) prodlist.append(prod) else: print 'Invalid update!' sprodlist = sorted(prodlist, key=itemgetter('PostDate'), reverse=True) return json_response({ 'products': sprodlist, 'branches': catalog_branches.keys()})
def products(): products = reposadocommon.getProductInfo() prodlist = [] for prodid in products.keys(): if 'title' in products[prodid] and 'version' in products[prodid] and 'PostDate' in products[prodid]: prodlist.append({ 'title': products[prodid]['title'], 'version': products[prodid]['version'], 'PostDate': products[prodid]['PostDate'].strftime('%Y-%m-%d'), 'description': get_description_content(products[prodid]['description']), 'packages': get_packages_urls(products[prodid]['CatalogEntry']), 'id': prodid, 'depr': len(products[prodid].get('AppleCatalogs', [])) < 1, 'seed': 'seed' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'yosemite': 'index-10.10' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'mavericks': 'index-10.9' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'mountainlion': 'index-mountainlion' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'lion': 'index-lion' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'snowleopard': 'index-leopard-snowleopard.merged-1.sucatalog' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'leopard': 'index-leopard.merged-1.sucatalog' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'tiger': 'index-1.sucatalog' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), }) else: print 'Invalid update!' sprodlist = sorted(prodlist, key=itemgetter('PostDate'), reverse=True) return json_response(sprodlist)
def add_all(branchname): products = reposadocommon.getProductInfo() catalog_branches = reposadocommon.getCatalogBranches() catalog_branches[branchname] = products.keys() reposadocommon.writeCatalogBranches(catalog_branches) reposadocommon.writeAllBranchCatalogs() return jsonify(result=True)
def products(): products = reposadocommon.getProductInfo() prodlist = [] for prodid in products.keys(): if 'title' in products[prodid] and 'version' in products[ prodid] and 'PostDate' in products[prodid]: prodlist.append({ 'title': products[prodid]['title'], 'version': products[prodid]['version'], 'PostDate': products[prodid]['PostDate'].strftime('%Y-%m-%d'), 'description': get_description_content(products[prodid]['description']), 'packages': get_packages_urls(products[prodid]['CatalogEntry']), 'id': prodid, 'depr': len(products[prodid].get('AppleCatalogs', [])) < 1, 'seed': 'seed' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'yosemite': 'index-10.10' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'mavericks': 'index-10.9' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'mountainlion': 'index-mountainlion' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'lion': 'index-lion' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'snowleopard': 'index-leopard-snowleopard.merged-1.sucatalog' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'leopard': 'index-leopard.merged-1.sucatalog' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), 'tiger': 'index-1.sucatalog' in ''.join(products[prodid].get('OriginalAppleCatalogs', [])), }) else: print 'Invalid update!' sprodlist = sorted(prodlist, key=itemgetter('PostDate'), reverse=True) return json_response(sprodlist)
def products(): products = reposadocommon.getProductInfo() prodlist = [] for prodid in products.keys(): if 'title' in products[prodid] and 'version' in products[prodid] and 'PostDate' in products[prodid]: prodlist.append({ 'title': products[prodid]['title'], 'version': products[prodid]['version'], 'PostDate': products[prodid]['PostDate'].strftime('%Y-%m-%d'), 'id': prodid, }) else: print 'Invalid update!' sprodlist = sorted(prodlist, key=itemgetter('PostDate'), reverse=True) return jsonify(result=sprodlist)
def products(): products = reposadocommon.getProductInfo() prodlist = [] for prodid in products.keys(): if 'title' in products[prodid] and 'version' in products[prodid] and 'PostDate' in products[prodid]: prodlist.append({ 'title': products[prodid]['title'], 'version': products[prodid]['version'], 'PostDate': products[prodid]['PostDate'].strftime('%Y-%m-%d'), 'description': get_description_content(products[prodid]['description']), 'id': prodid, 'depr': len(products[prodid].get('AppleCatalogs', [])) < 1, }) else: print 'Invalid update!' sprodlist = sorted(prodlist, key=itemgetter('PostDate'), reverse=True) return json_response(sprodlist)
def products(): products = reposadocommon.getProductInfo() prodlist = [] for prodid in products.keys(): if "title" in products[prodid] and "version" in products[prodid] and "PostDate" in products[prodid]: prodlist.append( { "title": products[prodid]["title"], "version": products[prodid]["version"], "PostDate": products[prodid]["PostDate"].strftime("%Y-%m-%d"), "id": prodid, "depr": len(products[prodid].get("AppleCatalogs", [])) < 1, } ) else: print "Invalid update!" sprodlist = sorted(prodlist, key=itemgetter("PostDate"), reverse=True) return jsonify(result=sprodlist)
def dup_apple(branchname): catalog_branches = reposadocommon.getCatalogBranches() if branchname not in catalog_branches.keys(): print 'No branch ' + branchname return jsonify(result=False) # generate list of (non-deprecated) updates products = reposadocommon.getProductInfo() prodlist = [] for prodid in products.keys(): if len(products[prodid].get('AppleCatalogs', [])) >= 1: prodlist.append(prodid) catalog_branches[branchname] = prodlist print 'Writing catalogs' reposadocommon.writeCatalogBranches(catalog_branches) reposadocommon.writeAllBranchCatalogs() return jsonify(result=True)
def products(): products = reposadocommon.getProductInfo() prodlist = [] for prodid in products.keys(): if 'title' in products[prodid] and 'version' in products[ prodid] and 'PostDate' in products[prodid]: prodlist.append({ 'title': products[prodid]['title'], 'version': products[prodid]['version'], 'PostDate': products[prodid]['PostDate'].strftime('%Y-%m-%d'), 'id': prodid, 'depr': len(products[prodid].get('AppleCatalogs', [])) < 1, }) else: print 'Invalid update!' sprodlist = sorted(prodlist, key=itemgetter('PostDate'), reverse=True) return jsonify(result=sprodlist)
#!/usr/bin/env python # Copyright 2015 Ted Mielczarek. See the LICENSE # file at the top-level directory of this distribution. import os import reposadolib.reposadocommon as reposadocommon reposadocommon.get_main_dir = lambda: '/home/worker/venv/bin/' products = reposadocommon.getProductInfo() args = [] for product_id, p in products.iteritems(): t = p['title'] if t.startswith('OS X') or t.startswith('Mac OS X'): args.append('--product-id=' + product_id) if 'JUST_ONE_PACKAGE' in os.environ: args = args[:1] print ' '.join(args)