Sys-OsRelease
view release on metacpan or search on metacpan
The first time it's called, it instantiates it.
On following calls, it returns a reference to the singleton instance.
This module maintains minimal prerequisites, and only those which are usually included with Perl.
(Suggestions of new features and code will largely depend on following this rule.)
That is intended to be acceptable for establishing system or container environments which contain Perl programs.
It can also be used for installing or configuring software that needs to know about the system environment.
### The os-release Standard
FreeDesktop.Org's os-release standard is at [https://www.freedesktop.org/software/systemd/man/os-release.html](https://www.freedesktop.org/software/systemd/man/os-release.html).
Current attributes recognized by Sys::OsRelease are:
NAME ID ID\_LIKE PRETTY\_NAME CPE\_NAME VARIANT VARIANT\_ID VERSION VERSION\_ID VERSION\_CODENAME BUILD\_ID IMAGE\_ID
IMAGE\_VERSION HOME\_URL DOCUMENTATION\_URL SUPPORT\_URL BUG\_REPORT\_URL PRIVACY\_POLICY\_URL LOGO ANSI\_COLOR
DEFAULT\_HOSTNAME SYSEXT\_LEVEL
If other attributes are found in the os-release file, they will be honored.
Folded to lower case, the attribute names are used as keys in an internal hash structure.
## METHODS
removes the singleton instance of the class if it was defined.
Under normal circumstances it is not necessary to call this since the class destructor will call it automatically.
It is currently only used for testing, where it is necessary to clear the instance before loading a new one with
different parameters.
Since this class is based on the singleton model, there is only one instance.
The instance(), new() and init() methods will only initialize the instance if it is not already initialized.
## SEE ALSO
FreeDesktop.Org's os-release standard: [https://www.freedesktop.org/software/systemd/man/os-release.html](https://www.freedesktop.org/software/systemd/man/os-release.html)
GitHub repository for Sys::OsRelease: [https://github.com/ikluft/Sys-OsRelease](https://github.com/ikluft/Sys-OsRelease)
## BUGS AND LIMITATIONS
Please report bugs via GitHub at [https://github.com/ikluft/Sys-OsRelease/issues](https://github.com/ikluft/Sys-OsRelease/issues)
Patches and enhancements may be submitted via a pull request at [https://github.com/ikluft/Sys-OsRelease/pulls](https://github.com/ikluft/Sys-OsRelease/pulls)
## LICENSE INFORMATION
lib/Sys/OsRelease.pm view on Meta::CPAN
The first time it's called, it instantiates it.
On following calls, it returns a reference to the singleton instance.
This module maintains minimal prerequisites, and only those which are usually included with Perl.
(Suggestions of new features and code will have to follow this rule.)
That is intended to be acceptable for establishing system or container environments which contain Perl programs.
It can also be used for installing or configuring software that needs to know about the system environment.
=head2 The os-release Standard
FreeDesktop.Org's os-release standard is at L<https://www.freedesktop.org/software/systemd/man/os-release.html>.
Current attributes recognized by Sys::OsRelease are:
NAME ID ID_LIKE PRETTY_NAME CPE_NAME VARIANT VARIANT_ID VERSION VERSION_ID VERSION_CODENAME BUILD_ID IMAGE_ID
IMAGE_VERSION HOME_URL DOCUMENTATION_URL SUPPORT_URL BUG_REPORT_URL PRIVACY_POLICY_URL LOGO ANSI_COLOR
DEFAULT_HOSTNAME SYSEXT_LEVEL
If other attributes are found in the os-release file, they will be accepted.
Folded to lower case, the attribute names are used as keys in an internal hash structure.
=head1 METHODS
lib/Sys/OsRelease.pm view on Meta::CPAN
=item config(name, [value])
is a read/write accessor for the configuration setting named by the string parameter "name".
If no value parameter is provided, it returns the value of the parameter, or undef if it doesn't exist.
If a value parameter is provided, it assigns that to the configuration setting and returns the same value.
=back
=head1 SEE ALSO
FreeDesktop.Org's os-release standard: L<https://www.freedesktop.org/software/systemd/man/os-release.html>
GitHub repository for Sys::OsRelease: L<https://github.com/ikluft/Sys-OsRelease>
Related modules:
=over 1
=item L<Sys::OsPackage>
installs Perl modules, for example as dependencies of a script, via OS packages if available or otherwise via CPAN -
( run in 0.522 second using v1.01-cache-2.11-cpan-299005ec8e3 )