@@ -83,6 +83,7 @@ gchar *exclude_file = NULL;
8383gchar * runtime_file = NULL ;
8484gchar * sign_key = NULL ;
8585gchar * pathToMksquashfs = NULL ;
86+ gchar * file_url ;
8687
8788// #####################################################################
8889
@@ -521,6 +522,7 @@ static GOptionEntry entries[] =
521522 { "exclude-file" , 0 , 0 , G_OPTION_ARG_STRING , & exclude_file , _exclude_file_desc , NULL },
522523 { "runtime-file" , 0 , 0 , G_OPTION_ARG_STRING , & runtime_file , "Runtime file to use" , NULL },
523524 { "sign-key" , 0 , 0 , G_OPTION_ARG_STRING , & sign_key , "Key ID to use for gpg[2] signatures" , NULL },
525+ { "file-url" , 0 , 0 , G_OPTION_ARG_STRING , & file_url , "URL of the AppImage file, can be relative to zsync, or absolute/full" , NULL },
524526 { G_OPTION_REMAINING , 0 , 0 , G_OPTION_ARG_FILENAME_ARRAY , & remaining_args , NULL , NULL },
525527 { 0 ,0 ,0 ,0 ,0 ,0 ,0 }
526528};
@@ -610,6 +612,9 @@ main (int argc, char *argv[])
610612 exit (1 );
611613 }
612614
615+ if (file_url && strlen (file_url ) == 0 )
616+ die ("--file-url argument is empty" );
617+
613618 fprintf (
614619 showVersionOnly ? stdout : stderr ,
615620 "appimagetool, %s (git version %s), build %s built on %s\n" ,
@@ -1130,7 +1135,8 @@ main (int argc, char *argv[])
11301135 "hence generating zsync file\n" );
11311136
11321137 // notice for Alpine builds: Alpine's getopt does not parse flags passed after the first parameter, order matters here
1133- const gchar * const zsyncmake_command [] = {zsyncmake_path , "-u" , basename (destination ), destination , NULL };
1138+ const gchar * zsync_url_arg = file_url ? file_url : basename (destination );
1139+ const gchar * const zsyncmake_command [] = {zsyncmake_path , "-u" , zsync_url_arg , destination , NULL };
11341140
11351141 if (verbose ) {
11361142 fprintf (stderr , "Running zsyncmake process: " );
0 commit comments