Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement OperatingSystem #51

Closed
zwetan opened this issue Jan 1, 2016 · 4 comments
Closed

implement OperatingSystem #51

zwetan opened this issue Jan 1, 2016 · 4 comments

Comments

@zwetan
Copy link
Member

zwetan commented Jan 1, 2016

when we updated from redtamarin 0.3.2 to 0.4
OperatingSystem got very summarily implemented
we need to upgrade it

@zwetan
Copy link
Member Author

zwetan commented Jan 4, 2016

clarification

see Implementation Of OperatingSystem - Advanced

we want to be able to know everything about the OS

if( OperatingSystem.vendor == "Linux" )
{
    if( OperatingSystem.vendorName == "Ubuntu" )
    {
          var version:String = OperatingSystem.vendorVersion;
          if( version.indexOf( "12.04" ) > 0 ||
              version.indexOf( "14.04" ) > 0 ||
              version.indexOf( "16.04" ) > 0 )
          {
                  trace( "is LTS - Long Term Support" );
          }
    }
}

see the different description and example of name, version, vendor, vendorName, vendorVersion, etc.

@zwetan
Copy link
Member Author

zwetan commented Jan 4, 2016

before we implemented uname() as a native function
but for a quick "hack" we will use basic file or command line parsing
to detect the OS version, name, etc.

@zwetan
Copy link
Member Author

zwetan commented Jan 8, 2016

for now we re-implemented all that we needed using basic parsing

  • command line ver for Windows
  • file /System/Library/CoreServices/SystemVersion.plist for Mac OS X
  • release file, for ex /etc/lsb-release for Linux Ubuntu

It is good enough for now, because we have the "luxury"
of being able to access Runtime.platform we don't really need uname().

At a later time we will implement uname() to get more details
like the kernel name, kernel release and kernel version.

@zwetan
Copy link
Member Author

zwetan commented Jan 8, 2016

also at a later time it would be nice to be able to load a cached version of the OS detection

for example, the first time the detection occurs we could
cache a file in /home/username/.redtamarin/os

os

_macintoshName = "Mac OS X 10.10";
_macintoshVersion = "10.10";
_macintoshProductName = "Mac OS X";
_macintoshProductBuildVersion = "14F27";
_macintoshProductVersion = "10.10.5";
_macintoshProductUserVisibleVersion = "10.10.5";
_macintoshProductDescription = "Apple Mac OS X 10.10.5";
_macintoshLongDescription = "Apple Mac OS X 10.10.5 (Yosemite build 14F27)";
_macintoshCodename = "Yosemite";

so next item a detection need to happen we could simply load the data from cache
to avoid parsing files and other logics and make it faster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant