[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    [OE-core] [PATCH] scripts/bitbake-prserv-tool: Fix to work with memres bitbake
From:       "Richard Purdie" <richard.purdie () linuxfoundation ! org>
Date:       2023-01-29 15:54:57
Message-ID: 20230129155457.2816600-1-richard.purdie () linuxfoundation ! org
[Download RAW message or body]

Content-Transfer-Encoding: 8bit

Deleting data files whilst bitbake is running isn't a great idea.

Make sure memory resident bitbake is stopped if present and make
the file deletions a little more specific and safer too while we're
here.

Note: The cache directory layout is different on older releases (some
are split level) so this won't be a direct backport to some.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/bitbake-prserv-tool | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/bitbake-prserv-tool b/scripts/bitbake-prserv-tool
index bed97bd8ac3..80028342b16 100755
--- a/scripts/bitbake-prserv-tool
+++ b/scripts/bitbake-prserv-tool
@@ -17,8 +17,11 @@ help ()
 clean_cache()
 {
     s=`bitbake -e | grep ^CACHE= | cut -f2 -d\"`
+    # Stop any active memory resident server
+    bitbake -m
+    # Remove cache entries since we want to trigger a full reparse
     if [ "x${s}" != "x" ]; then
-        rm -rf ${s}
+        rm -f ${s}/bb_cache*.dat.*
     fi
 }
 
@@ -62,7 +65,7 @@ do_migrate_localcount ()
         return 1
     fi
 
-    rm -rf $df
+    rm -f $df
     clean_cache
     echo "Exporting LOCALCOUNT to AUTOINCs..."
     bitbake -R conf/migrate_localcount.conf -p
-- 
2.37.2



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#176477): https://lists.openembedded.org/g/openembedded-core/message/176477
Mute This Topic: https://lists.openembedded.org/mt/96607559/4454766
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [openembedded-core@marc.info]
-=-=-=-=-=-=-=-=-=-=-=-



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic