From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 2C71D1391EE for ; Sat, 8 Mar 2014 05:51:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CEB1DE0B0F; Sat, 8 Mar 2014 05:51:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id CF3F9E0B0D for ; Sat, 8 Mar 2014 05:51:20 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id DAC8A33FBE2 for ; Sat, 8 Mar 2014 05:51:19 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 381A4188E9 for ; Sat, 8 Mar 2014 05:51:17 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1392706745.7b6a61e8015aa5790cd0a8e1f58a0bf442b88955.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qmerge.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 7b6a61e8015aa5790cd0a8e1f58a0bf442b88955 X-VCS-Branch: master Date: Sat, 8 Mar 2014 05:51:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 3a70ed7e-d0c8-45e7-b394-52d76a2343dd X-Archives-Hash: 9e499a571024fd33007e6703a931c062 commit: 7b6a61e8015aa5790cd0a8e1f58a0bf442b88955 Author: Mike Frysinger gentoo org> AuthorDate: Tue Feb 18 06:59:05 2014 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue Feb 18 06:59:05 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=7b6a61e8 qmerge: add --debug option for auto running shell through `set -x` --- qmerge.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/qmerge.c b/qmerge.c index 479c551..1a44e46 100644 --- a/qmerge.c +++ b/qmerge.c @@ -1,7 +1,7 @@ /* * Copyright 2005-2010 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 - * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.137 2014/02/18 06:58:45 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.138 2014/02/18 06:59:05 vapier Exp $ * * Copyright 2005-2010 Ned Ludd - * Copyright 2005-2010 Mike Frysinger - @@ -48,6 +48,7 @@ static struct option const qmerge_long_opts[] = { {"yes", no_argument, NULL, 'y'}, {"nodeps", no_argument, NULL, 'O'}, {"nomd5", no_argument, NULL, '5'}, + {"debug", no_argument, NULL, 128}, COMMON_LONG_OPTS }; @@ -62,10 +63,11 @@ static const char * const qmerge_opts_help[] = { "Don't prompt before overwriting", "Don't merge dependencies", "Don't verify MD5 digest of files", + "Run shell funcs with `set -x`", COMMON_OPTS_HELP }; -static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.137 2014/02/18 06:58:45 vapier Exp $"; +static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.138 2014/02/18 06:59:05 vapier Exp $"; #define qmerge_usage(ret) usage(ret, QMERGE_FLAGS, qmerge_long_opts, qmerge_opts_help, lookup_applet_idx("qmerge")) char search_pkgs = 0; @@ -77,6 +79,7 @@ char follow_rdepends = 1; char nomd5 = 0; char qmerge_strict = 0; char update_only = 0; +bool debug = false; const char Packages[] = "Packages"; /* @@ -467,10 +470,16 @@ pkg_run_func(const char *vdb_path, const char *phases, const char *func, const c "ED=\"${EPREFIX%%/}/${D#/}\"\n" "T='%6$s'\n" /* Finally run the func */ - "%2$s\n" + "%7$s%2$s\n" /* Ignore func return values (not exit values) */ ":", - vdb_path, func, phase, portroot, D, T); + /*1*/ vdb_path, + /*2*/ func, + /*3*/ phase, + /*4*/ portroot, + /*5*/ D, + /*6*/ T, + /*7*/ debug ? "set -x;" : ""); xsystembash(script); free(script); } @@ -1961,6 +1970,7 @@ int qmerge_main(int argc, char **argv) case 'y': interactive = 0; break; case 'O': follow_rdepends = 0; break; case '5': nomd5 = 1; break; + case 128: debug = true; break; COMMON_GETOPTS_CASES(qmerge) } }