Skip to content

Peer review for code change to include Azure Linux installations[[install-powershell.sh doesn't work on azure-linux #23944]] #23955

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

Merged
merged 3 commits into from
Jul 1, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tools/install-powershell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ install(){
if [[ $osname = *SUSE* ]]; then
DistroBasedOn='suse'
REV=$(source /etc/os-release; echo $VERSION_ID)
elif [ $osname = *"Azure Linux"* ] ; then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be [[ $osname = *"Azure Linux"* ]]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also maybe a better way would be to follow the same pattern above? eg:

   elif [ -f /etc/azurelinux-release ] ; then
                DistroBasedOn='mariner'
                PSUEDONAME=$( (sed s/.*\(// | sed s/\)//) < /etc/azurelinux-release )
                REV=$( (sed s/.*release\ // | sed s/\ .*//) < /etc/azurelinux-release )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this is a better way to solve this issue.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried it and it doesn't work:

Get-PowerShell MASTER Installer Version 1.2.0
Installs PowerShell and Optional The Development Environment
Original script is at: https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools\install-powershell.psh
Arguments used:

Operating System Details:
OS: linux
DIST:
DistroBasedOn: mariner
PSUEDONAME: Azure Linux 3.0
AZURELINUX_BUILD_NUMBER=3.0.20240524
REV: Azure
AZURELINUX_BUILD_NUMBER=3.0.20240524
KERNEL: 6.6.29.1-3.azl3
MACH: x86_64
OSSTR:
Configuring PowerShell Environment for: mariner Azure
AZURELINUX_BUILD_NUMBER=3.0.20240524
Could not find "installpsh-mariner.sh" next to this script...
Pulling and executing it from "https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/installpsh-mariner.sh"
found and using curl

*** PowerShell Development Environment Installer 1.2.0 for mariner
*** Original script is at: https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/installpsh-mariner.sh

*** Arguments used:

*** This installer is only for mariner and you are running , please run "https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools\install-powershell.sh" to see if your distro is supported AND to auto-select the appropriate installer if it is.

DistroBasedOn='mariner'
REV=$(source /etc/os-release; echo $VERSION_ID)
fi
OS=$(lowercase $OS)
DistroBasedOn=$(lowercase $DistroBasedOn)
Expand Down