Skip to contentSkip to conversation

bitbake-prserv-tool: show error when export file does not exist

PATCH In review Martin Jansa 1 participant 2 messages Feb 6, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bitbake-prserv-tool: show error when export file does not exist

* otherwise it shows error about failing import

---
 scripts/bitbake-prserv-tool | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
scripts/bitbake-prserv-tool +9 -1
index 4654e6d..96a3470 100755
@@ -61,8 +61,16 @@ do_migrate_localcount ()
     clean_cache
     echo "Exporting LOCALCOUNT to AUTOINCs..."
     bitbake -R conf/migrate_localcount.conf -p
-    [ ! $? -eq 0 ] && echo "Exporting failed!" && exit 1
+    [ ! $? -eq 0 ] && echo "Exporting to file $df failed!" && exit 1
 
+    if [ -e $df ];
+    then
+        echo "Exporting to file $df succeeded!"
+    else
+        echo "Exporting to file $df failed!"
+        exit 1
+    fi
+    
     echo "Importing generated AUTOINC entries..."
     [ -e $df ] && do_import $df
 
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 1 line · Martin Jansa

* otherwise it shows error about failing import

It fails like this e.g. when someone tries to migrate_localcount without any entries in cache/bb_persist_data.sqlite3

Quoted 30 lines
---
 scripts/bitbake-prserv-tool | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
scripts/bitbake-prserv-tool +9 -1
index 4654e6d..96a3470 100755
@@ -61,8 +61,16 @@ do_migrate_localcount ()
     clean_cache
     echo "Exporting LOCALCOUNT to AUTOINCs..."
     bitbake -R conf/migrate_localcount.conf -p
-    [ ! $? -eq 0 ] && echo "Exporting failed!" && exit 1
+    [ ! $? -eq 0 ] && echo "Exporting to file $df failed!" && exit 1
 
+    if [ -e $df ];
+    then
+        echo "Exporting to file $df succeeded!"
+    else
+        echo "Exporting to file $df failed!"
+        exit 1
+    fi
+    
     echo "Importing generated AUTOINC entries..."
     [ -e $df ] && do_import $df
 
Signature · 1 line
1.8.1.2
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]