tech-pkg archive

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

Re: multi-variant packages and bulk builds



> Internally, pkg_rolling-replace does something like this:

>       # try to replace py24-pexpect-*
>       cd pkgsrc/devel/pexpect
>       make clean ; make replace ; make clean
>       # try to replace py25-pexpect-*
>       cd pkgsrc/devel/pexpect
>       make clean ; make replace ; make clean

> but it's not passing PYTHON_VERSION_DEFAULT into the build, so instead
> of rebuilding both packages, it ends up rebuilding one of the packages
> twice, and displaying several error messages.

> To fix this, I think the package itself should somehow encode the
> fact that, when trying to "replace" it, you need to pass the correct
> value for PYTHON_VERSION_DEFAULT.
> If a future version of the pkgsrc infrastructure stored
> "VARIANTS=PYTHON_VERSION_DEFAULT=24" in the
> +BUILD_INFO file, then a future version of pkg_rolling-replace could do
> the right thing.

IMHO this is good idea. But original idea for the name VARIANTS was a
bit different.  New variable containing _some of_ building options
(for multi-variant packages) is very close to the variable ASSIGNMENTS
recently implemented in pkg_src_summary.

If I understand you correctly you meant the following

   $ pkg_info -B py25-pexpect
   ...
   ASSIGNMENTS=PYTHON_VERSION_REQD=25
   ...
   $ pkg_info -B py24-pexpect
   ...
   ASSIGNMENTS=PYTHON_VERSION_REQD=25
   ...
   $

To implement this, I personally whould like to see the following pbulk
code moved from pbulk to somewhere in pkgsrc.

   _PBULK_MULTI?=       apache php python

   _PBULK_MULTI_LIST.apache=    PKG_APACHE_ACCEPTED
   _PBULK_MULTI_VAR.apache=     PKG_APACHE
   _PBULK_MULTI_DEFAULT.apache= PKG_APACHE_DEFAULT

   _PBULK_MULTI_LIST.php=       PHP_VERSIONS_ACCEPTED
   _PBULK_MULTI_VAR.php=        PHP_VERSION_REQD
   _PBULK_MULTI_DEFAULT.php=    PHP_VERSION_DEFAULT

   _PBULK_MULTI_LIST.python=    _PYTHON_VERSIONS_ACCEPTED
   _PBULK_MULTI_VAR.python=     PYTHON_VERSION_REQD
   _PBULK_MULTI_DEFAULT.python= PYTHON_VERSION_DEFAULT

Then...

   .for i in ${_PBULK_MULTI}
   .if !empty(${_PBULK_MULTI_LIST.${i}})
   VARIANTS+=   ${_PBULK_MULTI_VAR.${i}}=${${_PBULK_MULTI_LIST.${i}}:ts,}
   .endif
   .endfor

   .for i in ${_PBULK_MULTI}
   .if !empty(${_PBULK_MULTI_VAR.${i}})
   ASSIGNMENTS+=        ${_PBULK_MULTI_VAR.${i}}=${${_PBULK_MULTI_VAR.${i}}}
   .elif !empty(${_PBULK_MULTI_DEFAULT.${i}})
   ASSIGNMENTS+=        ${_PBULK_MULTI_VAR.${i}}=${${_PBULK_MULTI_DEFAULT.${i}}}
   .endif
   .endfor

Demo

   0 drupal6>bmake show-vars VARNAMES='PKGNAME VARIANTS ASSIGNMENTS'
   drupal-6.4
   PKG_APACHE=apache13,apache2,apache22 PHP_VERSION_REQD=4,5
   PKG_APACHE=apache22 PHP_VERSION_REQD=5
   0 drupal6>cd ../php-apc/
   0 php-apc>bmake show-vars VARNAMES='PKGNAME VARIANTS ASSIGNMENTS'
   php5-apc-5.2.6.3.0.16
   PHP_VERSION_REQD=4,5
   PHP_VERSION_REQD=5
   0 php-apc>cd ../ap2-auth-ldap/
   0 ap2-auth-ldap>bmake show-vars VARNAMES='PKGNAME VARIANTS ASSIGNMENTS'
   ap2-auth-ldap-3.05nb5
   PKG_APACHE=apache2
   PKG_APACHE=apache2
   0 ap2-auth-ldap>cd ../../devel/py-expect
   0 py-expect>bmake show-vars VARNAMES='PKGNAME VARIANTS ASSIGNMENTS'
   py24-expect-1.9b1nb3
   PYTHON_VERSION_REQD=25,24,23
   PYTHON_VERSION_REQD=24
   0 py-expect>bmake -f ./Makefile -f ~/tmp/1.mk show-vars VARNAMES='PKGNAME 
VARIANTS7 ASSIGNMENTS' PYTHON_VERSION_REQD=25
   py25-expect-1.9b1nb3
   PYTHON_VERSION_REQD=25,24,23
   PYTHON_VERSION_REQD=25
   0 py-expect>

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index