Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Handle missing VERSION_ID gracefully #6708

Closed

Conversation

juergenhoetzel
Copy link

I'm using Arch Linux. /etc/os-release doesn't define VERSION_ID. Running dotnet-install.sh results in:

→ LANG=C ./scripts/obtain/dotnet-install.sh 
./scripts/obtain/dotnet-install.sh: line 142: VERSION_ID: unbound variable
./scripts/obtain/dotnet-install.sh: line 150: VERSION_ID: unbound variable

According to Freedesktop.org os-release spec VERSION_ID is optional:

A lower-case string (mostly numeric, no spaces or other characters outside of 0–9, a–z, ".", "_" and "-") > identifying the operating system version, excluding any OS name information or release code name, > > and suitable for processing by scripts or usage in generated filenames. This field is optional. Example: > "VERSION_ID=17" or "VERSION_ID=11.04".

Result using this commit:

→ LANG=C ./scripts/obtain/dotnet-install.sh 
dotnet_install: Error: OS name could not be detected: arch.UNDEFINED

@livarcocc
Copy link

@dotnet-bot Test Ubuntu16.04 x64 Debug Build

@johnbeisner johnbeisner self-requested a review June 2, 2017 17:49
@ellismg
Copy link

ellismg commented Jun 7, 2017

We should follow the pattern we have dotnet/core-setup@b6aa0e6 to handle the case where this is missing (which is to elide the dot and version).

@juergenhoetzel juergenhoetzel force-pushed the handle-missing-version-id branch 2 times, most recently from 8be34a6 to a0cdc60 Compare June 7, 2017 05:38
@juergenhoetzel
Copy link
Author

We should follow the pattern we have dotnet/core-setup@b6aa0e6 to handle the case where this is missing (which is to elide the dot and version).

I just amended the commit.

@ellismg
Copy link

ellismg commented Jun 8, 2017

I just amended the commit.

Thanks @juergenhoetzel! This looks reasonable to me, but I let @johnbeisner take a look as well.

Copy link

@johnbeisner johnbeisner left a comment

Choose a reason for hiding this comment

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

This bit of code lives in the method 'get_distro_specific_os_name' which is used to construct legacy type URLs to blob storage. All of the legacy type URLs to blob storage for Linux are distribution specific and require a version. Moreover, the portable Linux package [RID linux-x64] is not available in legacy downloads.

In my opinion, the script should modified to detect that a Linux variant does not have a version [or any problem for that matter] and not construct the legacy type URL to blob storage.

@johnbeisner
Copy link

@johnbeisner
Copy link

@juergenhoetzel
A change is in this PR that should address this error: #6839

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

Successfully merging this pull request may close these issues.

None yet

5 participants