diff options
author | Lianhao Lu <lianhao.lu@intel.com> | 2011-12-22 15:29:11 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-01-11 10:37:43 +0000 |
commit | a05e3a57c6f567578faeb31fae89b20e22850af4 (patch) | |
tree | 0fb66b3c74a9c011190179f0004024be5927570c /scripts | |
parent | 6bde156c5ce58c8e55cd6f5fd5f87982a919ba34 (diff) | |
download | poky-a05e3a57c6f567578faeb31fae89b20e22850af4.tar.gz |
meta/PRService: Added export/import fuctions.
[YOCTO #1556]
- Modified meta/class/package.bbclass and prserv.bbclass according to
the change in PR service by adding PACKAGE_ARCH into the query tuple.
- Added prexport.bbclass, primport.bbclass to export/import AUTOPR
values from/to PRService.
- Move PR service related common code to lib/oe/prservice.py.
- Supported reading the AUTOPR values from the exported .inc file
instead of reading it from remote PR service.
- Created a new script bitbake-prserv-tool to export/import the AUTOPR
values from/to the PR service.
Typical usage scenario of the export/import is:
1. bitbake-prserv-tool export <file> to export the AUTOPR values from
the current PR service into an exported .inc file.
2. Others may use that exported .inc file(to be included in the
local.conf) to lockdown and reproduce the same AUTOPR when generating
package feeds.
3. Others may "bitbake-prserv-tool import <file>" to import the AUTOPR
values into their own PR service and the AUTOPR values will be
incremented from there.
(From OE-Core rev: 9979107d8eaf503efd921564385859b1e83dbb3c)
Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/bitbake-prserv-tool | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/scripts/bitbake-prserv-tool b/scripts/bitbake-prserv-tool new file mode 100755 index 0000000000..6c0584c01e --- /dev/null +++ b/scripts/bitbake-prserv-tool | |||
@@ -0,0 +1,57 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | help () | ||
4 | { | ||
5 | base=`basename $0` | ||
6 | echo -e "Usage: $base command" | ||
7 | echo "Avaliable commands:" | ||
8 | echo -e "\texport <file>: export and lock down the AUTOPR values from the PR service into a file for release." | ||
9 | echo -e "\timport <file>: import the AUTOPR values from the exported file into the PR service." | ||
10 | } | ||
11 | |||
12 | export () | ||
13 | { | ||
14 | file=$1 | ||
15 | [ "x${file}" == "x" ] && help && exit 1 | ||
16 | rm -f ${file} | ||
17 | |||
18 | touch dummy.inc | ||
19 | bitbake -R conf/prexport.conf -R dummy.inc -p | ||
20 | s=`bitbake -R conf/prexport.conf -R dummy.inc -e | grep ^PRSERV_DUMPFILE= | cut -f2 -d\"` | ||
21 | rm -f dummy.inc | ||
22 | if [ "x${s}" != "x" ]; | ||
23 | then | ||
24 | [ -e $s ] && mv -f $s $file && echo "Exporting to file $file succeeded!" | ||
25 | return 0 | ||
26 | fi | ||
27 | echo "Exporting to file $file failed!" | ||
28 | return 1 | ||
29 | } | ||
30 | |||
31 | import () | ||
32 | { | ||
33 | file=$1 | ||
34 | [ "x${file}" == "x" ] && help && exit 1 | ||
35 | |||
36 | touch dummy.inc | ||
37 | bitbake -R conf/primport.conf -R dummy.inc -R $file -p | ||
38 | ret=$? | ||
39 | rm -f dummy.inc | ||
40 | [ $ret -eq 0 ] && echo "Importing from file $file succeeded!" || echo "Importing from file $file failed!" | ||
41 | return $ret | ||
42 | } | ||
43 | |||
44 | [ $# -eq 0 ] && help && exit 1 | ||
45 | |||
46 | case $1 in | ||
47 | export) | ||
48 | export $2 | ||
49 | ;; | ||
50 | import) | ||
51 | import $2 | ||
52 | ;; | ||
53 | *) | ||
54 | help | ||
55 | exit 1 | ||
56 | ;; | ||
57 | esac | ||