diff options
author | Koushik K. Dutta <koushd@gmail.com> | 2010-02-11 23:08:23 -0800 |
---|---|---|
committer | Koushik K. Dutta <koushd@gmail.com> | 2010-02-11 23:08:23 -0800 |
commit | 1f14c9a1f1dd29dbef6a96e051cd992a7aa593fc (patch) | |
tree | 75745be1673c95a598e40484955cbb99c0ceb937 /install.c | |
parent | 6060e5c6df717a8070ceeb9c72c3c5dafa29cdd7 (diff) | |
download | bootable_recovery-1f14c9a1f1dd29dbef6a96e051cd992a7aa593fc.zip bootable_recovery-1f14c9a1f1dd29dbef6a96e051cd992a7aa593fc.tar.gz bootable_recovery-1f14c9a1f1dd29dbef6a96e051cd992a7aa593fc.tar.bz2 |
Need to call register_package_root prior to installing the package. The subsequent unregistering made me think that it was being registered at some point, but it was removed in the transition to eclair. The unregistration was dead code. It is being used now though.
Diffstat (limited to 'install.c')
-rw-r--r-- | install.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -243,12 +243,16 @@ handle_update_package(const char *path, ZipArchive *zip) ui_print("Installing update...\n"); int result = try_update_binary(path, zip); - if (result == INSTALL_UPDATE_BINARY_MISSING) - { - const ZipEntry *script_entry; - script_entry = find_update_script(zip); - result = handle_update_script(zip, script_entry); - } + if (result == INSTALL_UPDATE_BINARY_MISSING) + { + if (register_package_root(zip, path) < 0) { + LOGE("Can't register package root\n"); + return INSTALL_ERROR; + } + const ZipEntry *script_entry; + script_entry = find_update_script(zip); + result = handle_update_script(zip, script_entry); + } register_package_root(NULL, NULL); // Unregister package root return result; } |