Backend: don't check anykernel.sh before it's been extracted

- if it does not exist yet (i.e. hasn't been extracted) then assume cleanuponabort=1 since there wouldn't be anything to see on a failed extraction
- hide any missing file errors from file_getprop here now that we've taken care of that case
This commit is contained in:
osm0sis committed 2017-05-26 22:30:54 -03:00
1 parent c24b2a299d
commit 2fcc7e6c21
1 file changed
+6 -4
+6 -4
View File
@@ -24,11 +24,13 @@ set_perm_recursive() {
file_getprop() { grep "^$2" "$1" | cut -d= -f2; }
getprop() { test -e /sbin/getprop && /sbin/getprop $1 || file_getprop /default.prop $1; }
cleanup() { rm -rf /tmp/anykernel; }
if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.cleanuponabort)" == 1 ]; then
abort() { ui_print "$*"; cleanup; umount /system; umount /data; exit 1; }
abort() {
if [ ! -f /tmp/anykernel/anykernel.sh -o "$(file_getprop /tmp/anykernel/anykernel.sh do.cleanuponabort 2>/dev/null)" == 1 ]; then
ui_print "$*"; cleanup; umount /system; umount /data; exit 1;
else
abort() { ui_print "$*"; umount /system; umount /data; exit 1; }
fi;
ui_print "$*"; umount /system; umount /data; exit 1;
fi;
}
show_progress 1.34 4;
ui_print " ";