README

NAME

Sys::OsRelease - Read OS info from system os-release file

SYNOPSIS

use Sys::OsRelease;

my %osinfo = os-release;

DESCRIPTION

Sys::OsRelease is a module that provides the os-release function, which reads your system's os-release file and returns a hash of the data found in the file.

The os-release file is a text file found on many modern *NIX systems that conveniently details operating system identification data, such as the OS name and version. More information can be found in the official standard by freedesktop.org.

By default, os-release will try to locate and read one of the following files in descending order of priority:

/etc/os-release
/usr/lib/os-release

os-release's signature:

Str  :$path = get_os-release_path(),
Bool :$defaults = False,
Bool :$strict = True,
Bool :$standard-only = True,
--> Hash
  • path

    Path to the os-release file.

    By default, searches for os-release file in the standard locations which were mentioned above.

  • defaults

    Initialize hash with default values, which are the following:

    NAME         => "Linux",
    ID           => "linux",
    PRETTY_NAME  => "Linux",
    SYSEXT_SCOPE => "system portable",

    Defaults to False.

  • strict

    Toggle strict file reading. When True, os-release will do basic sanity checks on read data and die on invalid lines. When False, os-release will just ignore invalid lines and odd data.

    Defaults to True.

  • standard-only

    Determines whether os-release should ignore non-standard parameters (those not listed in the official freedesktop.org standard).

    Defaults to True.

AUTHOR

Written by Samuel Young, [email protected].

COPYRIGHT

Copyright 2024, Samuel Young

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.

SEE ALSO

os-release

Sys::OsRelease v0.0.2

Read OS info from system os-release file

Authors

  • Samuel Young

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • Sys::OsRelease

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.