3 # Copyright OpenEmbedded Contributors
5 # SPDX-License-Identifier: GPL-2.0-only
11 echo -e "Usage: $base command"
12 echo "Avaliable commands:"
13 echo -e "\texport <file.conf>: export and lock down the AUTOPR values from the PR service into a file for release."
14 echo -e "\timport <file.conf>: import the AUTOPR values from the exported file into the PR service."
19 s
=`bitbake -e | grep ^CACHE= | cut -f2 -d\"`
20 # Stop any active memory resident server
22 # Remove cache entries since we want to trigger a full reparse
23 if [ "x${s}" != "x" ]; then
24 rm -f ${s}/bb_cache
*.dat.
*
31 [ "x${file}" == "x" ] && help && exit 1
35 bitbake
-R conf
/prexport.conf
-p
36 s
=`bitbake -R conf/prexport.conf -e | grep ^PRSERV_DUMPFILE= | cut -f2 -d\"`
37 if [ "x${s}" != "x" ];
39 [ -e $s ] && mv -f $s $file && echo "Exporting to file $file succeeded!"
42 echo "Exporting to file $file failed!"
49 [ "x${file}" == "x" ] && help && exit 1
52 bitbake
-R conf
/primport.conf
-R $file -p
54 [ $ret -eq 0 ] && echo "Importing from file $file succeeded!" ||
echo "Importing from file $file failed!"
58 do_migrate_localcount
()
60 df
=`bitbake -R conf/migrate_localcount.conf -e | \
61 grep ^LOCALCOUNT_DUMPFILE= | cut -f2 -d\"`
62 if [ "x${df}" == "x" ];
64 echo "LOCALCOUNT_DUMPFILE is not defined!"
70 echo "Exporting LOCALCOUNT to AUTOINCs..."
71 bitbake
-R conf
/migrate_localcount.conf
-p
72 [ ! $?
-eq 0 ] && echo "Exporting to file $df failed!" && exit 1
76 echo "Exporting to file $df succeeded!"
78 echo "Exporting to file $df failed!"
82 echo "Importing generated AUTOINC entries..."
83 [ -e $df ] && do_import
$df
87 echo "Migration from LOCALCOUNT to AUTOINCs failed!"
91 echo "Migration from LOCALCOUNT to AUTOINCs succeeded!"
95 [ $# -eq 0 ] && help && exit 1
101 echo ERROR
: $2 must end with .conf or .inc
!
114 do_migrate_localcount