Changes between Initial Version and Version 1 of SummerOfCode2014_interactive


Ignore:
Timestamp:
May 28, 2014, 7:40:26 PM (10 years ago)
Author:
shasha@…
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SummerOfCode2014_interactive

    v1 v1  
     1
     2= Interactivity Use Cases =
     3
     4=== Build-time dependencies ===
     5Desc: While installing a port if it conflicts with something already installed, ask the user for permission to deactivate the installed ones and reactivate after the build.
     6
     7Message: A list of all the conflicts will be shown and the user asked if they want to deactivate all or abort.
     8
     9Question type: A yes/no or continue/abort question is sufficient for this case. The user can either choose to deactivate all and continue with the build or abort. It is not necessary to give a multiple choice question for this use case.
     10
     11Example-
     12{{{
     13$> port install foobar
     14The following packages conflict with the build of foobar:
     15  (1) boofar @0.0.1 +xzy
     16  (2) barfoo @0.0.2 +xzy
     17  (3) foba @0.1
     18Do you wish to deactivate all of them and reactivate after the install?
     19Press (1) to continue and (0) to abort: 1
     20---> Deactivating build conflicts
     21The following dependencies of foobar will be installed:
     22  (1) boofar @0.0.1 +xzy
     23  (2) barfoo @0.0.2 +xzy
     24  (3) foba @0.1
     25Press (1) to continue and (0) to abort: 1
     26---> Installing boofar @0.0.1 +xzy
     27---> Installing barfoo @0.0.2 +xzy
     28---> Installing foba @0.1
     29---> Installing foobar
     30——-> Reactivating build conflict packages
     31$>
     32}}}
     33
     34
     35=== File conflicts on Activation ===
     36Desc: When a port is installed/activated, if the files written by the port already exist ask the user for permission before overwriting.
     37
     38Message: A frightful message making it clear that the correct response is usually ‘no’. The name of the file being overwritten.
     39
     40Question type: A yes/no or continue/abort question is an interaction that makes sense here. This question will be triggered whenever the activation process hits a conflicting file, so a yestoall option might also be desirable.  It is also to be kept in mind that files overwritten only affect the port being activated.
     41
     42Example-
     43{{{
     44$> port activate foobar
     45The file foo.con already exists.
     46Warning: Overwriting of files is not recommended. It may lead to errors.
     47Do you wish to overwrite foo.con?
     48Press (1) to continue and (0) to abort: 1
     49---> Overwriting foo.con
     50——-> foobar activated
     51$>
     52}}}
     53
     54
     55=== Apt-get like behaviour ===
     56Desc: When installing a port, list all the dependencies and ask the user for confirmation just like apt-get does.
     57
     58Message: A list of all the dependencies.
     59
     60Question type: A continue/abort question to give the options of continuing with the installation or aborting it. This could even use a 10s timeout, giving an option to abort during the timeout and continuing automatically after the time is out.
     61
     62Example-
     63{{{
     64$> port install foobar
     65The following dependencies of foobar will be installed:
     66  (1) boofar @0.0.1 +xzy
     67  (2) barfoo @0.0.2 +xzy
     68  (3) foba @0.1
     69Press (1) to continue and (0) to abort: 1
     70---> Installing boofar @0.0.1 +xzy
     71---> Installing barfoo @0.0.2 +xzy
     72---> Installing foba @0.1
     73---> Installing foobar
     74$>
     75}}}
     76
     77=== Dependents getting broken ===
     78Desc: When uninstalling a port, if ports that depend on it are getting broken
     79ask the user for confirmation.
     80
     81Message: A warning message making it clear that some other ports are getting broken. A list of all those ports will be displayed.
     82
     83Question type: A continue/abort question is right for such a case.
     84
     85Example-
     86{{{
     87$> port uninstall foobar
     88The following dependents of foobar will be broken:
     89  (1) boofar @0.0.1 +xzy
     90  (2) barfoo @0.0.2 +xzy
     91  (3) foba @0.1
     92Press (1) to continue and (0) to abort: 1
     93---> Unstalling foobar
     94$>
     95}}}
     96
     97=== Variant specific dependency ===
     98Desc: When installing a port that requires a dependency to have a certain variant, but this variant is not set. Ask the user if it should reinstall the dependency with that variant.
     99
     100Message: A warning message explaining that reinstalling with a specific variant could break any already-installed dependents that relied on the previously-selected variants.
     101
     102Question type: A continue/abort question is suitable here. The correct variant will be selected and installed automatically so no need to provide options.
     103
     104Example-
     105{{{
     106$> port install foobar
     107The package foobar requires barfoo @1.0.1.
     108Currently set version of barfoo: barfoo @0.0.1
     109Warning: Reinstalling with a specific variant could break any already-installed dependents that relied on the previously-selected variants.
     110Do you wish to install barfoo @1.0.1?
     111Press (1) to continue and (0) to abort: 1
     112---> Installing barfoo @1.0.1 +xzy
     113——-> Installing foobar
     114$>
     115}}}
     116
     117=== Ambiguous activate ===
     118Desc: When port activate command is run ambiguously, give a list of ports to the user to choose from.
     119
     120Message: A list of all the port versions/variants of the port name given.
     121
     122Question type: A single choice question having multiple options is what is required in this case. The user is asked to choose one of the options.
     123
     124Example-
     125{{{
     126$> port activate foobar
     127The following variants of foobar exist:
     128  (1) foobar @0.0.1 +xzy
     129  (2) barfoo @0.0.2 +xzy
     130  (3) foba @0.1
     131Type a number to select the variant to activate: 2
     132---> barfoo @0.0.2 +xzy activated.
     133$>
     134}}}
     135
     136=== Rebuilding in rev-upgrade ===
     137Desc: Before rebuilding any port in rev-upgrade the user will be asked for confirmation.
     138
     139Message: The port name that will be rebuilt along with some detail(not sure) about the linking errors.
     140
     141Question type: A yes/no question seems to handle the situation well but if many ports have to be rebuilt a yestoall option also makes sense. A yestoall option can be implemented as a separate flag for rev-upgrade(may be).
     142
     143Example-
     144{{{
     145$> port rev-upgrade
     146The package foobar @0.0.1 was found broken. Do you wish to rebuild it?
     147Press (1) to continue and (0) to abort: 1
     148---> Rebuilding foobar @0.0.1 +xzy
     149The package barfoo @0.0.2 was found broken. Do you wish to rebuild it?
     150Press (1) to continue and (0) to abort: 1
     151---> Rebuilding barfoo @0.0.2 +xzy
     152$>
     153}}}
     154
     155=== Uninstall using -—follow-dependencies ===
     156Desc: When a user uninstalls using the flag —-follow-dependencies, ask for confirmation.
     157
     158Message: A list of all the dependencies that will be uninstalled will be displayed.
     159
     160Question type: A continue/abort ie. yes/no question makes sense here. The user will confirm the uninstall action or have a chance of aborting. A timeout can be used here too but it will not be very practical.
     161
     162Example-
     163{{{
     164$> port uninstall —follow-dependencies foobar
     165The following packages will be uninstalled:
     166  (1) foobar @0.0.1 +xzy
     167  (2) barfoo @0.0.2 +xzy
     168  (3) foba @0.1
     169Press (1) to continue and (0) to abort: 1
     170---> Uninstalling foobar @0.0.1 +xzy
     171---> Uninstalling barfoo @0.0.2 +xzy
     172——-> Uninstalling foba @0.1
     173$>
     174}}}
     175
     176=== Ambiguous uninstall ===
     177Desc: When uninstalling a port if the user supplies an ambiguous name, list all the variants and ask to select the ones that should be uninstalled.
     178
     179Message: A list of all variants related to the ambiguous name provided.
     180
     181Question type: A multiple choice question is what is required in this case. The user will be able to select the ones they want to uninstall. The selected options may be highlighted. Then pressing enter proceeds with the uninstall.
     182
     183Example-
     184{{{
     185$> port uninstall foobar
     186"foobar" is ambiguous. Which of the following ports do you want to uninstall?
     187  (1) foobar @0.0.1 +xzy
     188  (2) foobar @0.0.2 +xzy
     189  (3) foobar @0.0.3
     190 Type a number to select a port to uninstall or press enter to uninstall the ports currently selected: 1
     191 Selecting foobar @0.0.1 +xzy.
     192 *(1) foobar @0.0.1 +xzy
     193  (2) foobar @0.0.2 +xzy
     194  (3) foobar @0.0.3
     195 Type a number to select a port to uninstall or press enter to uninstall the ports currently selected: 3
     196 Selecting foobar @0.0.3.
     197 *(1) foobar @0.0.1 +xzy
     198  (2) foobar @0.0.2 +xzy
     199 *(3) foobar @0.0.3
     200 Type a number to select a port to uninstall or press enter to uninstall the ports currently selected:
     201---> Uninstalling foobar @0.0.1 +xzy
     202---> Uninstalling foobar @0.0.3
     203$>
     204}}}
     205
     206=== Choose variants interactively ===
     207Desc: When installing a port the user can be given a list of all the variants of the port they wish to install and they can select them interactively.
     208
     209Message: A list of all the variants to choose from.
     210
     211Question type: A multiple choice question where the user can select the options they want. Then pressing enter proceeds with the install.   
     212
     213Example-
     214{{{
     215$> port install foobar
     216"foobar" has many variants. Which of the following variants do you want to install?
     217  (1) foobar @0.0.1 +xzy
     218  (2) foobar @0.0.2 +xzy
     219  (3) foobar @0.0.3
     220 Type a number to select a variant to install or press enter to install the variants currently selected: 1
     221 Selecting foobar @0.0.1 +xzy.
     222 *(1) foobar @0.0.1 +xzy
     223  (2) foobar @0.0.2 +xzy
     224  (3) foobar @0.0.3
     225 Type a number to select a variant to install or press enter to install the variants currently selected:
     226---> Installing foobar @0.0.1 +xzy
     227$>
     228}}}
     229
     230= Implementation Details =
     231
     232=== ui_* calls ===
     233ui_yesorno: deals with all the continue/abort type questions
     234
     235ui_onechoice: deals with all the single choice selection questions
     236
     237ui_manychoice: deals with questions that offer many more than one selections
     238
     239ui_timeout: deals with questions that may have better functionality with timeouts
     240
     241=== Parameters ===
     242qid: This parameter is most important as it will enable the port client to identify the question and print the correct interactivity case.
     243(Incomplete)