From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 2 Oct 2003 17:02:58 +0300 From: Alexander Bokovoy To: ALT Devel discussion list Subject: Re: [devel] ccache support in gcc-common Message-ID: <20031002140258.GL10067@sam-solutions.net> Mail-Followup-To: ALT Devel discussion list References: <20030917161332.GB15174@sam-solutions.net> <20030917182345.GA11890@basalt.office.altlinux.org> <20030918082900.GA15841@sam-solutions.net> <20030923081226.GA6859@basalt.office.altlinux.org> <20030923082158.GC29029@sam-solutions.net> <20030923082832.GB7186@basalt.office.altlinux.org> <20030923085035.GD29029@sam-solutions.net> <20030930164309.GA6605@basalt.office.altlinux.org> <20030930164829.GE16341@sam-solutions.net> <20030930165830.GB6605@basalt.office.altlinux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20030930165830.GB6605@basalt.office.altlinux.org> X-BeenThere: devel@altlinux.ru X-Mailman-Version: 2.1.2 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 14:03:06 -0000 Archived-At: List-Archive: List-Post: 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 ||:\ \ -- / Alexander Bokovoy --- QOTD: "I used to be an idealist, but I got mugged by reality."