Browse code

Merge "Add some notes on DISTRO setting"

Jenkins authored on 2016/03/07 23:30:31
Showing 1 changed files
... ...
@@ -390,7 +390,26 @@ function GetDistro {
390 390
     elif [[ "$os_VENDOR" =~ (kvmibm) ]]; then
391 391
         DISTRO="${os_VENDOR}${os_RELEASE::1}"
392 392
     else
393
-        die $LINENO "Unable to determine DISTRO"
393
+        # We can't make a good choice here.  Setting a sensible DISTRO
394
+        # is part of the problem, but not the major issue -- we really
395
+        # only use DISTRO in the code as a fine-filter.
396
+        #
397
+        # The bigger problem is categorising the system into one of
398
+        # our two big categories as Ubuntu/Debian-ish or
399
+        # Fedora/CentOS-ish.
400
+        #
401
+        # The setting of os_PACKAGE above is only set to "deb" based
402
+        # on a hard-coded list of vendor names ... thus we will
403
+        # default to thinking unknown distros are RPM based
404
+        # (ie. is_ubuntu does not match).  But the platform will then
405
+        # also not match in is_fedora, because that also has a list of
406
+        # names.
407
+        #
408
+        # So, if you are reading this, getting your distro supported
409
+        # is really about making sure it matches correctly in these
410
+        # functions.  Then you can choose a sensible way to construct
411
+        # DISTRO based on your distros release approach.
412
+        die $LINENO "Unable to determine DISTRO, can not continue."
394 413
     fi
395 414
     typeset -xr DISTRO
396 415
 }