summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-08-22 22:04:35 +0200
committerGravatar Nikias Bassen2012-08-22 22:04:35 +0200
commit059a5d20480333b8ea0c049559bbfddf96ab8b36 (patch)
tree3090b5b396e689ac829490f91d98c7f5b1a79e7f
parent05d2bc0ba3d736e2034bd89c810457d6a80ad052 (diff)
downloadideviceinstaller-059a5d20480333b8ea0c049559bbfddf96ab8b36.tar.gz
ideviceinstaller-059a5d20480333b8ea0c049559bbfddf96ab8b36.tar.bz2
allow creating app archives with just the documents (user data)
-rw-r--r--src/ideviceinstaller.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c
index acf2b6b..cfb703e 100644
--- a/src/ideviceinstaller.c
+++ b/src/ideviceinstaller.c
@@ -220,6 +220,7 @@ static void print_usage(int argc, char **argv)
220 " -a, --archive APPID\tArchive app specified by APPID, possible options:\n" 220 " -a, --archive APPID\tArchive app specified by APPID, possible options:\n"
221 " -o uninstall\t- uninstall the package after making an archive\n" 221 " -o uninstall\t- uninstall the package after making an archive\n"
222 " -o app_only\t- archive application data only\n" 222 " -o app_only\t- archive application data only\n"
223 " -o docs_only\t- archive documents (user data) only\n"
223 " -o copy=PATH\t- copy the app archive to directory PATH when done\n" 224 " -o copy=PATH\t- copy the app archive to directory PATH when done\n"
224 " -o remove\t- only valid when copy=PATH is used: remove after copy\n" 225 " -o remove\t- only valid when copy=PATH is used: remove after copy\n"
225 " -r, --restore APPID\tRestore archived app specified by APPID\n" 226 " -r, --restore APPID\tRestore archived app specified by APPID\n"
@@ -885,6 +886,7 @@ run_again:
885 int remove_after_copy = 0; 886 int remove_after_copy = 0;
886 int skip_uninstall = 1; 887 int skip_uninstall = 1;
887 int app_only = 0; 888 int app_only = 0;
889 int docs_only = 0;
888 plist_t client_opts = NULL; 890 plist_t client_opts = NULL;
889 891
890 /* look for options */ 892 /* look for options */
@@ -896,6 +898,10 @@ run_again:
896 skip_uninstall = 0; 898 skip_uninstall = 0;
897 } else if (!strcmp(elem, "app_only")) { 899 } else if (!strcmp(elem, "app_only")) {
898 app_only = 1; 900 app_only = 1;
901 docs_only = 0;
902 } else if (!strcmp(elem, "docs_only")) {
903 docs_only = 1;
904 app_only = 0;
899 } else if ((strlen(elem) > 5) && !strncmp(elem, "copy=", 5)) { 905 } else if ((strlen(elem) > 5) && !strncmp(elem, "copy=", 5)) {
900 copy_path = strdup(elem+5); 906 copy_path = strdup(elem+5);
901 } else if (!strcmp(elem, "remove")) { 907 } else if (!strcmp(elem, "remove")) {
@@ -905,13 +911,15 @@ run_again:
905 } 911 }
906 } 912 }
907 913
908 if (skip_uninstall || app_only) { 914 if (skip_uninstall || app_only || docs_only) {
909 client_opts = instproxy_client_options_new(); 915 client_opts = instproxy_client_options_new();
910 if (skip_uninstall) { 916 if (skip_uninstall) {
911 instproxy_client_options_add(client_opts, "SkipUninstall", 1, NULL); 917 instproxy_client_options_add(client_opts, "SkipUninstall", 1, NULL);
912 } 918 }
913 if (app_only) { 919 if (app_only) {
914 instproxy_client_options_add(client_opts, "ArchiveType", "ApplicationOnly", NULL); 920 instproxy_client_options_add(client_opts, "ArchiveType", "ApplicationOnly", NULL);
921 } else if (docs_only) {
922 instproxy_client_options_add(client_opts, "ArchiveType", "DocumentsOnly", NULL);
915 } 923 }
916 } 924 }
917 925