diff options
Diffstat (limited to 'scripts/bitbake-prserv-tool')
| -rwxr-xr-x | scripts/bitbake-prserv-tool | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/scripts/bitbake-prserv-tool b/scripts/bitbake-prserv-tool deleted file mode 100755 index 0559c4c38a..0000000000 --- a/scripts/bitbake-prserv-tool +++ /dev/null | |||
| @@ -1,80 +0,0 @@ | |||
| 1 | #!/usr/bin/env bash | ||
| 2 | # | ||
| 3 | # Copyright OpenEmbedded Contributors | ||
| 4 | # | ||
| 5 | # SPDX-License-Identifier: GPL-2.0-only | ||
| 6 | # | ||
| 7 | |||
| 8 | help () | ||
| 9 | { | ||
| 10 | base=`basename $0` | ||
| 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." | ||
| 15 | } | ||
| 16 | |||
| 17 | clean_cache() | ||
| 18 | { | ||
| 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 | ||
| 23 | if [ "x${s}" != "x" ]; then | ||
| 24 | rm -f ${s}/bb_cache*.dat.* | ||
| 25 | fi | ||
| 26 | } | ||
| 27 | |||
| 28 | do_export () | ||
| 29 | { | ||
| 30 | file=$1 | ||
| 31 | [ "x${file}" == "x" ] && help && exit 1 | ||
| 32 | rm -f ${file} | ||
| 33 | |||
| 34 | clean_cache | ||
| 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" ]; | ||
| 38 | then | ||
| 39 | [ -e $s ] && mv -f $s $file && echo "Exporting to file $file succeeded!" | ||
| 40 | return 0 | ||
| 41 | fi | ||
| 42 | echo "Exporting to file $file failed!" | ||
| 43 | return 1 | ||
| 44 | } | ||
| 45 | |||
| 46 | do_import () | ||
| 47 | { | ||
| 48 | file=$1 | ||
| 49 | [ "x${file}" == "x" ] && help && exit 1 | ||
| 50 | |||
| 51 | clean_cache | ||
| 52 | bitbake -R conf/primport.conf -R $file -p | ||
| 53 | ret=$? | ||
| 54 | [ $ret -eq 0 ] && echo "Importing from file $file succeeded!" || echo "Importing from file $file failed!" | ||
| 55 | return $ret | ||
| 56 | } | ||
| 57 | |||
| 58 | [ $# -eq 0 ] && help && exit 1 | ||
| 59 | |||
| 60 | case $2 in | ||
| 61 | *.conf|*.inc) | ||
| 62 | ;; | ||
| 63 | *) | ||
| 64 | echo ERROR: $2 must end with .conf or .inc! | ||
| 65 | exit 1 | ||
| 66 | ;; | ||
| 67 | esac | ||
| 68 | |||
| 69 | case $1 in | ||
| 70 | export) | ||
| 71 | do_export $2 | ||
| 72 | ;; | ||
| 73 | import) | ||
| 74 | do_import $2 | ||
| 75 | ;; | ||
| 76 | *) | ||
| 77 | help | ||
| 78 | exit 1 | ||
| 79 | ;; | ||
| 80 | esac | ||
