From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 19 Sep 2007 17:25:18 +0400 From: "Dmitry V. Levin" To: ALT Devel discussion list Message-ID: <20070919132517.GE13831@basalt.office.altlinux.org> Mail-Followup-To: ALT Devel discussion list References: <20070919104911.GA17683@solemn.turbinal> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gMR3gsNFwZpnI/Ts" Content-Disposition: inline In-Reply-To: <20070919104911.GA17683@solemn.turbinal> X-fingerprint: FE4C 93AB E19A 2E4C CB5D 3E4E 7CAB E6AC 9E35 361E Subject: Re: [devel] enhanced RPM_SCRIPTS_DEBUG support, implemented debug levels X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.9 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Sep 2007 13:25:18 -0000 Archived-At: List-Archive: List-Post: --gMR3gsNFwZpnI/Ts Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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/function= s, > > as well as provide Verbose() and Debug() shell functions for use in scr= ipts. > >=20 > > 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(-) > >=20 >=20 > =F5 =CD=C5=CE=D1 =C5=D3=D4=D8 =D7=CF=D0=D2=CF=D3 =D0=CF rpmpopt. >=20 > > 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 =3D (rpmlogSetMask(0) >=3D RPMLOG_MASK(RPM= MESS_DEBUG)<<1) > > + ? "3" : rpmIsDebug() ? "2" : rpmIsVerbose() ? "1" : NULL; > > + if (scripts_debug) > > + addMacro(NULL, "_scripts_debug", NULL, scripts_debug, -1); > > + > > + while (!rpmIsVerbose()) > > rpmIncreaseVerbosity(); > > =20 > > 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 =3D (rpmlogSetMask(0) >=3D RPMLOG_MASK(RPM= MESS_DEBUG)<<1) > > + ? "3" : rpmIsDebug() ? "2" : rpmIsVerbose() ? "1" : NULL; > > + if (scripts_debug) > > + addMacro(NULL, "_scripts_debug", NULL, scripts_debug, -1); > > + > > + while (!rpmIsVerbose()) > > rpmIncreaseVerbosity(); > > =20 > > switch (ba->buildChar) { >=20 > =F1 =D3=C4=C5=CC=C1=CC =D7=CF=D4 =D4=C1=CB=CF=CA =C8=C1=CB, =DE=D4=CF=C2= =D9 rmpbuild --verbose =C1=D7=D4=CF=CD=C1=D4=C9=DE=C5=D3=CB=C9 > =D7=D9=D3=D4=C1=D7=CC=D1=CC %_scripts_debug. =F4=C5=D0=C5=D2=D8 =D7=CF= =D4 =CB=C1=CB=C1=D1 =D3=C9=D4=D5=C1=C3=C9=D1: >=20 > rpmbuild -ba ... -- _scripts_debug =D7=D9=D3=D4=C1=D7=CC=D1=C5=D4=D3=D1 > rpmbuild -ba --target i586 ... -- _scripts_debug =CE=C5 =D7=D9=D3=D4=C1= =D7=CC=D1=C5=D4=D3=D1 >=20 > =F4=CF =C5=D3=D4=D8 =D0=D2=C9 =D5=CB=C1=DA=C1=CE=C9=C9 target =C7=C4=C5-= =D4=CF =DE=D4=CF-=D4=CF =D4=C5=D2=D1=C5=D4=D3=D1. =E7=C4=C5 =C9 =DE=D4=CF? > =F7 /usr/lib/rpmpopt =C5=D3=D4=D8 =CB=C1=CB=CF=CA-=D4=CF "exec --target".= =E8=D4=CF =DA=CE=C1=C5=D4 =CF=D4=D7=C5=D4? --target =D0=D2=C9=D7=CF=C4=C9=D4 =CB =D0=CF=D7=D4=CF=D2=CE=CF=CA =C9=CE=C9= =C3=C9=C1=CC=C9=DA=C1=C3=C9=C9, =D3=D4=C1=D2=D9=C5 =CD=C1=CB=D2=CF=D3=D9 = =D4=C5=D2=D1=C0=D4=D3=D1. --=20 ldv --gMR3gsNFwZpnI/Ts Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFG8SM9fKvmrJ41Nh4RAjGHAJ9rTRuOgOBpjVIhgsjFNaXbWJLlsQCeJgV3 gS6vOcgclNaelfPTonZBCOY= =g/d/ -----END PGP SIGNATURE----- --gMR3gsNFwZpnI/Ts--