All of lore.kernel.org
 help / color / mirror / Atom feed
From: richard.purdie@linuxfoundation.org
To: Stefan Agner <stefan@agner.ch>,
	opkg-devel@googlegroups.com,  alejandro.delcastillo@ni.com,
	yocto@yoctoproject.org
Cc: ricardo@foundries.io, Stefan Agner <stefan.agner@toradex.com>,
	openembedded-core@lists.openembedded.org
Subject: Re: [opkg-utils PATCH] opkg-make-index: use ctime instead of mtime
Date: Sat, 20 Oct 2018 10:16:14 +0100	[thread overview]
Message-ID: <a1d9ca7b7bfa913983b356b854e0170967a55b57.camel@linuxfoundation.org> (raw)
In-Reply-To: <20181019153821.21177-1-stefan@agner.ch>

On Fri, 2018-10-19 at 17:38 +0200, Stefan Agner wrote:
> From: Stefan Agner <stefan.agner@toradex.com>
> 
> When using sstate, two parallel builds can produce two packages
> with the same mtime but different checksums. When later one of
> those two builds fetches the others ipk, the package index does
> not get udpated properly (since mtime matches). This ends up with
> messages such as:
>   Downloading file:/../tmp/work/../image/...ipk.
>   Removing corrupt package file
> /../sysroot/../var/cache/opkg/volatile/...ipk
> 
> However, in that case, ctime is different. Use ctime instead of
> mtime to prevent failures like this.
> 
> Suggested-by: Khem Raj <raj.khem@gmail.com>
> Signed-off-by: Stefan Agner <stefan.agner@toradex.com>

Acked-by: Richard Purdie <richard.purdie@linuxfoundation.org>

(I've been following this problem and this makes sense to me)

> ---
> This addresses the issue discussed here:
> 
http://lists.openembedded.org/pipermail/openembedded-core/2018-October/156348.html
> 
>  opkg-make-index | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/opkg-make-index b/opkg-make-index
> index 3227fc0..db7bf64 100755
> --- a/opkg-make-index
> +++ b/opkg-make-index
> @@ -115,12 +115,12 @@ for abspath in files:
>       pkg = None
>       fnameStat = os.stat(abspath)
>       if filename in old_pkg_hash:
> -          if filename in pkgsStamps and int(fnameStat.st_mtime) ==
> pkgsStamps[filename]:
> +          if filename in pkgsStamps and int(fnameStat.st_ctime) ==
> pkgsStamps[filename]:
>              if (verbose):
>                 sys.stderr.write("Found %s in Packages\n" %
> (filename,))
>              pkg = old_pkg_hash[filename]
>            else:
> -               sys.stderr.write("Found %s in Packages, but mtime
> differs - re-reading\n" % (filename,))
> +               sys.stderr.write("Found %s in Packages, but ctime
> differs - re-reading\n" % (filename,))
>  
>       if not pkg:
>            if (verbose):
> @@ -137,7 +137,7 @@ for abspath in files:
>       else:
>            old_filename = ""
>       s = packages.add_package(pkg, opt_a)
> -     pkgsStamps[filename] = fnameStat.st_mtime
> +     pkgsStamps[filename] = fnameStat.st_ctime
>       if s == 0:
>            if old_filename:
>                 # old package was displaced by newer



  reply	other threads:[~2018-10-20  9:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-19 15:38 [opkg-utils PATCH] opkg-make-index: use ctime instead of mtime Stefan Agner
2018-10-19 15:38 ` Stefan Agner
2018-10-20  9:16 ` richard.purdie [this message]
2018-10-20 14:07   ` Khem Raj
2018-10-20 14:07     ` Khem Raj
2018-10-22 14:45 ` [opkg-devel] " Alejandro Del Castillo
2018-11-07 12:07   ` Stefan Agner
2018-11-07 15:21     ` Alejandro Del Castillo

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=a1d9ca7b7bfa913983b356b854e0170967a55b57.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=alejandro.delcastillo@ni.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=opkg-devel@googlegroups.com \
    --cc=ricardo@foundries.io \
    --cc=stefan.agner@toradex.com \
    --cc=stefan@agner.ch \
    --cc=yocto@yoctoproject.org \
    /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.