[Buildroot] [PATCH 3/6] pkg-infra: git helper creates an empty archive if PKG_VERSION is a missing hash
Yann E. MORIN
yann.morin.1998 at free.fr
Tue Jan 14 23:21:26 UTC 2014
Arnout, All,
On 2014-01-14 21:43 +0100, Arnout Vandecappelle spake thusly:
> On 13/01/14 00:44, Yann E. MORIN wrote:
> >From: "Yann E. MORIN" <yann.morin.1998 at free.fr>
[--SNIP--]
> >-${GIT} archive --prefix="${prefix}" --format=tar "${cset}" \
> >-|gzip -c >"${output}"
> >+res=1
> >+if ${GIT} rev-list -n 1 "${cset}" >/dev/null 2>&1; then
>
> When we've done a shallow clone, this check is redundant because we have
> cloned exactly this ref.
>
> So instead, I'd do the check in the full clone condition, with an explicit
> exit.
I see. But it complexifies the script.
And doing the check a second time ensures we did not download garbage
Heck, there's even a race condition, since we check the remote, then
clone it, and the ref may have vanished (granted, very unlikely, but
yet...). :-p
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
More information about the buildroot
mailing list