On Wed, Sep 19, 2007 at 02:49:11PM +0400, Alexey Tourbin wrote: > On Sun, Mar 04, 2007 at 09:47:34PM +0300, Alexey Tourbin wrote: > > Just setting -x is very noisy. Here is a better plan. I implement 3 > > debug levels: verbose (1), debug (2, implies verbose) and -x (3, implies > > debug). I move RPM_SCRIPTS_DEBUG test from scripts to scripts/functions, > > as well as provide Verbose() and Debug() shell functions for use in scripts. > > > > Furthermore, _scripts_debug macro is now automatically set when rpmbuild > > is invoked with --verbose option. Use -vv for debug and -vvv for -x. > > --- > > autodeps/linux.prov.in | 2 -- > > autodeps/linux.req.in | 2 -- > > rpmqv.c | 14 ++++++++++++-- > > scripts/functions | 18 ++++++++++++++++++ > > scripts/ldd.in | 2 -- > > 5 files changed, 30 insertions(+), 8 deletions(-) > > > > У меня есть вопрос по rpmpopt. > > > diff --git a/rpmqv.c b/rpmqv.c > > index e0acd57..de191cb 100755 > > --- a/rpmqv.c > > +++ b/rpmqv.c > > @@ -942,7 +942,12 @@ int main(int argc, const char ** argv) > > case MODE_REBUILD: > > case MODE_RECOMPILE: > > { const char * pkg; > > - while (!rpmIsVerbose()) > > + const char * scripts_debug = (rpmlogSetMask(0) >= RPMLOG_MASK(RPMMESS_DEBUG)<<1) > > + ? "3" : rpmIsDebug() ? "2" : rpmIsVerbose() ? "1" : NULL; > > + if (scripts_debug) > > + addMacro(NULL, "_scripts_debug", NULL, scripts_debug, -1); > > + > > + while (!rpmIsVerbose()) > > rpmIncreaseVerbosity(); > > > > if (!poptPeekArg(optCon)) > > @@ -980,7 +985,12 @@ int main(int argc, const char ** argv) > > case MODE_BUILD: > > case MODE_TARBUILD: > > { const char * pkg; > > - while (!rpmIsVerbose()) > > + const char * scripts_debug = (rpmlogSetMask(0) >= RPMLOG_MASK(RPMMESS_DEBUG)<<1) > > + ? "3" : rpmIsDebug() ? "2" : rpmIsVerbose() ? "1" : NULL; > > + if (scripts_debug) > > + addMacro(NULL, "_scripts_debug", NULL, scripts_debug, -1); > > + > > + while (!rpmIsVerbose()) > > rpmIncreaseVerbosity(); > > > > switch (ba->buildChar) { > > Я сделал вот такой хак, чтобы rmpbuild --verbose автоматически > выставлял %_scripts_debug. Теперь вот какая ситуация: > > rpmbuild -ba ... -- _scripts_debug выставляется > rpmbuild -ba --target i586 ... -- _scripts_debug не выставляется > > То есть при указании target где-то что-то теряется. Где и что? > В /usr/lib/rpmpopt есть какой-то "exec --target". Хто знает ответ? --target приводит к повторной инициализации, старые макросы теряются. -- ldv