From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64073C10F0E for ; Thu, 18 Apr 2019 16:15:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C27021850 for ; Thu, 18 Apr 2019 16:15:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389652AbfDRQPQ (ORCPT ); Thu, 18 Apr 2019 12:15:16 -0400 Received: from charlotte.tuxdriver.com ([70.61.120.58]:34388 "EHLO smtp.tuxdriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725888AbfDRQPP (ORCPT ); Thu, 18 Apr 2019 12:15:15 -0400 Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1hH9gu-0003Cs-JV; Thu, 18 Apr 2019 12:15:12 -0400 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.15.2/8.14.6) with ESMTP id x3IG5Zx7004458; Thu, 18 Apr 2019 12:05:35 -0400 Received: (from linville@localhost) by localhost.localdomain (8.15.2/8.15.2/Submit) id x3IG5YZP004457; Thu, 18 Apr 2019 12:05:34 -0400 Date: Thu, 18 Apr 2019 12:05:34 -0400 From: "John W. Linville" To: Kevin Locke , netdev@vger.kernel.org, Jesse Brandeburg Subject: Re: [PATCH v2] ethtool: Add bash-completion script Message-ID: <20190418160533.GA22913@tuxdriver.com> References: <4dedb8b19e812805abdd4ffbdfddac5df755b8a5.1555004349.git.kevin@kevinlocke.name> <20190416183714.GA14097@tuxdriver.com> <20190417025333.GA28674@kevinolos> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190417025333.GA28674@kevinolos> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Apr 16, 2019 at 08:53:33PM -0600, Kevin Locke wrote: > On Tue, 2019-04-16 at 14:37 -0400, John W. Linville wrote: > > Overall, it looks good to me. But when I build with "make distcheck", > > I get this output: > > > > [...] > > > > It looks like somewhere you are using "$(bashcompletiondir)" instead of > > "$(DESTDIR)$(bashcompletiondir)", but I can't seem to find it. Perhaps > > you can find the change required to avoid this build error? > > Thanks for taking a look at it! Good catch. DESTDIR would have been > my guess as well. Interestingly, the issue is that make distcheck > expects `./configure --prefix=foo && make install` to only install > files below foo, which fails because --with-bash-completion-dir > defaults to `pkg-config --variable=completionsdir bash-completion` > (usually /usr/share/bash-completion/completions). > > I can think of a few different ways to fix this: > > 1. Add =--without-bash-completion-dir or > --with-bashcompletiondir=$something to DISTCHECK_CONFIGURE_FLAGS > in Makefile.am to avoid installing the script during distcheck. > 2. Replace the prefix for bash-completion (using > `pkg-config --variable=prefix bash-completion`) in > $bashcompletiondir with --prefix passed to configure. > 3. Stop using pkg-config and install to > $datadir/bash-completion/completions by default. > > Option 1 has the disadvantage that users may not expect files to be > installed outside of --prefix, that the script does not install to > /usr/local (with everything else) by default, and that > --with-bash-completion-dir= must be passed for non-root installs. > kmod passes > --with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) > to DISTCHECK_CONFIGURE_FLAGS, which has the additional disadvantage of > using the undocumented (AFAICT) Automake $$dc_install_base variable. > > Options 2 and 3 have the disadvantage that passing --prefix= which is > not the prefix of $XDG_DATA_HOME or $XDG_DATA_DIRS will install the > script to a directory that bash-completion doesn't use. > > Option 3 has the additional disadvantage of ignoring the upstream > recommendations, which could install the script to a directory not > used by bash-completion for customized or future versions. It has the > advantage of being extremely simple and understandable. > > My personal preference is #2, but I would defer to your judgement. > Let me know which you would prefer and I'll update the patch. > > Best, > Kevin > > P.S. I noticed that the PKG_CHECK_MODULES macro does unnecessary work > handling BASH_COMPLETION_CFLAGS and BASH_COMPLETION_LIBS and adds them > to the configure --help text, so I will remove it in favor of calling > $PKG_CONFIG directly, unless you object. Option #2 seems reasonable, and your "P.S." seems fine too. Thanks, John -- John W. Linville Someday the world will need a hero, and you linville@tuxdriver.com might be all we have. Be ready.