diff options
author | Lianhao Lu <lianhao.lu@intel.com> | 2012-02-28 11:42:55 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-02-28 12:27:23 +0000 |
commit | c3a23ec304e750f82d8a98c2fc507478f03ab965 (patch) | |
tree | ff34bf97c08ac0326cfdc3e6f0dd859ac4f3f6df /scripts/bitbake-prserv-tool | |
parent | ce0ecf5d847b168ad05117cdd1f5fdcc561d770d (diff) | |
download | poky-c3a23ec304e750f82d8a98c2fc507478f03ab965.tar.gz |
scripts/prserv-tool: Adepted to new bitbake cache.
Adepted to the new bitbake cache mechanism which is based on file
content but not on file timp stamps any more.
(From OE-Core rev: c1705317f9456f761da2094e886a07939291e53a)
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 |