diff options
author | Ricardo Ribalda Delgado <ricardo@ribalda.com> | 2020-04-05 13:47:12 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-04-06 16:45:11 +0100 |
commit | c4cd85ca3e07e1bcc2a55dfd519f62b6e7a596d6 (patch) | |
tree | 9ddbf67c55c54d0fc69cfa0a7d5242d12f8f3d50 /meta | |
parent | 242412656b8c7bd684ebca3da71a0d07cd69a830 (diff) | |
download | poky-c4cd85ca3e07e1bcc2a55dfd519f62b6e7a596d6.tar.gz |
pseudo: During DB fix, remove files that do not exist
If a file does not exist, either because it has been removed outside
bitbake, or because only some of the files have been moved to a
different location, delete it from the pseudo-db is the user decides to
fix the database.
(From OE-Core rev: 79f7212ae71a4eb9e7abfe2c333b035ccc10e5c5)
Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/pseudo/files/0001-pseudo-On-a-DB-fixup-remove-files-that-do-not-exist-.patch | 49 | ||||
-rw-r--r-- | meta/recipes-devtools/pseudo/pseudo_git.bb | 1 |
2 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/0001-pseudo-On-a-DB-fixup-remove-files-that-do-not-exist-.patch b/meta/recipes-devtools/pseudo/files/0001-pseudo-On-a-DB-fixup-remove-files-that-do-not-exist-.patch new file mode 100644 index 0000000000..9c49e33b02 --- /dev/null +++ b/meta/recipes-devtools/pseudo/files/0001-pseudo-On-a-DB-fixup-remove-files-that-do-not-exist-.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From b0902e36108b49e6bc88d6b251cc2f8cffcd5a13 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ricardo Ribalda <ricardo@ribalda.com> | ||
3 | Date: Sun, 5 Apr 2020 11:40:30 +0000 | ||
4 | Subject: [PATCH] pseudo: On a DB fixup remove files that do not exist anymore | ||
5 | |||
6 | If the user decides to fix a database, remove the files that do not | ||
7 | exist anymore. | ||
8 | If only DB test is selected do not change the behaviour (return error). | ||
9 | |||
10 | Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com> | ||
11 | Upstream-Status: Submitted [https://lists.openembedded.org/g/openembedded-core/message/137045] | ||
12 | --- | ||
13 | pseudo.c | 13 ++++++++++--- | ||
14 | 1 file changed, 10 insertions(+), 3 deletions(-) | ||
15 | |||
16 | diff --git a/pseudo.c b/pseudo.c | ||
17 | index 0f5850e..98e5b0c 100644 | ||
18 | --- a/pseudo.c | ||
19 | +++ b/pseudo.c | ||
20 | @@ -1087,9 +1087,15 @@ pseudo_db_check(int fix) { | ||
21 | int fixup_needed = 0; | ||
22 | pseudo_debug(PDBGF_DB, "Checking <%s>\n", m->path); | ||
23 | if (lstat(m->path, &buf)) { | ||
24 | - errors = EXIT_FAILURE; | ||
25 | - pseudo_diag("can't stat <%s>\n", m->path); | ||
26 | - continue; | ||
27 | + if (!fix) { | ||
28 | + pseudo_diag("can't stat <%s>\n", m->path); | ||
29 | + errors = EXIT_FAILURE; | ||
30 | + continue; | ||
31 | + } else { | ||
32 | + pseudo_debug(PDBGF_DB, "can't stat <%s>\n", m->path); | ||
33 | + fixup_needed = 2; | ||
34 | + goto do_fixup; | ||
35 | + } | ||
36 | } | ||
37 | /* can't check for device type mismatches, uid/gid, or | ||
38 | * permissions, because those are the very things we | ||
39 | @@ -1125,6 +1131,7 @@ pseudo_db_check(int fix) { | ||
40 | S_ISDIR(m->mode)); | ||
41 | fixup_needed = 2; | ||
42 | } | ||
43 | + do_fixup: | ||
44 | if (fixup_needed) { | ||
45 | /* in fixup mode, either delete (mismatches) or | ||
46 | * correct (dev/ino). | ||
47 | -- | ||
48 | 2.21.1 | ||
49 | |||
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb index 89e43c5996..a3049c5e6c 100644 --- a/meta/recipes-devtools/pseudo/pseudo_git.bb +++ b/meta/recipes-devtools/pseudo/pseudo_git.bb | |||
@@ -11,6 +11,7 @@ SRC_URI = "git://git.yoctoproject.org/pseudo \ | |||
11 | file://0001-realpath.c-Remove-trailing-slashes.patch \ | 11 | file://0001-realpath.c-Remove-trailing-slashes.patch \ |
12 | file://0006-xattr-adjust-for-attr-2.4.48-release.patch \ | 12 | file://0006-xattr-adjust-for-attr-2.4.48-release.patch \ |
13 | file://seccomp.patch \ | 13 | file://seccomp.patch \ |
14 | file://0001-pseudo-On-a-DB-fixup-remove-files-that-do-not-exist-.patch \ | ||
14 | " | 15 | " |
15 | 16 | ||
16 | SRCREV = "060058bb29f70b244e685b3c704eb0641b736f73" | 17 | SRCREV = "060058bb29f70b244e685b3c704eb0641b736f73" |