summaryrefslogtreecommitdiffstats
path: root/scripts/bitbake-prserv-tool
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bitbake-prserv-tool')
-rwxr-xr-xscripts/bitbake-prserv-tool47
1 files changed, 6 insertions, 41 deletions
diff --git a/scripts/bitbake-prserv-tool b/scripts/bitbake-prserv-tool
index e55d98c72e..0559c4c38a 100755
--- a/scripts/bitbake-prserv-tool
+++ b/scripts/bitbake-prserv-tool
@@ -1,5 +1,7 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2# 2#
3# Copyright OpenEmbedded Contributors
4#
3# SPDX-License-Identifier: GPL-2.0-only 5# SPDX-License-Identifier: GPL-2.0-only
4# 6#
5 7
@@ -15,8 +17,11 @@ help ()
15clean_cache() 17clean_cache()
16{ 18{
17 s=`bitbake -e | grep ^CACHE= | cut -f2 -d\"` 19 s=`bitbake -e | grep ^CACHE= | cut -f2 -d\"`
20 # Stop any active memory resident server
21 bitbake -m
22 # Remove cache entries since we want to trigger a full reparse
18 if [ "x${s}" != "x" ]; then 23 if [ "x${s}" != "x" ]; then
19 rm -rf ${s} 24 rm -f ${s}/bb_cache*.dat.*
20 fi 25 fi
21} 26}
22 27
@@ -50,43 +55,6 @@ do_import ()
50 return $ret 55 return $ret
51} 56}
52 57
53do_migrate_localcount ()
54{
55 df=`bitbake -R conf/migrate_localcount.conf -e | \
56 grep ^LOCALCOUNT_DUMPFILE= | cut -f2 -d\"`
57 if [ "x${df}" == "x" ];
58 then
59 echo "LOCALCOUNT_DUMPFILE is not defined!"
60 return 1
61 fi
62
63 rm -rf $df
64 clean_cache
65 echo "Exporting LOCALCOUNT to AUTOINCs..."
66 bitbake -R conf/migrate_localcount.conf -p
67 [ ! $? -eq 0 ] && echo "Exporting to file $df failed!" && exit 1
68
69 if [ -e $df ];
70 then
71 echo "Exporting to file $df succeeded!"
72 else
73 echo "Exporting to file $df failed!"
74 exit 1
75 fi
76
77 echo "Importing generated AUTOINC entries..."
78 [ -e $df ] && do_import $df
79
80 if [ ! $? -eq 0 ]
81 then
82 echo "Migration from LOCALCOUNT to AUTOINCs failed!"
83 return 1
84 fi
85
86 echo "Migration from LOCALCOUNT to AUTOINCs succeeded!"
87 return 0
88}
89
90[ $# -eq 0 ] && help && exit 1 58[ $# -eq 0 ] && help && exit 1
91 59
92case $2 in 60case $2 in
@@ -105,9 +73,6 @@ export)
105import) 73import)
106 do_import $2 74 do_import $2
107 ;; 75 ;;
108migrate_localcount)
109 do_migrate_localcount
110 ;;
111*) 76*)
112 help 77 help
113 exit 1 78 exit 1