All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 4/4] pkg-download: check hasahes for locally cached files
Date: Sat, 6 Dec 2014 13:53:09 +0100	[thread overview]
Message-ID: <20141206135309.016c7151@free-electrons.com> (raw)
In-Reply-To: <20141206124441.GC9544@free.fr>

Dear Yann E. MORIN,

On Sat, 6 Dec 2014 13:44:41 +0100, Yann E. MORIN wrote:

> Please also note that this in fact does not change the current
> behaviour. Even today, we are checking the hashes for locally cached
> files, so this solution adds no overhead.
> 
> To understand why, here's a summary of what happened before and after
> thise series:
> 
>     before:                         after:
> 
>     check if file is cached         check if the file is cached
>     if not cached,                  if cached,
>         download the file               check the hashes
>     check the hashes                    if match,
>                                             stop
>                                         rm cached file
>                                     downlaod file
>                                     check hashes
> 
> So, as you can see, in case the file is already cached locally, and the
> hashes match, we don't do much more than today, except the checks are
> not done in the same order, which allows us to attempt a re-download in
> case of hash mismatch.

define DOWNLOAD_WGET
        test -e $(DL_DIR)/$(2) || \
        $(EXTRA_ENV) support/download/wrapper wget \
                $(DL_DIR)/$(2) \
                '$(call qstrip,$(1))' && \
        $(call VERIFY_HASH,$(PKGDIR)/$($(PKG)_NAME).hash,$(DL_DIR)/$(2))
endef


Hum, the construct 

	test -e <foo> || download && check-hash

is not very easy to understand in terms of priorities, but indeed,
regardless of whether the download is executed or not, the check-hash
part is executed.

Thanks for the explanation!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-12-06 12:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-01 23:24 [Buildroot] [PATCH 0/4] pkg-download: check hashes before the download (branch yem/download-hash) Yann E. MORIN
2014-12-01 23:24 ` [Buildroot] [PATCH 1/4] pkg-download: check for already downloaded file in the download wrapper Yann E. MORIN
2014-12-02  8:26   ` Thomas Petazzoni
2014-12-03 18:43     ` Yann E. MORIN
2014-12-01 23:24 ` [Buildroot] [PATCH 2/4] pkg-download: fix arguments to hash checking script Yann E. MORIN
2014-12-01 23:24 ` [Buildroot] [PATCH 3/4] pkg-download: verify the hashes from the download wrapper Yann E. MORIN
2014-12-02  8:29   ` Thomas Petazzoni
2014-12-03 18:45     ` Yann E. MORIN
2014-12-01 23:24 ` [Buildroot] [PATCH 4/4] pkg-download: check hasahes for locally cached files Yann E. MORIN
2014-12-02  8:31   ` Thomas Petazzoni
2014-12-02  9:27     ` Peter Korsgaard
2014-12-02  9:30       ` Thomas Petazzoni
2014-12-03 18:51     ` Yann E. MORIN
2014-12-06 12:44       ` Yann E. MORIN
2014-12-06 12:53         ` Thomas Petazzoni [this message]
2014-12-07 10:47           ` Yann E. MORIN

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=20141206135309.016c7151@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.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.