diff options
Diffstat (limited to 'meta/recipes-devtools/opkg-utils/opkg-utils')
-rw-r--r-- | meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-make-index-use-ctime-instead-of-mtime.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-make-index-use-ctime-instead-of-mtime.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-make-index-use-ctime-instead-of-mtime.patch new file mode 100644 index 0000000000..19778acd2b --- /dev/null +++ b/meta/recipes-devtools/opkg-utils/opkg-utils/0001-opkg-make-index-use-ctime-instead-of-mtime.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From 0cd38bb1bdcdbfc091014a1f39d015a1586a33e6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Stefan Agner <stefan.agner@toradex.com> | ||
3 | Date: Fri, 19 Oct 2018 17:38:21 +0200 | ||
4 | Subject: [PATCH] opkg-make-index: use ctime instead of mtime | ||
5 | |||
6 | Upstream-Status: Backport | ||
7 | |||
8 | When using sstate, two parallel builds can produce two packages | ||
9 | with the same mtime but different checksums. When later one of | ||
10 | those two builds fetches the others ipk, the package index does | ||
11 | not get udpated properly (since mtime matches). This ends up with | ||
12 | messages such as: | ||
13 | Downloading file:/../tmp/work/../image/...ipk. | ||
14 | Removing corrupt package file /../sysroot/../var/cache/opkg/volatile/...ipk | ||
15 | |||
16 | However, in that case, ctime is different. Use ctime instead of | ||
17 | mtime to prevent failures like this. | ||
18 | |||
19 | Suggested-by: Khem Raj <raj.khem@gmail.com> | ||
20 | Signed-off-by: Stefan Agner <stefan.agner@toradex.com> | ||
21 | Acked-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
22 | Acked-by: Khem Raj <raj.khem@gmail.com> | ||
23 | Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com> | ||
24 | Signed-off-by: Ming Liu <liu.ming50@gmail.com> | ||
25 | --- | ||
26 | opkg-make-index | 6 +++--- | ||
27 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
28 | |||
29 | diff --git a/opkg-make-index b/opkg-make-index | ||
30 | index 3227fc0..db7bf64 100755 | ||
31 | --- a/opkg-make-index | ||
32 | +++ b/opkg-make-index | ||
33 | @@ -115,12 +115,12 @@ for abspath in files: | ||
34 | pkg = None | ||
35 | fnameStat = os.stat(abspath) | ||
36 | if filename in old_pkg_hash: | ||
37 | - if filename in pkgsStamps and int(fnameStat.st_mtime) == pkgsStamps[filename]: | ||
38 | + if filename in pkgsStamps and int(fnameStat.st_ctime) == pkgsStamps[filename]: | ||
39 | if (verbose): | ||
40 | sys.stderr.write("Found %s in Packages\n" % (filename,)) | ||
41 | pkg = old_pkg_hash[filename] | ||
42 | else: | ||
43 | - sys.stderr.write("Found %s in Packages, but mtime differs - re-reading\n" % (filename,)) | ||
44 | + sys.stderr.write("Found %s in Packages, but ctime differs - re-reading\n" % (filename,)) | ||
45 | |||
46 | if not pkg: | ||
47 | if (verbose): | ||
48 | @@ -137,7 +137,7 @@ for abspath in files: | ||
49 | else: | ||
50 | old_filename = "" | ||
51 | s = packages.add_package(pkg, opt_a) | ||
52 | - pkgsStamps[filename] = fnameStat.st_mtime | ||
53 | + pkgsStamps[filename] = fnameStat.st_ctime | ||
54 | if s == 0: | ||
55 | if old_filename: | ||
56 | # old package was displaced by newer | ||
57 | -- | ||
58 | 2.7.4 | ||
59 | |||