tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: OS_VARIANT



* On 2016-02-01 at 18:36 GMT, Richard PALO wrote:

> I'd like to propose making OS_VARIANT multi-value.
> 
> In particular this is useful for SunOS where currently only
> "SmartOS" and "OmniOS" are listed variants but not "Illumos" as a whole.
> 
> The basis is simple, if ${OS_VERSION} == "5.11" and there is no "Oracle" found
> in /etc/release, then the OS_VARIANT would be [initially] "Illumos".
> 
> Subsequently, "SmartOS" and "OmniOS" can tack onto OS_VARIANT with '+=' instead of '='.

I don't like the idea of changing the variable type and overloading it
with multiple meanings, but I agree we could do with a way to identify
the different vendors, so maybe just introduce a new variable like we
did with LOWER_VARIANT_VERSION.  Maybe OS_VENDOR?

> This permits the following sort of checks (worst case)
> 
> .if ${OPSYS} == "SunOS"
> .  if !empty(${OS_VARIANT:MIllumos})
> .    if !empty(${OS_VARIANT:MSmartOS})
>        <specific case 1...>
> .    elif !empty(${OS_VARIANT:MOmniOS})
>        <specific case 2...>
> .    else
>        <general Illumos case...>
> .    endif
> .  else
>      #Sun or Oracle 
>      <....>
> .endif
> 
> where I believe, naturally, the most common case to be differentiated is between "Illumos" and not.

I believe it's supposed to be "illumos" in all forms, but I'm not
really going to argue that point ;)

Cheers,

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com


Home | Main Index | Thread Index | Old Index