On Thu, Dec 31, 2009 at 6:19 AM, Pavel Heimlich, a.k.a. hajma
<tropikhajma at gmail.com> wrote:
> 2009/12/31 Ben Taylor <bentaylor.solx86 at gmail.com>:
>> currently, we have is_nv (just changed from is_nevada), is_osol and is_s10
>> in the foss-depend-packages.inc file, and those are used pretty heavily.
>> There is some use of the %{with_<OS>}, but we should probably standardize
>> on %{is_<OS>} as a matter of the clean up.
>>
>> base-foss-header.inc appears to include that foss-depend-packages.inc, and
>> I'm thinking that we could probably do with some house cleaning of the
>> includes
>> to fix some logic issues
>
> definitely, in some places it get's quite complex
>
>>
>> 1) is_osol was mapping to svn_101b, and I've pushed a fix to include
>> snv_111b,
>> but this really isn't effective for anyone on the dev pkgs. Adriaan
>> suggested
>> looking for /usr/bin/pkg, which works for me. comments?
>
> perhaps
> grep -q OpenSolaris /etc/release && echo 1||echo 0
> could be used. However both versions would do.
>
> (ugh, does the /usr/bin/grep on S10 support the -q option?)
not to worry. think I have this mostly solved.
>> 2) there's a bunch of complicated %if %{?!_is_nv:1}%{?_is_osol:1} which don't
>> really appear to work correctly.
>>
>> Since we should be setting --with_nevada (guess that should be --with_nv now)
>> --with_sol10 and --with_osol, we should probably remove the hardcode of
>> %define is_osol 1 and %define _reduced_deps 1 from base-foss-header.inc
>> and really do conditional sets.
>
> +1
>> I am going to recommend that we add the following defines to help building
>> or defining files:
>>
>> Move the %define is_<OS> to base-foss-headers.inc, and extend the logic
>> as such:
>>
>> %if %{is_s10}
>> %define not_nv 1
>> %define not_osol 1
>> %define not_s10 0
>> %endif
>>
>> (and so on for %{is_nv} and %{is_osol} expanding to 1)
>> This will allow us to either say:
>>
>> %if %{is_s10}
>> some stuff for S10
>> %endif
>>
>> or
>>
>> %if %{not_s10}
>> some stuff for NV or OSOL
>> %endif
>>
>> but not have to say:
>>
>> %if %{?_is_nv:1}%{?_is_osol:1}
>> some stuff for NV or OSOL
>> %endif
>> (which in my experience operates not as expected).
>>
>> Thoughts?
>
> we should somehow distinguish between osol 2009.06 and it's devel
> versions (is_osol_dev ?), since some packages are already part of the
> system in the latter case.
> Now should we automatically assume -devel to be the latest available
> build or should we try to have rules like 'if build_number>125'?
>
> I already asked at
> http://mail.opensolaris.org/pipermail/sw-porters-discuss/2009-December/001765.html
> for hints.
# don't have a dev osol box, so not sure if_osol will pick up the version
# from uname -a. if so, the if_osoldev can be changed to %define
if_osoldev %{if_osol)
#
%define if_osol %(uname -a | sed 's,.*snv_\(1[0-9][0-9]\)b.*,\1,')
%define is_s10 %(test `uname -r` = 5.10 && echo 1 || echo 0)
%if %(test -n "%{if_osol}" && echo 1 || echo 0)
%if %{is_10}
%define is_nv 0
%define is_osol 0
%else
%define is_nv %(test `uname -r` = 5.11 &&
echo 1 || echo 0)
%define is_s10 0
%define is_osol 0
%endif
%else
%define if_osoldev %(head -1 /etc/release |grep
OpenSolaris | sed 's,.*snv_\(1[0-9][0-9]\)b.*,\1,')
%define is_osol0805 %(test %{if_osol} = "101" && echo 1 || echo 0)
%define is_osol0906 %(test %{if_osol} = "111" && echo 1 || echo 0)
%define is_osoldev %{test -n "%{if_osoldev}" && echo 1 || echo 0)
%define is_nv 0
%define is_s10 0
%define is_osol %(test %{if_osol0805} -eq 1 -o
%{if_osol0906} -eq 1 -o %{if_osoldev} -eq 1 && echo 1 || exit )
%endif
in this case, %{if_osoldev} will have the specific revision number.
Think this is workable?
Ben