Sys-OsRelease

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

 - MAJOR
 - MINOR
 - bump minimum Perl version from 5.6 (2000) to 5.10 (2007) to use the
   version module
 * REVISION
   - add test data for Kali Linux
   - update Dist::Zilla config to remove git-related metadata conflict
     (forwarded from WebFetch)
   - catch up with attributes added to os-release standard since 2022 (from
     systemd 231 to 260)
   - enumerate documentation of auto-generated methods from Freedesktop
     standard

 * SECURITY

0.3.0 2022-05-15T21:58:03-07:00 America/Los_Angeles
 [DOCS]
 - document auto-generated accessor methods for standard attributes
 - reorganize POD docs to separate methods into subsections for class,
   auto-generated and instance methods
 - remove NAME section from source POD. I didn't notice until now that

README.md  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 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

README.md  view on Meta::CPAN

    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

For convenience, I<Sys::OsRelease> generates read-only accessor methods for each of the standard 
attribute names, converted to lower case. For example, from the list above they are I<name()>, I<id()>,
I<id_like()>, etc. The auto-generated methods do not require any parameters, and ignore any if provided.

Accessor methods are not generated for non-standard atttributes because it would be unreliable to try to
call methods named for transient data that may or may not exist on a given platform, and for the possibility
they could conflict with existing functions in the I<Sys::OsRelease> namespace.  Use the I<found_attrs()>,
I<has_attr()> and I<get()> methods to detect and access non-standard attributes.

The current full list is at the os-release standard
L<https://www.freedesktop.org/software/systemd/man/latest/os-release.html>
which includes descriptions of each attribute.

=over 1

=item name()

=item id()

=item id_like()

lib/Sys/OsRelease.pm  view on Meta::CPAN

=item confext_scope()

=item portable_prefixes()

=item portable_scope()

=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 1.826 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )