From owner-freebsd-ports@FreeBSD.ORG Sun Jan 27 19:41:01 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D8C80411 for ; Sun, 27 Jan 2013 19:41:01 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) by mx1.freebsd.org (Postfix) with ESMTP id 9ED78226 for ; Sun, 27 Jan 2013 19:41:01 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id 16so379457iea.36 for ; Sun, 27 Jan 2013 11:41:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=ujEHcZsalnVaWKQGkj6WUcenlKYE0CzdnizoF3a3HCg=; b=cqgMU/G9ROeJXrlcumHdNbtfgbZTNmbBadPCT95RADdohuepk7dg5d6SFEXyysIqzf gtqTIj/30bTGJOHZz+ePHwMsUw5HjVjQUD0cunypcjfF/uVumFIQbLPvmvHmDD1dyxiy ZEPYIG9vaQ3RZ+zNXIzAk9kebDsuVbTObakaXgydBMJLMHvBktqfxBs8mdfiv1RIUm/O sPASmfkiH1DaNsRwXRAjjzyJHS8ZQtnmqr/7xqVMYhNs7Gg55ZNXGITuf58Vw+jsi1fJ ooKqwoczBqb6q65U0W2m8d0pXi8d96ciLddUH7C2Ug86lZc12aDazK7ISkbekIJE4eF0 3glA== MIME-Version: 1.0 X-Received: by 10.50.83.162 with SMTP id r2mr3387160igy.106.1359315660961; Sun, 27 Jan 2013 11:41:00 -0800 (PST) Received: by 10.50.151.206 with HTTP; Sun, 27 Jan 2013 11:41:00 -0800 (PST) In-Reply-To: <20130128.021533.335602238.yasu@utahime.org> References: <20130128.021533.335602238.yasu@utahime.org> Date: Sun, 27 Jan 2013 13:41:00 -0600 Message-ID: Subject: Re: Issue about adapting japanese/ruby-mecab to new options framework From: Scot Hetzel To: Yasuhiro KIMURA Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jan 2013 19:41:01 -0000 On Sun, Jan 27, 2013 at 11:15 AM, Yasuhiro KIMURA wrote: > Hello all, > > I adapted japanese/ruby-mecab to new options framework and sent > following PR. > > http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/175258 > > But after submitting I found a issue that options setting dialog is > always displayed even if options save file is already created. > > According to the output of 'make' with '-d' option, following things > seem to happen: > > 1. PKGNAMEPREFIX variable is assigned to "ja-" and that causes > OPTIONSFILE variable to be expanded to "/var/db/ports/ja-mecab/options". > 2. /var/db/ports/ja-mecab/options is included as options save file. > 3. PKGNAMEPREFIX is re-assigned to "ja-ruby19-" and that causes > OPTIONFILE to be expanded to "/var/db/ports/ja-ruby-mecab/options". > 4. Options dialog is invoked and result is saved to /var/db/ports/ja-ruby-mecab/options. > 5. Since input and output files of options setting are different, > dialog is displayed every time 'make' is invoked. > > And below is detail: > > 01. RUBY_DEFAULT_VER is assigned to "1.9" in /etc/make.conf of my > machine. > 02. PORTNAME is assigned to "mecab" in japanese/ruby-mecab/Makefile. > 03. PKGNAMEPREFIX is assigned to "ja-" in japanese/Makefile.inc. > 04. PORT_DBDIR is assigned to "/var/db/ports" in Mk/bsd.port.mk. > 05. UNIQUENAME is assigned to "${PKGNAMEPREFIX}${PORTNAME}" > in Mk/bsd.port.mk. > 06. OPTIONSFILE is assigned to "${PORT_DBDIR}/${UNIQUENAME}/options" > in Mk/bsd.options.mk. > 07. Check is done if ${OPTIONSFILES} exists in Mk/bsd.options.mk. > At this point ${OPTIONSFILES} is expanded to "/var/db/ports/ja-mecab/options". > So file named /var/db/ports/ja-mecab/options is checked. > Since japanese/ruby-mecab is depend on japanese/mecab, this file > usually exists. So this file is included as saved options file of > japanese/ruby-mecab. > 08. PKGNAMEPREFIX is assigned with expansion (':=' is used) to > "${PKGNAMEPREFIX}${RUBY_PKGNAMEPREFIX"} in japanese/ruby-mecab/Makefile. > 09. RUBY_RELVERSION is assigned to "1.9.3" in Mk/bsd.ruby.mk. > 10. RUBY_PATCHLEVEL is assigned to "327" in Mk/bsd.ruby.mk. > 11. RUBY_VERSION is assigned to "${RUBY_RELVERSION}.${RUBY_PATCHLEVEL} > in Mk/bsd.ruby.mk. > 12. RUBY_VER is assigned to "${RUBY_VERSION:C/([[:digit:]]+\.[[:digit:]]+).*/\1/}" > in Mk/bsd.ruby.mk. > 13. RUBY_SUFFIX is assigned to "${RUBY_VER:S/.//}" in Mk/bsd.ruby.mk. > 14. RUBY_PKGNAMEPREFIX is assigned to "ruby${RUBY_SUFFIX}-" in Mk/bsd.ruby.mk. > 15. /usr/bin/dialog is invoked to show options setting dialog. > 16. Result of step 15 is saved to ${OPTIONSFILE}. At this point > ${OPTIONSFILE} is expanded to "/var/db/ports/ja-ruby19-mecab/options". > So file named /var/db/ports/ja-ruby19-mecab/options is created > and options setting is saved to it. > 17. Now options settings are saved to /var/db/ports/ja-ruby19-mecab/options > at step 16, and it is different from the file included at step 07. > So it cause step 01 to 16 to be repeated every time 'make' is invoked. > > And now, how should I fix this issue? Is it possible to fix it by only > patching japanese/ruby-mecab/Makefile? Or are some changes of Mk/bsd.*.mk > needed? > > Any suggestion is welcome. > You could add OPTIONSFILE to japanese/ruby-mecab/Makefile as: OPTIONSFILE= ${PORT_DBDIR}/ruby-mecab/options This way it will always find it's own options file. Scot -- DISCLAIMER: No electrons were maimed while sending this message. Only slightly bruised.