From owner-freebsd-questions@FreeBSD.ORG Fri Apr 11 14:11:47 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06A94D52 for ; Fri, 11 Apr 2014 14:11:47 +0000 (UTC) Received: from be-well.ilk.org (be-well.ilk.org [23.30.133.173]) by mx1.freebsd.org (Postfix) with ESMTP id D44641FD7 for ; Fri, 11 Apr 2014 14:11:46 +0000 (UTC) Received: by be-well.ilk.org (Postfix, from userid 1147) id CE49233C48; Fri, 11 Apr 2014 10:11:45 -0400 (EDT) From: Lowell Gilbert To: Matthias Apitz Subject: Re: answering questions spilled out from gmake processes References: <20140411052540.GA1817@La-Habana> Date: Fri, 11 Apr 2014 10:11:45 -0400 In-Reply-To: <20140411052540.GA1817@La-Habana> (Matthias Apitz's message of "Fri, 11 Apr 2014 07:25:40 +0200") Message-ID: <44d2got0pq.fsf@be-well.ilk.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: freebsd-questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2014 14:11:47 -0000 Matthias Apitz writes: > Hello, > > I have a huge gmake process to compile a lot of OpenSource tools, mostly > Perl modules etc. All this is driven by a master Makefile. Some of the > make processes are asking questions which I do not have under my control and > would require to change the fetched source trees, for example: > > ... > Test for foo failed, do you want to continue (y/n): > > These questions forbit to run this with nohup in background or > unattendend. I was thinking to use chat(1) or any other own written tool > and run the proc in an xterm like: > > chat < Xterm.log | gmake > > were Xterm.log is the log of the X-terminal and chat is reading the > question there '...want to continue (y/n)' and sends the correct answer. > > Any other idea? There are different approaches to this, depending on the kinds of changes needed. As an example of how many kinds of settings could theoretically be needed, look at the types of patches, configure flags, and so on (and on) in the FreeBSD ports system. Other approaches to the same problem (e.g., OpenEmbedded) show fairly similar numbers and types of modifications, so I don't think there's a general-purpose way around it. If you possibly can, leverage an existing porting framework; since you're asking on freebsd-questions, the ports system is probably the first candidate. The scripted approach will be fragile and fiddly, but if you're going to try it, something like expect will probably be easier than chat().