summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/views.py')
-rw-r--r--bitbake/lib/toaster/toastergui/views.py115
1 files changed, 91 insertions, 24 deletions
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index f5fa72e610..36eb0bf97e 100644
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -563,13 +563,13 @@ def target(request, build_id, target_id):
563 'qhelp':'The size of the package', 563 'qhelp':'The size of the package',
564 'orderfield': _get_toggle_order(request, "size", True), 564 'orderfield': _get_toggle_order(request, "size", True),
565 'ordericon':_get_toggle_order_icon(request, "size"), 565 'ordericon':_get_toggle_order_icon(request, "size"),
566 'clclass': 'package_size', 566 'clclass': 'package_size span2',
567 'hidden' : 0, 567 'hidden' : 0,
568 }, 568 },
569 { 569 {
570 'name':'Size over total (%)', 570 'name':'Size over total (%)',
571 'qhelp':'Proportion of the overall included package size represented by this package', 571 'qhelp':'Proportion of the overall included package size represented by this package',
572 'clclass': 'size_over_total', 572 'clclass': 'size_over_total span2',
573 'hidden' : 1, 573 'hidden' : 1,
574 }, 574 },
575 { 575 {
@@ -1254,7 +1254,7 @@ def bpackage(request, build_id):
1254 'qhelp':'The size of the package', 1254 'qhelp':'The size of the package',
1255 'orderfield': _get_toggle_order(request, "size", True), 1255 'orderfield': _get_toggle_order(request, "size", True),
1256 'ordericon':_get_toggle_order_icon(request, "size"), 1256 'ordericon':_get_toggle_order_icon(request, "size"),
1257 'clclass': 'size', 'hidden': 0, 1257 'clclass': 'size span2', 'hidden': 0,
1258 }, 1258 },
1259 { 1259 {
1260 'name':'License', 1260 'name':'License',
@@ -1456,13 +1456,40 @@ def package_built_detail(request, build_id, package_id):
1456 template = "package_built_detail.html" 1456 template = "package_built_detail.html"
1457 if Build.objects.filter(pk=build_id).count() == 0 : 1457 if Build.objects.filter(pk=build_id).count() == 0 :
1458 return redirect(builds) 1458 return redirect(builds)
1459
1460 # follow convention for pagination w/ search although not used for this view
1461 queryset = Package_File.objects.filter(package_id__exact=package_id)
1462 mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'path:+'};
1463 retval = _verify_parameters( request.GET, mandatory_parameters )
1464 if retval:
1465 return _redirect_parameters( 'package_built_detail', request.GET, mandatory_parameters, build_id = build_id, package_id = package_id)
1466
1467 (filter_string, search_term, ordering_string) = _search_tuple(request, Package_File)
1468 paths = _get_queryset(Package_File, queryset, filter_string, search_term, ordering_string, 'path')
1469
1459 package = Package.objects.filter(pk=package_id)[0] 1470 package = Package.objects.filter(pk=package_id)[0]
1460 package.fullpackagespec = _get_fullpackagespec(package) 1471 package.fullpackagespec = _get_fullpackagespec(package)
1461 context = { 1472 context = {
1462 'build' : Build.objects.filter(pk=build_id)[0], 1473 'build' : Build.objects.filter(pk=build_id)[0],
1463 'package' : package, 1474 'package' : package,
1464 'dependency_count' : _get_package_dependency_count(package, -1, False), 1475 'dependency_count' : _get_package_dependency_count(package, -1, False),
1476 'objects' : paths,
1477 'tablecols':[
1478 {
1479 'name':'File',
1480 'orderfield': _get_toggle_order(request, "path"),
1481 'ordericon':_get_toggle_order_icon(request, "path"),
1482 },
1483 {
1484 'name':'Size',
1485 'orderfield': _get_toggle_order(request, "size", True),
1486 'ordericon':_get_toggle_order_icon(request, "size"),
1487 'dclass': 'sizecol span2',
1488 },
1489 ]
1465 } 1490 }
1491 if paths.all().count() < 2:
1492 context['disable_sort'] = True;
1466 return render(request, template, context) 1493 return render(request, template, context)
1467 1494
1468def package_built_dependencies(request, build_id, package_id): 1495def package_built_dependencies(request, build_id, package_id):
@@ -1488,6 +1515,17 @@ def package_included_detail(request, build_id, target_id, package_id):
1488 if Build.objects.filter(pk=build_id).count() == 0 : 1515 if Build.objects.filter(pk=build_id).count() == 0 :
1489 return redirect(builds) 1516 return redirect(builds)
1490 1517
1518
1519 # follow convention for pagination w/ search although not used for this view
1520 mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'path:+'};
1521 retval = _verify_parameters( request.GET, mandatory_parameters )
1522 if retval:
1523 return _redirect_parameters( 'package_included_detail', request.GET, mandatory_parameters, build_id = build_id, target_id = target_id, package_id = package_id)
1524 (filter_string, search_term, ordering_string) = _search_tuple(request, Package_File)
1525
1526 queryset = Package_File.objects.filter(package_id__exact=package_id)
1527 paths = _get_queryset(Package_File, queryset, filter_string, search_term, ordering_string, 'path')
1528
1491 package = Package.objects.filter(pk=package_id)[0] 1529 package = Package.objects.filter(pk=package_id)[0]
1492 package.fullpackagespec = _get_fullpackagespec(package) 1530 package.fullpackagespec = _get_fullpackagespec(package)
1493 package.alias = _get_package_alias(package) 1531 package.alias = _get_package_alias(package)
@@ -1497,8 +1535,24 @@ def package_included_detail(request, build_id, target_id, package_id):
1497 'target' : target, 1535 'target' : target,
1498 'package' : package, 1536 'package' : package,
1499 'reverse_count' : _get_package_reverse_dep_count(package, target_id), 1537 'reverse_count' : _get_package_reverse_dep_count(package, target_id),
1500 'dependency_count' : _get_package_dependency_count(package, target_id, True) 1538 'dependency_count' : _get_package_dependency_count(package, target_id, True),
1539 'objects': paths,
1540 'tablecols':[
1541 {
1542 'name':'File',
1543 'orderfield': _get_toggle_order(request, "path"),
1544 'ordericon':_get_toggle_order_icon(request, "path"),
1545 },
1546 {
1547 'name':'Size',
1548 'orderfield': _get_toggle_order(request, "size", True),
1549 'ordericon':_get_toggle_order_icon(request, "size"),
1550 'dclass': 'sizecol span2',
1551 },
1552 ]
1501 } 1553 }
1554 if paths.all().count() < 2:
1555 context['disable_sort'] = True;
1502 return render(request, template, context) 1556 return render(request, template, context)
1503 1557
1504def package_included_dependencies(request, build_id, target_id, package_id): 1558def package_included_dependencies(request, build_id, target_id, package_id):
@@ -1528,36 +1582,49 @@ def package_included_reverse_dependencies(request, build_id, target_id, package_
1528 if Build.objects.filter(pk=build_id).count() == 0 : 1582 if Build.objects.filter(pk=build_id).count() == 0 :
1529 return redirect(builds) 1583 return redirect(builds)
1530 1584
1585 mandatory_parameters = { 'count': 25, 'page' : 1, 'orderby':'package__name:+'};
1586 retval = _verify_parameters( request.GET, mandatory_parameters )
1587 if retval:
1588 return _redirect_parameters( 'package_included_reverse_dependencies', request.GET, mandatory_parameters, build_id = build_id, target_id = target_id, package_id = package_id)
1589 (filter_string, search_term, ordering_string) = _search_tuple(request, Package_File)
1590
1591 queryset = Package_Dependency.objects.select_related('depends_on__name', 'depends_on__size').filter(depends_on=package_id, target_id=target_id, dep_type=Package_Dependency.TYPE_TRDEPENDS)
1592 objects = _get_queryset(Package_Dependency, queryset, filter_string, search_term, ordering_string, 'package__name')
1593
1531 package = Package.objects.filter(pk=package_id)[0] 1594 package = Package.objects.filter(pk=package_id)[0]
1532 package.fullpackagespec = _get_fullpackagespec(package) 1595 package.fullpackagespec = _get_fullpackagespec(package)
1533 package.alias = _get_package_alias(package) 1596 package.alias = _get_package_alias(package)
1534 target = Target.objects.filter(pk=target_id)[0] 1597 target = Target.objects.filter(pk=target_id)[0]
1535 1598 for o in objects:
1536 reverse_deps = [] 1599 if o.package.version != '':
1537 alldeps = package.package_dependencies_target.filter(target_id__exact=target_id) 1600 o.package.version += '-' + o.package.revision
1538 for idep in alldeps: 1601 o.alias = _get_package_alias(o.package)
1539 dep_package = Package.objects.get(pk=idep.package_id)
1540 version = dep_package.version
1541 if version != '' :
1542 version += '-' + dep_package.revision
1543 dep = {
1544 'name' : dep_package.name,
1545 'alias' : _get_package_alias(dep_package),
1546 'dependent_id' : dep_package.id,
1547 'version' : version,
1548 'size' : dep_package.size
1549 }
1550 if idep.dep_type == Package_Dependency.TYPE_TRDEPENDS :
1551 reverse_deps.append(dep)
1552
1553 context = { 1602 context = {
1554 'build' : Build.objects.filter(pk=build_id)[0], 1603 'build' : Build.objects.filter(pk=build_id)[0],
1555 'package' : package, 1604 'package' : package,
1556 'target' : target, 1605 'target' : target,
1557 'reverse_deps' : reverse_deps, 1606 'objects' : objects,
1558 'reverse_count' : _get_package_reverse_dep_count(package, target_id), 1607 'reverse_count' : _get_package_reverse_dep_count(package, target_id),
1559 'dependency_count' : _get_package_dependency_count(package, target_id, True) 1608 'dependency_count' : _get_package_dependency_count(package, target_id, True),
1609 'tablecols':[
1610 {
1611 'name':'Package',
1612 'orderfield': _get_toggle_order(request, "package__name"),
1613 'ordericon': _get_toggle_order_icon(request, "package__name"),
1614 },
1615 {
1616 'name':'Version',
1617 },
1618 {
1619 'name':'Size',
1620 'orderfield': _get_toggle_order(request, "package__size", True),
1621 'ordericon': _get_toggle_order_icon(request, "package__size"),
1622 'dclass': 'sizecol span2',
1623 },
1624 ]
1560 } 1625 }
1626 if objects.all().count() < 2:
1627 context['disable_sort'] = True;
1561 return render(request, template, context) 1628 return render(request, template, context)
1562 1629
1563def image_information_dir(request, build_id, target_id, packagefile_id): 1630def image_information_dir(request, build_id, target_id, packagefile_id):