Gua-tk/Linux-Auto-Customizer

`customizer.sh` endpoint capabilities

Opened this issue · 1 comments

Capabilities

  • We will be using the flags of the customizer core to keep the state of the flags that we want to pass to each call.
  • Move wrappers to the endpoint.
  • The endpoint recognizes and uses the same args and flags as the installers, so a -v at customizer endpoint level will be passed to each call of the backend.

customizer.sh modes

  • install
  • uninstall
  • parallel
  • status
  • update: git fetch
  • upgrade: git pull

Argument specification.

Main
  Import functions common () 
  Locate install uninstall scripts()

  Process initial args and set flags()
  Choose algorithm based on initial args()
  
  Init call strings depending on algortihm()
  Process rest of args()

  String callString = Process call()
  Exec $callString 

Args:

They choose the general behaviour of how the arguments will be translated to calls to the backend scripts of the customizer.sh endpoint.

  • --sudo, --user, --deduce-privileges
    By default uses --deduce-privileges, which makes the call to backend customizer with sudo only if required.
    If --user then all calls will be non privileged. Otherwise with --sudo.

  • --maximize-calls, --optimize-calls, --minimize-calls
    By default uses --optimize-calls, which appends to the current string call if the mode has not changed. If the mode changes then the call of the current mode finishes and the string is appended to the final call string. This mode respects strictly the order of the installations.
    --maximize-calls appends the current call string to the final call string every time a feature is processed in the arguments. This mode respects strictly the order of the installations.
    --minimize-calls uses at maximum four calls, one for each mode if needed. The order will be starting with sudo uninstall, followed by sudo install and then uninstall and install.

  • --foreground, --background
    By default --foreground, which executes the final call while trapping your prompt
    --background Adds a & to the final call in order to make it in the background and get the prompt as soon as the final call is issued.

  • --sequential, --safe-sequential, --parallel=bash, --parallel=gnome-terminal, --parallel=gnu,
    By default --safe-sequential which appends the calls using &&
    --sequential uses ; to append the calls to each other
    --parallel=bash appends the call using &, so each call is made parallel in the same terminal.
    --parallel=gnome-terminal appends the call as argument to a call to gnome-terminal in background
    --parallel=gnu uses gnu parallel to run each call as a call to be done by parallel.

  • --handle-dependencies, --ignore-dependencies
    By default --handle-dependencies, which applies only when installing obligated user features that have root dependencies. In those cases, if any of the dependencies is not present, the call will be converted to a sudo call with the --dependencies (to be implemented) argument to install the dependencies only, and the subsequent user call to install the feature.
    --ignore-dependencies treats each feature as is

https://stackoverflow.com/questions/8861673/run-a-command-without-privileges-in-a-root-shell

This can be used to control the customizer with and without privileges