Calculate Forum

Working on Calculate Utilities 3.1

OK, we’ve just released Calculate Linux 12.0, but no use to rest on our laurels :slight_smile: It’s time to take up new tasks, and working on better handling of variables is one of such… You must be aware that the CL Utilities use internal variables. These are set depending on the options that are passed to them, the system settings, the hardware components, etc. Calculate Utilities 3.0 do not show variables, and this has to be changed.

Introducing GUI tools always make one change the strategy. With Calculate Utilities 2.2, variables were edited using the --set parameter in conjunction with the command, but no way to do the same in a graphical interface. We simply need Calculate Utilities 3.1.

cl-core modifies values by saving changes to /etc/calculate/calculate3.env. It works on the client’s side, that’s why we implemented this debug feature, but the approach itself seems quite handy for modifying variable values as well! For cl-core, methods are specified as method.variable, which was also something that made us think about it.

In Calculate Utilities 2.0, the calculate package was replaced by several accessory packages. Each of them had its set of variables and so to say obeyed its own rules. Since v2.2, all templates have been stored in one directory, /templates. It contains a templates tree, based on the package names. But if we can address any Utilities variables at once, why not remodel this structure, now proceeding from events and not methods?.. (Please have a look here if you want to learn more on CU events).

Why not do it earlier?

Like I was saying, the Utilities make several packages. Some of them, such as calculate-assemble, are not part of any CL edition; some others could be removed later… And addressing any remote package variable results in failure. We’re changing the whole logic of our templates to play around these restrictions.

What will be the outcome?

# First of all, these changes will result in faster handling of templates, as they will not be overlaid separately for calculate-desktop and calculate-client when rewriting system files.
# Clt templates will gain in functionality: you’ll be able to address any variable (only calculate-install variables could be addressed so far).
# The new templates tree is more logical and intuitive: events, not packages are now the hinge.

As we didn’t want to rewrite our templates adding a method to each variable, specifying methods will be supported not from variables only, but from header files or directories as well, with the module option. For instance, all you have to do for all files in the directory to use calculate-install variables by default is specify ‘module=install’.

The new templates will not be supported by Calculate Utilities 3.0, so we decided to move on to version 3.1.

And the last but not the least: you will be able to modify variable values from the console and from the GUI. In the latter case, it will look somewhat like editing options in Firefox, when you enter ‘about:config’ in the address line. The new values will be saved and used whenever you restart the Utilities.

How can I get to know what you’re doing, exactly? (signed Doubting Thomas)

You’d better see by yourself. If curious, update the overlay and cd to the templates directory:

cd /var/lib/layman/calculate/profiles/templates/
ls -l

Those are the current templates, v.3.0. To have a look at the new template set, change the directory to ‘3.1’:

cd 3.1
ls -l
Mastodon Mastodon