~ubuntu-branches/ubuntu/quantal/ubuntu-drivers-common/quantal-proposed

« back to all changes in this revision

Viewing changes to UbuntuDrivers/detect.py

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2012-10-04 22:59:33 UTC
  • Revision ID: package-import@ubuntu.com-20121004225933-2qif21i9vfqgg8ui
Tags: 1:0.2.70
UbuntuDrivers/detect.py: Never recommend a driver which has "experiment"
in the name, unless no other driver is available.

Show diffs side-by-side

added added

removed removed

Lines of Context:
522
522
 
523
523
    -updates always sort after non-updates, as we prefer the stable driver and
524
524
    only want to offer -updates when the one from release does not support the
525
 
    card.
 
525
    card. We never want to recommend -experimental unless it's the only one
 
526
    available, so sort this last.
526
527
    '''
527
528
    if x.endswith('-updates') and not y.endswith('-updates'):
528
529
        return -1
529
530
    if not x.endswith('-updates') and y.endswith('-updates'):
530
531
        return 1
 
532
    if 'experiment' in x and 'experiment' not in y:
 
533
        return -1
 
534
    if 'experiment' not in x and 'experiment' in y:
 
535
        return 1
531
536
    if x < y:
532
537
        return -1
533
538
    if x > y: