better distro version numbers
authorIan Kelling <iank@fsf.org>
Tue, 10 Nov 2020 20:01:22 +0000 (15:01 -0500)
committerIan Kelling <iank@fsf.org>
Tue, 10 Nov 2020 20:01:22 +0000 (15:01 -0500)
src/identify-distros

index a62889ee4541f08d5c569cafc105ba3abf8520e2..9c2221f43b7826137f1bbe3206984321fa3356eb 100644 (file)
@@ -45,8 +45,15 @@ distro-name-ver() {
 }
 
 distro-num() {
-  # subshell keeps environment clean
-  ( . /etc/os-release; echo ${VERSION_ID%%.*}; )
+  # Subshell keeps environment clean.
+  ( . /etc/os-release
+    # in ubuntu the .x matters, trisquel it doesnt
+    if [[ $ID == ubuntu ]]; then
+      echo $VERSION_ID
+    else
+      echo ${VERSION_ID%%.*}
+    fi
+  )
 }
 
 debian-archive() {