コード例 #1
0
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()})
コード例 #2
0
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()})
コード例 #3
0
ファイル: margarita.py プロジェクト: chymb/margarita
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)
コード例 #4
0
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)
コード例 #5
0
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)
コード例 #6
0
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)
コード例 #7
0
ファイル: margarita.py プロジェクト: Jaharmi/margarita
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)
コード例 #8
0
ファイル: margarita.py プロジェクト: joraff/margarita
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)
コード例 #9
0
ファイル: margarita.py プロジェクト: kenergy/margarita
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)
コード例 #10
0
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)
コード例 #11
0
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)
コード例 #12
0
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)
コード例 #13
0
#!/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)