All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/4] core: add generic support for lz archives
Date: Sun, 12 Feb 2017 22:07:53 +0200	[thread overview]
Message-ID: <20170212200753.bfpudufftk5lhelp@tarshish> (raw)
In-Reply-To: <CAAXf6LXPLcVSVXjzvzNBsvisp1H0E4YtAVDAeJuuQqj6NBz9fQ@mail.gmail.com>

Hi Thomas,

On Sat, Feb 11, 2017 at 10:16:20PM +0100, Thomas De Schampheleire wrote:
> On Fri, Feb 10, 2017 at 6:52 AM, Baruch Siach <baruch@tkos.co.il> wrote:
> > +# host-extractor(filename): same as suitable-extractor, but filter out
> > +# extractors we build when the host lacks one.
> > +host-extractor = $(INFLATE$(filter-out .lz .lzma .xz,$(suffix $(1))))
> 
> suitable-extractor and host-extractor now render different output for
> a given file which makes no sense in general for functions named like
> this. You only need the different output to decide whether extra
> dependency checks need to be done, not to determine what the extractor
> is.
> 
> Also, the list of extensions is kind of 'magic' and not immediately
> linked with the changes in support/dependencies (this was already true
> with the original situation, true). It would be great if the
> exceptions could be steered from the check-host-foo.mk files directly,
> which is the conceptually right place: when that file exists it will
> take over all checking, if it does not then the checking is done in
> the standard DL_TOOLS_DEPENDENCIES.
> 
> I thought hard on a way to attack the problem without needing to know
> the extensions and more in line with the original change, but it is
> not easy due to the fact that XZCAT and such can contain spaces which
> does not fit well with make.
> For clarity, I wanted to let check-host-xz.mk append to a new variable, e.g.
>     DL_TOOLS_DEPENDENCIES_PRECHECKED_VARS += $(XZCAT)
> and in pkg-generic.mk use this list to drive the exceptions:
>     ifeq (,$$(filter $$(call
> suitable-extractor,$$($(2)_SOURCE)),$$(DL_TOOLS_DEPENDENCIES_PRECHECKED_VARS)))
>     DL_TOOLS_DEPENDENCIES += $$(firstword $$(call
> suitable-extractor,$$($(2)_SOURCE)))
>     endif
> This could work if we first replace all spaces with another character,
> both when appending to DL_TOOLS_DEPENDENCIES_PRECHECKED_VARS as in the
> first argument of the filter function.
> But perhaps it makes things too complex.

Indeed.

> An alternative is to stick closer to your proposal, but with some changes:
> - let check-host-foo.mk define the list of extensions that it handles
> instead of the magic list, e.g.
>   EXTRACTOR_DEPENDENCY_PRECHECKED_EXTENSIONS += .xz
> - rename host-extractor to something else, e.g. extractor-dependency
> - perhaps it makes sense to let extractor-dependency handle the
> $(firstword) call
> 
> Given my input, what do you think?

I like your second suggestion better. Patches follow.

> Separate note: it could make sense to split this patch in two: one to
> refactor the handing of the dependencies, and a second one to cover
> lz7.

I agree.

Thanks for reviewing,
baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

      parent reply	other threads:[~2017-02-12 20:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-10  5:52 [Buildroot] [PATCH 1/4] core: add generic support for lz archives Baruch Siach
2017-02-10  5:52 ` [Buildroot] [PATCH 2/4] ed: use generic extract command Baruch Siach
2017-02-10 14:12   ` Peter Seiderer
2017-02-10  5:52 ` [Buildroot] [PATCH 3/4] ddrescue: " Baruch Siach
2017-02-10 14:12   ` Peter Seiderer
2017-02-10  5:52 ` [Buildroot] [PATCH 4/4] ocrad: " Baruch Siach
2017-02-10 14:13   ` Peter Seiderer
2017-02-10 14:11 ` [Buildroot] [PATCH 1/4] core: add generic support for lz archives Peter Seiderer
2017-02-11 21:16 ` Thomas De Schampheleire
     [not found]   ` <CAAXf6LXmYoo0mSdf6-uvMQtLwv0nP2D0WO8t7omkyy4CkeiStg@mail.gmail.com>
2017-02-12  6:48     ` Thomas De Schampheleire
2017-02-12 20:07   ` Baruch Siach [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=20170212200753.bfpudufftk5lhelp@tarshish \
    --to=baruch@tkos.co.il \
    --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.