New opsi-script with local functions

Antworten
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3319
Registriert: 04 Jun 2008, 14:27

New opsi-script with local functions

Beitrag von d.oertel »

Dear opsi-users,

Normally we do not comment any publication in the experimental branch.
In this case we want to introduce to you the new features of the opsi-script (winst) 4.12.0
before every thing is fixed and can't be changed any more.
This would be the case if we publish it as testing.

The hereby published packages are stable and may be used productive (we do not know any new problems).
The experimental part are the new functions.

The focus of this new release is the introduction of defined local functions:
(This is a concept that is normally well known to all programmers,
but may irritate people that see something like that the first time).
-----------------------
There are a lot possibilities to structure opsi-script code:

* `sub` Sections
* `sub` Sections in external files
* 'include' Statements

But all these possibilities are not functional to create reusable external code
that can be exchanged between scripts or opsi administrators without problems.
The reason is, that this code is not encapsulated and use global variables.
The defined local functions presented here now solves this problem.
With this concept it is possible to write functions that can be collected and maintained in external libraries.
In consequence we will start to build up a central opsi-script library which is maintained by uib and the opsi community.

In order to reach this target we have implemented the following concepts:

* Functions with return value
* Freely definable function call parameters
* Local Variables
* Nested functions
* Recursive calls
* Primary and secondary sections within functions
------------------

More details you will find at the opsi-script 4.12 release notes and at the opsi-script-manual:
http://download.uib.de/opsi4.0/experime ... tes-en.pdf
http://download.uib.de/opsi4.0/experime ... ual-en.pdf
http://download.uib.de/opsi4.0/experime ... ard-en.pdf

Published packages:
opsi-script for Windows (winst):
http://download.uib.de/opsi4.0/experime ... 0.0-1.opsi
opsi-script-test: Test and Examples (for Windows and Linux):
http://download.uib.de/opsi4.0/experime ... 0.0-1.opsi
opsi-script within the opsi-linux-client-agent:
http://download.uib.de/opsi4.0/experime ... .11-1.opsi


Any feedback is welcome.

Kind regards,

detlef oertel
opsi support - uib gmbh

For productive opsi installations we recommend support contracts.
http://www.uib.de
http://www.opsi.org
Antworten