osquery-1/tools/get_platform.py

204 lines
6.3 KiB
Python
Raw Normal View History

Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
#!/usr/bin/env python
# Copyright (c) 2014-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
import os
import re
import sys
import argparse
import platform
import subprocess
ORACLE_RELEASE = "/etc/oracle-release"
SYSTEM_RELEASE = "/etc/system-release"
LSB_RELEASE = "/etc/lsb-release"
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
DEBIAN_VERSION = "/etc/debian_version"
GENTOO_RELEASE = "/etc/gentoo-release"
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
def _platform():
osType, _, _, _, _, _ = platform.uname()
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
if osType == "Windows":
return ("windows", "windows")
elif osType == "Linux":
if os.path.exists(ORACLE_RELEASE):
return ("redhat", "oracle")
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
if os.path.exists(SYSTEM_RELEASE):
with open(SYSTEM_RELEASE, "r") as fd:
fileContents = fd.read()
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
if fileContents.find("CentOS") != -1:
return ("redhat", "centos")
if fileContents.find("Scientific Linux") != -1:
return ("redhat", "scientific")
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
if fileContents.find("Red Hat Enterprise") != -1:
return ("redhat", "rhel")
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
if fileContents.find("Amazon Linux") != -1:
return ("redhat", "amazon")
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
if fileContents.find("Fedora") != -1:
return ("redhat", "fedora")
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
if os.path.exists(LSB_RELEASE):
with open(LSB_RELEASE, "r") as fd:
fileContents = fd.read()
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
if fileContents.find("DISTRIB_ID=Ubuntu") != -1:
return ("debian", "ubuntu")
if fileContents.find("DISTRIB_ID=Arch") != -1:
return ("arch", "arch")
if fileContents.find("DISTRIB_ID=ManjaroLinux") != -1:
return ("arch", "manjaro")
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
if os.path.exists(DEBIAN_VERSION):
return ("debian", "debian")
if os.path.exists(GENTOO_RELEASE):
return ("gentoo", "gentoo")
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
else:
return (None, osType.lower())
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
def _distro(osType):
def getRedhatDistroVersion(pattern):
with open(SYSTEM_RELEASE, "r") as fd:
contents = fd.read()
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
result = re.findall(pattern, contents)
if result and len(result) == 1:
return result[0].replace("release ", osType)
return None
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
def commandOutput(cmd):
try:
output = subprocess.check_output(cmd)
return output
except subprocess.CalledProcessError:
return None
except OSError:
return None
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
except WindowsError:
return None
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
_, _, osVersion, _, _, _ = platform.uname()
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
if osType == "oracle":
result = getRedhatDistroVersion(r'release [5-7]')
if result is not None:
return result
elif osType in ["centos", "scientific", "rhel"]:
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
result = getRedhatDistroVersion(r'release [6-7]')
if result is not None:
return result
elif osType == "amazon":
result = getRedhatDistroVersion(r'release 20[12][0-9]\.[0-9][0-9]')
if result is not None:
return result
elif osType == "ubuntu":
with open(LSB_RELEASE, "r") as fd:
contents = fd.read()
results = re.findall(r'DISTRIB_CODENAME=(.*)', contents)
if len(results) == 1:
return results[0]
elif osType == "darwin":
rawResult = commandOutput(["sw_vers", "-productVersion"])
if rawResult is not None:
results = re.findall(r'[0-9]+\.[0-9]+', rawResult)
if len(results) == 1:
return results[0]
elif osType == "fedora":
with open(SYSTEM_RELEASE, "r") as fd:
contents = fd.read()
results = contents.split()
if len(results) > 2:
return results[2]
elif osType == "arch":
with open("/etc/arch-release", "r") as fd:
contents = fd.read()
results = contents.split()
if len(results) > 2:
return results[2]
elif osType == "manjaro":
with open(LSB_RELEASE, "r") as fd:
contents = fd.read()
results = re.findall(r'DISTRIB_CODENAME=(.*)', contents)
if len(results) == 1:
return results[0]
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
elif osType == "debian":
result = commandOutput(["lsb_release", "-cs"])
if result is not None:
return result
elif osType == "freebsd":
rawResult = commandOutput(["uname", "-r"])
results = rawResult.split("-")
if len(results) > 0:
return results[0]
elif osType == "gentoo":
with open(GENTOO_RELEASE, "r") as fd:
contents = fd.read()
results = contents.split()
if len(results) > 0:
return results[len(results) -1]
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
elif osType == "windows":
return "windows%s" % osVersion
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
return "unknown_version"
def platformAction():
family, osType = _platform()
print(osType)
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
def distroAction():
family, osType = _platform()
print(_distro(osType))
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
def familyAction():
family, osType = _platform()
if family:
print(family)
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
def defaultAction():
family, osType = _platform()
distro = _distro(osType)
print("%s;%s" % (osType, distro))
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Platform detection script for osquery")
parser.add_argument("--platform", action="store_true", help="Outputs the detected platform")
parser.add_argument("--distro", action="store_true", help="Outputs the detected distribution")
parser.add_argument("--family", action="store_true", help="Outputs the detected family")
args = parser.parse_args()
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
if args.platform and \
not args.distro and \
not args.family:
platformAction()
elif not args.platform and \
args.distro and \
not args.family:
distroAction()
elif not args.platform and \
not args.distro and \
args.family:
familyAction()
else:
defaultAction()
Initial support for building on Windows (#2015) * Committing changes related to our experimentation with a "pure" Win64 build * Placates CMake such that a Visual Studio 14 x64 solution is generated! * Updated changes to fix the issue of GFlags not being found. * Added cases to handle Win64 specific CMake options such as include/link directories and compiler options * Comment change in CMakeList.txt * Changed wording of get_platform error message. Adding Powershell provisioning script. * Finalized provision powershell script * Added a deployment XML file for insuring C++ support exists for VS2015 * Added admin check and resolved some potential PATH issues. * Fixed some potential bugs in VS2015 automated install * Adding a wrapper for provision.ps1 so people don't need to know obscure powershell syntax * Fixing a bug with third-party archive extraction * Ignoring the updating of pip for now... * Fix invocation of choco.exe * Resolved pip install issues * Removed some debugging residue * Changing get_platform.py from tabs to spaces * Added distro detection for ubuntu and darwin * Using 4 spaces * Added a newline after powershell invocation * Added OS detection for freebsd and fedora * Fixed bug with freebsd * Adding arguments parsing to prepare for modularizing platform detection * Removing bash platform detection logic and forwarding the task to get_platform.py * Removing get_platform support in provision.sh since it doesn't appear to be used anywhere now * Fixed some comment/spacing issues. Made a few efficiency changes * A few bug fixes, revereted back to WIN32 variable for now * Added Facebook copyright information. * Fixed boost and rocksdb library paths * Added support for installing our custom chocolatey packages * Fixed path to ignore the symlink * Force environment variable propagation * Forgot to add new line after make-win64-dev-env.bat * Added error handling for choco install failures * Handles download and python/pip errors * When chocolatey is not detected, refreshenv.bat is not found in the PATH. Hardcode the PATH as per chocolatey install instructions * Takes care of updating git submodules in third-party\ * Fixes a bug in which Linux provisioning fails because of unset FAMILY env var.
2016-04-15 21:01:16 +00:00
sys.exit(0)