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 1F6D61391ED for ; Sat, 8 Mar 2014 05:51:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2B340E0B0C; Sat, 8 Mar 2014 05:51:20 +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 44053E0AFD for ; Sat, 8 Mar 2014 05:51:19 +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 7679033FB82 for ; Sat, 8 Mar 2014 05:51:18 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 62029188F3 for ; Sat, 8 Mar 2014 05:51:16 +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: <1392618753.42813bf37d0aba98b534639928cb370359846a7e.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: 42813bf37d0aba98b534639928cb370359846a7e X-VCS-Branch: master Date: Sat, 8 Mar 2014 05:51:16 +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: aadb2415-3700-48dc-a25e-c80e7a1ec3de X-Archives-Hash: e1e005b878e790fb71f84d8fdcc4fda0 commit: 42813bf37d0aba98b534639928cb370359846a7e Author: Mike Frysinger gentoo org> AuthorDate: Mon Feb 17 06:32:33 2014 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Mon Feb 17 06:32:33 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage-utils.git;a=commit;h=42813bf3 qmerge: do not require PORTAGE_BINHOST all the time perfectly reasonable to only install local binpkgs --- qmerge.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/qmerge.c b/qmerge.c index 5ec9be8..9a42269 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.132 2014/02/16 21:14:24 vapier Exp $ + * $Header: /var/cvsroot/gentoo-projects/portage-utils/qmerge.c,v 1.133 2014/02/17 06:32:33 vapier Exp $ * * Copyright 2005-2010 Ned Ludd - * Copyright 2005-2010 Mike Frysinger - @@ -65,7 +65,7 @@ static const char * const qmerge_opts_help[] = { COMMON_OPTS_HELP }; -static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.132 2014/02/16 21:14:24 vapier Exp $"; +static const char qmerge_rcsid[] = "$Id: qmerge.c,v 1.133 2014/02/17 06:32:33 vapier Exp $"; #define qmerge_usage(ret) usage(ret, QMERGE_FLAGS, qmerge_long_opts, qmerge_opts_help, lookup_applet_idx("qmerge")) char search_pkgs = 0; @@ -113,16 +113,15 @@ _q_static char *find_binpkg(const char *); _q_static void fetch(const char *destdir, const char *src) { - char buf[BUFSIZ]; - if (!binhost[0]) - errf("PORTAGE_BINHOST= does not appear to be valid"); + return; fflush(stdout); fflush(stderr); #if 0 if (getenv("FETCHCOMMAND") != NULL) { + char buf[BUFSIZ]; snprintf(buf, sizeof(buf), "(export DISTDIR='%s' URI='%s/%s'; %s)", destdir, binhost, src, getenv("FETCHCOMMAND")); xsystem(buf); @@ -131,6 +130,7 @@ _q_static void fetch(const char *destdir, const char *src) { pid_t p; int status; + char *path; char prog[] = "wget"; char argv_c[] = "-c"; @@ -142,18 +142,23 @@ _q_static void fetch(const char *destdir, const char *src) argv_c, argv_P, argv_dir, - buf, + path, quiet ? argv_q : NULL, NULL, }; if (!(force_download || install) && pretend) strcpy(prog, "echo"); - snprintf(buf, sizeof(buf), "%s/%s", binhost, src); + xasprintf(&path, "%s/%s", binhost, src); p = vfork(); - if (p == 0) + switch (p) { + case 0: _exit(execvp(prog, argv)); + case -1: + errp("vfork failed"); + } + free(path); free(argv_dir); waitpid(p, &status, 0);