From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 19 Sep 2007 14:49:11 +0400 From: Alexey Tourbin To: devel@lists.altlinux.org Message-ID: <20070919104911.GA17683@solemn.turbinal> Mail-Followup-To: devel@lists.altlinux.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UugvWAfsgieZRqgk" Content-Disposition: inline Subject: [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 10:51:31 -0000 Archived-At: List-Archive: List-Post: --UugvWAfsgieZRqgk Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 scrip= ts. >=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 =F5 =CD=C5=CE=D1 =C5=D3=D4=D8 =D7=CF=D0=D2=CF=D3 =D0=CF 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 =3D (rpmlogSetMask(0) >=3D RPMLOG_MASK(RPMME= SS_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(RPMME= SS_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) { =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: 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 =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? --UugvWAfsgieZRqgk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFG8P6nfBKgtDjnu0YRAqw+AKDeQsgcNZyCYW4rghRiq23z2uatugCcChS5 57bVOIdXiSKogwhaxeiFW/E= =ZQBp -----END PGP SIGNATURE----- --UugvWAfsgieZRqgk--