All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] new program: usb_modeswitch_data Signed-off-by: J.C. Woltz <jwoltz@gmail.com>
Date: Sat, 11 Feb 2012 17:41:05 +0100	[thread overview]
Message-ID: <201202111741.05348.arnout@mind.be> (raw)
In-Reply-To: <CAAXf6LXHDCgVzp+OpHN8BTsdx2X418ABum=PZS172F4dGktiSA@mail.gmail.com>

On Friday 10 February 2012 15:46:05 Thomas De Schampheleire wrote:
>  I thought a select was appropriate since
> > usb_modeswitch_data is not vital for usb_modeswitch, but usb_modeswitch_data
> > is nice when using udev.
> 
> +config BR2_PACKAGE_USB_MODESWITCH_DATA
> +       select BR2_PACKAGE_USB_MODESWITCH
> 
> What you express with a select like this is that when you select
> 'usb_modeswitch_data' (which can be always selected), the
> configuration script should automatically select usb_modeswitch for
> you. The problem with this approach is that when usb_modeswitch
> depends on something, it will not enable these dependencies.
> See http://kernel.org/doc/Documentation/kbuild/kconfig-language.txt
> for more information.

 That's not entirely true.  select itself is transitive; it just
doesn't check if the select'd item depends on something.  But it will
recursively select other packages.  So with the select statement,
USB_MODESWITCH_DATA will select USB_MODESWITCH, which will select
LIBUSB_COMPAT, which will select LIBUSB.


> Since usb_modeswitch_data only makes sense when usb_modeswitch is
> already enabled (at least that's what I assume), you could better use:
> 
> config BR2_PACKAGE_USB_MODESWITCH_DATA
>         depends on BR2_PACKAGE_USB_MODESWITCH
> 
> With this expression, usb_modeswitch_data will not be visible unless
> usb_modeswitch has already been enabled. This makes sense. Any
> dependency that usb_modeswitch has will also be met when
> usb_modeswitch_data has been selected.

 I think the general trend is to prefer select rather than depends when
they are separate packages - precisely because this avoids the potential
inconsistencies you mentioned.  Take libusb-compat, for instance.  It's
obviously an extension of libusb, but because libusb-compat selects libusb,
it makes it easy and safe for other packages to select libusb-compat.

 Sorry for the inconsistent feedback, J.C.

 Regards,
 Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

      parent reply	other threads:[~2012-02-11 16:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09 23:51 [Buildroot] [PATCH] new program: usb_modeswitch_data Signed-off-by: J.C. Woltz <jwoltz@gmail.com> J.C. Woltz
2012-02-10  7:37 ` Thomas De Schampheleire
2012-02-10 14:21   ` J.C. Woltz
2012-02-10 14:46     ` Thomas De Schampheleire
2012-02-10 15:02       ` J.C. Woltz
2012-02-10 15:10         ` Yegor Yefremov
2012-02-11 16:41       ` Arnout Vandecappelle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201202111741.05348.arnout@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.