All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] support/download: protect from custom commands with spaces in args
Date: Mon, 25 Jan 2016 21:45:52 +0900	[thread overview]
Message-ID: <20160125124552.GA12615@jack.zhora.eu> (raw)
In-Reply-To: <20160124154921.GC3405@free.fr>

Hi Yann,

> > > Some users may provide custom download commands with spaces
> > > in their
> > > arguments, like so:
> > >     BR2_HG="hg --config foo.bar='some space-separated
> > >     value'"
> >
> > this patch is breaking the build. With configs like this:
> >
> > BR2_LINUX_KERNEL=y
> > BR2_LINUX_KERNEL_CUSTOM_GIT=y
> > BR2_LINUX_KERNEL_CUSTOM_REPO_URL="git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
> > BR2_LINUX_KERNEL_DEFCONFIG="exynos"
> > BR2_LINUX_KERNEL_DTS_SUPPORT=y
> > BR2_LINUX_KERNEL_INTREE_DTS_NAME="exynos5422-odroidxu4"
>
> You forgot to specify a kernel version here, which is the
> ultimate
> reason for the failure.
>
> It does not make sense to use a git tree without specifying
> either a tag
> or a sha1 to checkout.

actually I haven't forgotten, but I normally expect to clone
master out of a git clone without having specified any
branch/sha1/tag (the way it was working before).

Indeed, by setting

BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="master"

it worked.

> > the command sent is:
> >
> > git clone --mirror
> > 'git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git'
> > ''
> >
> > git dosn't like empty strngs and provides this output:
> >
> > fatal: The empty string is not a valid path
> >
> > Besides, I have never seen spaces in branch name,
> > repositories
> > names and it is quite a corner case. I think this patch
> > should be
> > reverted (at least) in the case of git.
>
> No, the patch is correct. What we should however check is that
> the
> version string is not empty, and bail out on that error
> instead.
>
> Somehow, when the user forgets to specify a version string, we
> call the
> download scripts with no basename, and the empty string you see
> in the
> git call above should have been the basename of the directory
> to clone
> into, i.e. something like:  linux-VERSION/

I think that buildroot should not fail if the version is not
specified, but go ahead with a default solution, which can be
master.

Something like this, perhaps?

 linux/linux.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/linux/linux.mk b/linux/linux.mk
index 3c53a0b..61f7468 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -20,6 +20,11 @@ LINUX_SITE_METHOD = local
 else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_GIT),y)
 LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
 LINUX_SITE_METHOD = git
+
+ifeq ($(strip $(LINUX_VERSION)),)
+LINUX_VERSION = "master"
+endif
+
 else ifeq ($(BR2_LINUX_KERNEL_CUSTOM_HG),y)
 LINUX_SITE = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_REPO_URL))
 LINUX_SITE_METHOD = hg

Thanks,
Andi

  reply	other threads:[~2016-01-25 12:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07  9:26 [Buildroot] [PATCH] support/download: protect from custom commands with spaces in args Yann E. MORIN
2015-12-11 10:06 ` Thomas De Schampheleire
2015-12-12 16:01 ` Thomas Petazzoni
     [not found] ` <20160124020636.GA1387@jack.zhora.eu>
2016-01-24 15:49   ` Yann E. MORIN
2016-01-25 12:45     ` Andi Shyti [this message]
2016-01-25 13:19       ` Thomas De Schampheleire

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=20160125124552.GA12615@jack.zhora.eu \
    --to=andi.shyti@gmail.com \
    --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.