pkg

Check-in [7a0d173b26]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Only show event progressbar if stdout is a tty
Timelines: family | ancestors | descendants | both | trunk | gsoc2013
Files: files | file ages | folders
SHA1: 7a0d173b26d678088b9039a76e6deacee0f6d980
User & Date: bryan@shatow.net 2014-06-11 16:11:48
Context
2014-06-11
16:27
Updating/Fetching: Don't print progress bar if STDOUT is not a tty, STDIN doesn't matter here check-in: c985c21479 user: bryan@shatow.net tags: trunk, gsoc2013
16:11
Only show event progressbar if stdout is a tty check-in: 7a0d173b26 user: bryan@shatow.net tags: trunk, gsoc2013
16:04
pkg-repo: Only show progress bar when outputting to a TTY check-in: 76e860af2f user: bryan@shatow.net tags: trunk, gsoc2013
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/event.c.

626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
				ev->e_sandbox_call_str.userdata) );
		break;
	case PKG_EVENT_PROGRESS_START:
		if (progress_message != NULL) {
			free(progress_message);
			progress_message = NULL;
		}
		if (!quiet) {
			printf("%s: ", ev->e_progress_start.msg);
			progress_message = strdup(ev->e_progress_start.msg);
			last_progress_slots = -1;
			progress_started = true;
		}
		break;
	case PKG_EVENT_PROGRESS_TICK:
		if (!quiet)
			draw_progressbar(ev->e_progress_tick.current, ev->e_progress_tick.total);

		break;
	default:
		break;
	}

	return 0;
}







|







|









626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
				ev->e_sandbox_call_str.userdata) );
		break;
	case PKG_EVENT_PROGRESS_START:
		if (progress_message != NULL) {
			free(progress_message);
			progress_message = NULL;
		}
		if (!quiet && isatty(STDOUT_FILENO)) {
			printf("%s: ", ev->e_progress_start.msg);
			progress_message = strdup(ev->e_progress_start.msg);
			last_progress_slots = -1;
			progress_started = true;
		}
		break;
	case PKG_EVENT_PROGRESS_TICK:
		if (!quiet && isatty(STDOUT_FILENO))
			draw_progressbar(ev->e_progress_tick.current, ev->e_progress_tick.total);

		break;
	default:
		break;
	}

	return 0;
}