diff options
Diffstat (limited to 'scripts/bitbake-prserv-tool')
-rwxr-xr-x | scripts/bitbake-prserv-tool | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/scripts/bitbake-prserv-tool b/scripts/bitbake-prserv-tool index 6c0584c01e..f3855df0cc 100755 --- a/scripts/bitbake-prserv-tool +++ b/scripts/bitbake-prserv-tool | |||
@@ -9,16 +9,23 @@ help () | |||
9 | echo -e "\timport <file>: import the AUTOPR values from the exported file into the PR service." | 9 | echo -e "\timport <file>: import the AUTOPR values from the exported file into the PR service." |
10 | } | 10 | } |
11 | 11 | ||
12 | export () | 12 | clean_cache() |
13 | { | ||
14 | s=`bitbake -e | grep ^CACHE= | cut -f2 -d\"` | ||
15 | if [ "x${s}" != "x" ]; then | ||
16 | rm -rf ${s} | ||
17 | fi | ||
18 | } | ||
19 | |||
20 | do_export () | ||
13 | { | 21 | { |
14 | file=$1 | 22 | file=$1 |
15 | [ "x${file}" == "x" ] && help && exit 1 | 23 | [ "x${file}" == "x" ] && help && exit 1 |
16 | rm -f ${file} | 24 | rm -f ${file} |
17 | 25 | ||
18 | touch dummy.inc | 26 | clean_cache |
19 | bitbake -R conf/prexport.conf -R dummy.inc -p | 27 | bitbake -R conf/prexport.conf -p |
20 | s=`bitbake -R conf/prexport.conf -R dummy.inc -e | grep ^PRSERV_DUMPFILE= | cut -f2 -d\"` | 28 | s=`bitbake -R conf/prexport.conf -e | grep ^PRSERV_DUMPFILE= | cut -f2 -d\"` |
21 | rm -f dummy.inc | ||
22 | if [ "x${s}" != "x" ]; | 29 | if [ "x${s}" != "x" ]; |
23 | then | 30 | then |
24 | [ -e $s ] && mv -f $s $file && echo "Exporting to file $file succeeded!" | 31 | [ -e $s ] && mv -f $s $file && echo "Exporting to file $file succeeded!" |
@@ -28,15 +35,14 @@ export () | |||
28 | return 1 | 35 | return 1 |
29 | } | 36 | } |
30 | 37 | ||
31 | import () | 38 | do_import () |
32 | { | 39 | { |
33 | file=$1 | 40 | file=$1 |
34 | [ "x${file}" == "x" ] && help && exit 1 | 41 | [ "x${file}" == "x" ] && help && exit 1 |
35 | 42 | ||
36 | touch dummy.inc | 43 | clean_cache |
37 | bitbake -R conf/primport.conf -R dummy.inc -R $file -p | 44 | bitbake -R conf/primport.conf -R $file -p |
38 | ret=$? | 45 | ret=$? |
39 | rm -f dummy.inc | ||
40 | [ $ret -eq 0 ] && echo "Importing from file $file succeeded!" || echo "Importing from file $file failed!" | 46 | [ $ret -eq 0 ] && echo "Importing from file $file succeeded!" || echo "Importing from file $file failed!" |
41 | return $ret | 47 | return $ret |
42 | } | 48 | } |
@@ -45,10 +51,10 @@ import () | |||
45 | 51 | ||
46 | case $1 in | 52 | case $1 in |
47 | export) | 53 | export) |
48 | export $2 | 54 | do_export $2 |
49 | ;; | 55 | ;; |
50 | import) | 56 | import) |
51 | import $2 | 57 | do_import $2 |
52 | ;; | 58 | ;; |
53 | *) | 59 | *) |
54 | help | 60 | help |