Skip to content

Commit

Permalink
added --quiet flag to automatically enter default anser to most quest…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
gfursin committed Apr 18, 2021
1 parent 658ab2b commit cdc0f72
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* V1.55.8
* added --quiet flag to automatically enter default anser to most questions

* V1.55.7
* added --default flag to ck install package to select 0
when multiple packages and variations available.
Expand Down
2 changes: 1 addition & 1 deletion ck/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


# We use 3 digits for the main (released) version and 4th digit for development revision
__version__ = "1.55.7"
__version__ = "1.55.8"
# Do not use characters (to detect outdated version)!

# Import packages that are global for the whole kernel
Expand Down
2 changes: 2 additions & 0 deletions ck/repo/module/env/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ def env_set(i):
'host_os':hos,
'target_os':tos,
'target_device_id':tdid,
'quiet':quiet,
'version_from':vfrom,
'version_to':vto,
# 'deps':cdeps,
Expand Down Expand Up @@ -2271,6 +2272,7 @@ def internal_install_package(i):
'deps_cache':deps_cache,
'version_from':vfrom,
'version_to':vto,
'quiet':quiet,
'add_hint':ah}

if rebuild=='yes': install_adict['rebuild']='yes'
Expand Down
15 changes: 8 additions & 7 deletions ck/repo/module/package/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def install(i):
(debug) - if 'yes', open shell before installing but with all resolved deps
(default) - if 'yes', install default package (answer 0 to selection questions)
(quiet) - if 'yes', install default package (answer 0 to selection questions)
}
Output: {
Expand All @@ -143,7 +143,7 @@ def install(i):

ask=i.get('ask','')

default=i.get('default','').strip().lower()
quiet=i.get('quiet','').strip().lower()

xtags=i.get('tags','')
xor_tags=i.get('or_tags','')
Expand Down Expand Up @@ -369,7 +369,7 @@ def install(i):
'module_uoa': 'misc',
'options': ver_options,
'default': '0',
'select_default': default,
'select_default': quiet,
'no_skip_line': 'yes',
'question': 'Please select the package to install',
})
Expand Down Expand Up @@ -501,7 +501,7 @@ def install(i):

ck.out('')

if default!='yes':
if quiet!='yes':
x=input('Please select a variation or press Enter for the default one (0): ')

x=x.strip()
Expand Down Expand Up @@ -825,6 +825,7 @@ def install(i):
'deps_cache':deps_cache,
'dep_add_tags': dep_add_tags,
'safe':safe,
'quiet':quiet,
'deps':udeps}
if o=='con': env_resolve_action_dict['out']='con'

Expand Down Expand Up @@ -873,7 +874,7 @@ def install(i):
}

if o=='con': param_dict_for_pre_path['interactive']='yes'
if i.get('quiet','')=='yes': param_dict_for_pre_path['interactive']=''
if quiet=='yes': param_dict_for_pre_path['interactive']=''

rx = internal_run_if_present(customization_script, 'pre_path', param_dict_for_pre_path, pr_env)
if rx['return']>0: return rx
Expand Down Expand Up @@ -1239,7 +1240,7 @@ def install(i):
}

if o=='con': param_dict_for_post_deps['interactive']='yes'
if i.get('quiet','')=='yes': param_dict_for_post_deps['interactive']=''
if quiet=='yes': param_dict_for_post_deps['interactive']=''

rx = internal_run_if_present(customization_script, 'post_deps', param_dict_for_post_deps, pr_env)
if rx['return']>0: return rx
Expand Down Expand Up @@ -1399,7 +1400,7 @@ def efp_substitute(efp):
}

if o=='con': param_dict_for_setup['interactive']='yes'
if i.get('quiet','')=='yes': param_dict_for_setup['interactive']=''
if quiet=='yes': param_dict_for_setup['interactive']=''

param_dict_for_post_setup=copy.deepcopy(param_dict_for_setup)

Expand Down

0 comments on commit cdc0f72

Please sign in to comment.