diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/bitbake-prserv-tool | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/bitbake-prserv-tool b/scripts/bitbake-prserv-tool index f3855df0cc..4654e6d421 100755 --- a/scripts/bitbake-prserv-tool +++ b/scripts/bitbake-prserv-tool | |||
| @@ -47,6 +47,35 @@ do_import () | |||
| 47 | return $ret | 47 | return $ret |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | do_migrate_localcount () | ||
| 51 | { | ||
| 52 | df=`bitbake -R conf/migrate_localcount.conf -e | \ | ||
| 53 | grep ^LOCALCOUNT_DUMPFILE= | cut -f2 -d\"` | ||
| 54 | if [ "x${df}" == "x" ]; | ||
| 55 | then | ||
| 56 | echo "LOCALCOUNT_DUMPFILE is not defined!" | ||
| 57 | return 1 | ||
| 58 | fi | ||
| 59 | |||
| 60 | rm -rf $df | ||
| 61 | clean_cache | ||
| 62 | echo "Exporting LOCALCOUNT to AUTOINCs..." | ||
| 63 | bitbake -R conf/migrate_localcount.conf -p | ||
| 64 | [ ! $? -eq 0 ] && echo "Exporting failed!" && exit 1 | ||
| 65 | |||
| 66 | echo "Importing generated AUTOINC entries..." | ||
| 67 | [ -e $df ] && do_import $df | ||
| 68 | |||
| 69 | if [ ! $? -eq 0 ] | ||
| 70 | then | ||
| 71 | echo "Migration from LOCALCOUNT to AUTOINCs failed!" | ||
| 72 | return 1 | ||
| 73 | fi | ||
| 74 | |||
| 75 | echo "Migration from LOCALCOUNT to AUTOINCs succeeded!" | ||
| 76 | return 0 | ||
| 77 | } | ||
| 78 | |||
| 50 | [ $# -eq 0 ] && help && exit 1 | 79 | [ $# -eq 0 ] && help && exit 1 |
| 51 | 80 | ||
| 52 | case $1 in | 81 | case $1 in |
| @@ -56,6 +85,9 @@ export) | |||
| 56 | import) | 85 | import) |
| 57 | do_import $2 | 86 | do_import $2 |
| 58 | ;; | 87 | ;; |
| 88 | migrate_localcount) | ||
| 89 | do_migrate_localcount | ||
| 90 | ;; | ||
| 59 | *) | 91 | *) |
| 60 | help | 92 | help |
| 61 | exit 1 | 93 | exit 1 |
