You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
die("Only gzip (faster execution, larger files) and xz (slower execution, smaller files) compression is supported at the moment. Let us know if there are reasons for more, should be easy to add. You could help the project by doing some systematic size/performance measurements. Watch for size, execution speed, and zsync delta size.");
613
557
/* Check for dependencies here. Better fail early if they are not present. */
@@ -656,7 +600,63 @@ main (int argc, char *argv[])
656
600
}
657
601
658
602
/* If the first argument is a directory, then we assume that we should package it */
659
-
if (g_file_test (remaining_args[0], G_FILE_TEST_IS_DIR)){
603
+
if (g_file_test(remaining_args[0], G_FILE_TEST_IS_DIR)) {
604
+
/* Parse VERSION environment variable.
605
+
* We cannot use g_environ_getenv (g_get_environ() since it is too new for CentOS 6
606
+
* Also, if VERSION is not set and -g is called and if git is on the path, use
607
+
* git rev-parse --short HEAD
608
+
* TODO: Might also want to somehow make use of
609
+
* git rev-parse --abbrev-ref HEAD
610
+
* git log -1 --format=%ci */
611
+
gchar*version_env=getenv("VERSION");
612
+
613
+
if (guess_update_information) {
614
+
char*gitPath=g_find_program_in_path("git");
615
+
616
+
if (gitPath!=NULL) {
617
+
if (version_env==NULL) {
618
+
GError*error=NULL;
619
+
gchar*out=NULL;
620
+
621
+
charcommand_line[] ="git rev-parse --short HEAD";
622
+
623
+
// *not* the exit code! must be interpreted via g_spawn_check_exit_status!
624
+
intexit_status=-1;
625
+
626
+
// g_spawn_command_line_sync returns whether the program succeeded
0 commit comments