diff --git a/CHANGES.txt b/CHANGES.txt index 9cbfaa5fe5..933b2d0f72 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +* V1.55.10 + * do not ask to select variations in "ck install package" + when there are 2 or more variations! + * V1.55.9 * added --force_version to "ck detect soft" to force version. Useful to automate autodetection of imagenet, for example. diff --git a/ck/kernel.py b/ck/kernel.py index 293050ab6f..031c2eb7cc 100755 --- a/ck/kernel.py +++ b/ck/kernel.py @@ -27,7 +27,7 @@ # We use 3 digits for the main (released) version and 4th digit for development revision -__version__ = "1.55.9" +__version__ = "1.55.10" # Do not use characters (to detect outdated version)! # Import packages that are global for the whole kernel diff --git a/ck/repo/module/package/module.py b/ck/repo/module/package/module.py index 01696718b8..2627a0afe2 100644 --- a/ck/repo/module/package/module.py +++ b/ck/repo/module/package/module.py @@ -494,27 +494,38 @@ def install(i): j=0 key_variation={} + count_ons=0 for variation in sorted_supported_variations: - ck.out(str(j)+') '+variation) + x=str(j)+') '+variation + + if supported_variations.get(variation,{}).get('on_by_default','')=='yes': + x+=' (on by default)' + count_ons += 1 + + ck.out(x) + key_variation[j]=variation j+=1 ck.out('') - if quiet!='yes': - x=input('Please select a variation or press Enter for the default one (0): ') + # If more than 1 default variation found, skip asking which one to select + # (it means that it's unlikely a version selection but an env customization) + if count_ons<2: + if quiet!='yes': + x=input('Please select a variation or press Enter for the default one (0): ') - x=x.strip() - if x=='': x='0' + x=x.strip() + if x=='': x='0' - ix=int(x) - if ix<0 or ix>=j: - return {'return':1, 'error':'variation number is not recognized'} - else: - ck.out('Selected 0 (default)') - ix=0 + ix=int(x) + if ix<0 or ix>=j: + return {'return':1, 'error':'variation number is not recognized'} + else: + ck.out('Selected 0 (default)') + ix=0 - required_variations=[key_variation[ix]] + required_variations=[key_variation[ix]] required_vari_pairs = [ (variation_name, False) for variation_name in required_variations ] default_vari_pairs = [ (variation_name, True) for variation_name in supported_variations if supported_variations[variation_name].get('on_by_default', '')=='yes' ]