Merge pull request #1426 from mitchweaver/detect_current

detect whether using -current on OpenBSD
This commit is contained in:
dylan 2020-03-12 12:32:26 +02:00 committed by GitHub
commit 1778941dda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -1032,6 +1032,11 @@ get_distro() {
*) distro="Guix System $(guix system -V | awk 'NR==1{printf $5}')"
esac
# Display whether using '-current' or '-release' on OpenBSD.
elif [[ $kernel_name = OpenBSD ]] ; then
read -ra kernel_info <<< "$(sysctl -n kern.version)"
distro=${kernel_info[*]:0:2}
else
for release_file in /etc/*-release; do
distro+=$(< "$release_file")