mirror of
https://git.yoctoproject.org/git/opkg-utils
synced 2026-07-07 04:52:21 +02:00
opkg-make-index: use ctime instead of mtime
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> Acked-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
This commit is contained in:
committed by
Alejandro del Castillo
parent
a1ff6a8488
commit
0cd38bb1bd
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user