On Thu, Oct 02, 2003 at 05:02:58PM +0300, Alexander Bokovoy wrote: > On Tue, Sep 30, 2003 at 08:58:30PM +0400, Dmitry V. Levin wrote: > > On Tue, Sep 30, 2003 at 07:48:29PM +0300, Alexander Bokovoy wrote: > > > On Tue, Sep 30, 2003 at 08:43:09PM +0400, Dmitry V. Levin wrote: > > [...] > > > > Идея красивая, осталось только её реализовать. > > > > Желающие есть? > > > в /etc/rpm/macros.d/ccache? Так я это реализую в ccache-2.3-alt1. > > > > Это я уже понял. :) > > > > > Или ты про %build_add_variable_expand ? > > > > Про него. > Пожалуйста: > > %_variable_expand_list %nil > %set_variable_expand() %global _variable_expand_list %* ^ > %add_variable_expand() %global _variable_expand_list %_variable_expand_list %* ^ > %___pre_variable_extender() %{expand:%(echo %_variable_expand_list | \ > while read -d^ var1 var2 ; do \ > echo -e "\\tunset $var2 ||:\\\\" ; \ > echo -e "\\t%%{?$var1:export $var2=\\\"%$var1\\\"}\\\\"\ > done \ > )} > > Результат работы: > > $ rpm -v --define '__ccache_use 1' --define '__ccache_dir /foo/bar' --eval ' > %add_variable_expand __ccache_use GCC_USE_CCACHE > %add_variable_expand __ccache_dir CCACHE_DIR > %add_variable_expand __ccache_false GCC_FALSE_CCACHE > %___pre_variable_extender' > > unset GCC_USE_CCACHE ||:\ > export GCC_USE_CCACHE="1"\ > unset CCACHE_DIR ||:\ > export CCACHE_DIR="/foo/bar"\ > unset GCC_FALSE_CCACHE ||:\ > \ Только это не будет работать, если перенести %add_variable_expand __ccache_use GCC_USE_CCACHE %add_variable_expand __ccache_dir CCACHE_DIR %add_variable_expand __ccache_false GCC_FALSE_CCACHE в ~/.rpmmacros -- ldv