This adds a draft of a library shell script which can be sourced to
utilise all functions. Can be extended with various checks, which are
not implemented yet.
Original, it was done so there is a file in the global library
directory that no errors occur. This should fix the unit tests.
The code-remote script can now access the library files, too. It gets
the same environment variables `$__library` (global library) and
`$__type_library` (type specific library) like the type explorers.
The library files are copied to the remote host if this is not already
done for the type explorers. The method for this was moved to the cdist
type class to gain better generalisation and accessability for both
parties.
The library is now copied to the remote side if any explorer will
executed. This allows to share code across multiple explorers.
While the library code is quite different for different use cases (e.g.
manifest, gencode, remote side), everything get copied. This may be a
waste and could be categorized better. It would result in only copy the
general and required folder to the remote.
Threads the `conf/library` folder as a further configuration folder and exports
it via the `$__library` environment varibale to the manifest and gencode-* scripts.
With it, shell scripts can be sourced as library. For types, `$__type/library`
must be used instead to reach these scripts.
Fix broken --option parameter in __postfix_master type
See merge request ungleich-public/cdist!905
(cherry picked from commit 2f433a1458f3a1f7f8859e9ae165178a0ec5b7a0)
9496b234 The option parameter is actually multi-valued
4009bbd7 Protect postfix variables in options
Solaris 11 has GNU stat (handled by *)
Solaris 10 (and older?) does not have stat (handled by failing command -v stat)
On Solaris 10 (at least on UFS), setgid cannot be set on directories.
Unlike on other systems `chmod 2400` is not `-r----S---`, but `-r----l---`.
noclobber is potentially unsafe, because it relies on the underlying shell to
implement noclobber in a safe way that avoids race conditions between multiple
processes.
mkdir is safer because it is mandated by POSIX to "fail" if the target already
exists.
Instead, rely on `nonparallel`.
In any case cdist should never run explorer and code concurrently even if the
dependency graph would allow to do so as it would result in many more
synchronization issues than this one.