diff options
author | Koushik Dutta <koushd@gmail.com> | 2012-07-04 20:08:05 -0700 |
---|---|---|
committer | Koushik Dutta <koushd@gmail.com> | 2012-07-04 20:08:05 -0700 |
commit | f8fc12e741d566af215407f35cfc52e5c1cc0023 (patch) | |
tree | 1fcf00fc7f52caf7d169afb6330cba3bf631c437 /nandroid.c | |
parent | d9425b14a4d466ea00d6af5d8657334333015e39 (diff) | |
download | bootable_recovery-f8fc12e741d566af215407f35cfc52e5c1cc0023.zip bootable_recovery-f8fc12e741d566af215407f35cfc52e5c1cc0023.tar.gz bootable_recovery-f8fc12e741d566af215407f35cfc52e5c1cc0023.tar.bz2 |
fixup backup and restore status
Change-Id: I2065755c26a2b49f09ac8592c61faa9474ce2f57
Diffstat (limited to 'nandroid.c')
-rw-r--r-- | nandroid.c | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -74,12 +74,13 @@ static void yaffs_callback(const char* filename) strcpy(tmp, justfile); if (tmp[strlen(tmp) - 1] == '\n') tmp[strlen(tmp) - 1] = NULL; - if (strlen(tmp) < 30) - ui_nice_print("%s", tmp); + tmp[ui_get_text_cols() - 1] = '\0'; yaffs_files_count++; - if (yaffs_files_total != 0) + ui_nice_print("%s\n", tmp); + if (!ui_was_niced() && yaffs_files_total != 0) ui_set_progress((float)yaffs_files_count / (float)yaffs_files_total); - ui_reset_text_col(); + if (!ui_was_niced()) + ui_delete_line(); } static void compute_directory_stats(const char* directory) @@ -108,10 +109,7 @@ static int mkyaffs2image_wrapper(const char* backup_path, const char* backup_fil static int tar_compress_wrapper(const char* backup_path, const char* backup_file_image, int callback) { char tmp[PATH_MAX]; - if (strcmp(backup_path, "/data") == 0 && is_data_media()) - sprintf(tmp, "cd $(dirname %s) ; touch %s.tar ; tar cv --exclude 'media' $(basename %s) | split -a 1 -b 1000000000 /proc/self/fd/0 %s.tar. ; exit $?", backup_path, backup_file_image, backup_path, backup_file_image); - else - sprintf(tmp, "cd $(dirname %s) ; touch %s.tar ; tar cv $(basename %s) | split -a 1 -b 1000000000 /proc/self/fd/0 %s.tar. ; exit $?", backup_path, backup_file_image, backup_path, backup_file_image); + sprintf(tmp, "cd $(dirname %s) ; touch %s.tar ; (tar cv %s $(basename %s) | split -a 1 -b 1000000000 /proc/self/fd/0 %s.tar.) 2> /proc/self/fd/1 ; exit $?", backup_path, backup_file_image, strcmp(backup_path, "/data") == 0 && is_data_media() ? "--exclude 'media'" : "", backup_path, backup_file_image); FILE *fp = __popen(tmp, "r"); if (fp == NULL) { |