From 5c8120b783a4b5f18897e38714cbfe4b894ba0a8 Mon Sep 17 00:00:00 2001 From: Zachary Eisinger Date: Wed, 18 Dec 2019 14:00:51 -0800 Subject: [PATCH] Remove unused external scripts --- externals/get-os-distro.sh | 192 ---------------------------------- externals/get-os-platform.ps1 | 18 ---- 2 files changed, 210 deletions(-) delete mode 100755 externals/get-os-distro.sh delete mode 100644 externals/get-os-platform.ps1 diff --git a/externals/get-os-distro.sh b/externals/get-os-distro.sh deleted file mode 100755 index 4bc5c45..0000000 --- a/externals/get-os-distro.sh +++ /dev/null @@ -1,192 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) .NET Foundation and contributors. All rights reserved. -# Licensed under the MIT license. See LICENSE file in the project root for full license information. -# - -# Stop script on NZEC -set -e -# Stop script if unbound variable found (use ${var:-} if intentional) -set -u -# By default cmd1 | cmd2 returns exit code of cmd2 regardless of cmd1 success -# This is causing it to fail -set -o pipefail - -# Use in the the functions: eval $invocation -invocation='say_verbose "Calling: ${yellow:-}${FUNCNAME[0]} ${green:-}$*${normal:-}"' - -# standard output may be used as a return value in the functions -# we need a way to write text on the screen in the functions so that -# it won't interfere with the return value. -# Exposing stream 3 as a pipe to standard output of the script itself -exec 3>&1 - -say_err() { - printf "%b\n" "get-os-distro: Error: $1" >&2 -} - -# This platform list is finite - if the SDK/Runtime has supported Linux distribution-specific assets, -# then and only then should the Linux distribution appear in this list. -# Adding a Linux distribution to this list does not imply distribution-specific support. -get_legacy_os_name_from_platform() { - - platform="$1" - case "$platform" in - "centos.7") - echo "centos" - return 0 - ;; - "debian.8") - echo "debian" - return 0 - ;; - "fedora.23") - echo "fedora.23" - return 0 - ;; - "fedora.27") - echo "fedora.27" - return 0 - ;; - "fedora.24") - echo "fedora.24" - return 0 - ;; - "opensuse.13.2") - echo "opensuse.13.2" - return 0 - ;; - "opensuse.42.1") - echo "opensuse.42.1" - return 0 - ;; - "opensuse.42.3") - echo "opensuse.42.3" - return 0 - ;; - "rhel.7"*) - echo "rhel" - return 0 - ;; - "ubuntu.14.04") - echo "ubuntu" - return 0 - ;; - "ubuntu.16.04") - echo "ubuntu.16.04" - return 0 - ;; - "ubuntu.16.10") - echo "ubuntu.16.10" - return 0 - ;; - "ubuntu.18.04") - echo "ubuntu.18.04" - return 0 - ;; - "alpine.3.4.3") - echo "alpine" - return 0 - ;; - esac - return 1 -} - -get_linux_platform_name() { - - if [ -e /etc/os-release ]; then - . /etc/os-release - echo "$ID.$VERSION_ID" - return 0 - elif [ -e /etc/redhat-release ]; then - local redhatRelease=$( /dev/null; then - CPUName=$(uname -m) - case $CPUName in - armv7l) - echo "arm" - return 0 - ;; - aarch64) - echo "arm64" - return 0 - ;; - esac - fi - - # Always default to 'x64' - echo "x64" - return 0 -} - -osName=$(get_current_os_name || echo "") -legacyOsName=$(get_legacy_os_name || echo "") -arch=$(get_machine_architecture || echo "") - -primaryName="$osName-$arch" -legacyName="$legacyOsName" - -echo "Primary:$primaryName" -echo "Legacy:$legacyName" - -if [ -z "$osName" ] && [ -z "$legacyOsName" ];then - exit 1 -fi \ No newline at end of file diff --git a/externals/get-os-platform.ps1 b/externals/get-os-platform.ps1 deleted file mode 100644 index 4ac8d07..0000000 --- a/externals/get-os-platform.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -function Get-Machine-Architecture() -{ - # possible values: AMD64, IA64, x86 - return $ENV:PROCESSOR_ARCHITECTURE -} - -function Get-CLIArchitecture-From-Architecture([string]$Architecture) -{ - switch ($Architecture.ToLower()) - { - { ($_ -eq "amd64") -or ($_ -eq "x64") } { return "x64" } - { $_ -eq "x86" } { return "x86" } - default { throw "Architecture not supported. If you think this is a bug, please report it at https://github.com/dotnet/cli/issues" } - } -} - -$CLIArchitecture = Get-CLIArchitecture-From-Architecture $(Get-Machine-Architecture) -Write-Output "Primary:win-$CLIArchitecture" \ No newline at end of file