ChangeLog, Makefile.in:

Makefile.in (install): Install resize2fs in /sbin, not /usr/sbin.
ChangeLog, unix.c:
  unix.c: Also, re-arrange the logic so that we do the time check only
  	after doing the percentage check, and we only advance the spinner if
  	we're about to display it.
ChangeLog:
  Fix minor wording error in Chagelog.
This commit is contained in:
Theodore Ts'o 2000-07-05 23:54:46 +00:00
parent 9226904bfb
commit e4c8e885d2
5 changed files with 33 additions and 9 deletions

View File

@ -31,7 +31,7 @@
Thu Apr 6 17:43:11 2000 Theodore Y. Ts'o <tytso@signal.thunk.org> Thu Apr 6 17:43:11 2000 Theodore Y. Ts'o <tytso@signal.thunk.org>
* configure.in (fdatasync): Add test for fdatasync(), since not * configure.in (fdatasync): Add test for fdatasync(), since not
all functions have this function. all OS's have this function.
2000-04-03 Theodore Ts'o <tytso@valinux.com> 2000-04-03 Theodore Ts'o <tytso@valinux.com>

View File

@ -4,6 +4,9 @@
percentage after multiplying it by 10, nor 1000, since we percentage after multiplying it by 10, nor 1000, since we
only need to save values to a tenth of a percent (and the only need to save values to a tenth of a percent (and the
percentage is already from 0 .. 100%, not 0 .. 1). percentage is already from 0 .. 100%, not 0 .. 1).
Also, re-arrange the logic so that we do the time
check only after doing the percentage check, and we
only advance the spinner if we're about to display it.
2000-07-04 Theodore Ts'o <tytso@valinux.com> 2000-07-04 Theodore Ts'o <tytso@valinux.com>

View File

@ -340,18 +340,35 @@ static int e2fsck_update_progress(e2fsck_t ctx, int pass,
} else { } else {
if (ctx->flags & E2F_FLAG_PROG_SUPPRESS) if (ctx->flags & E2F_FLAG_PROG_SUPPRESS)
return 0; return 0;
/*
* Calculate the new progress position. If the
* percentage hasn't changed, then we skip out right
* away.
*/
percent = calc_percent(&e2fsck_tbl, pass, cur, max);
if (ctx->progress_last_percent == (int) 10 * percent)
return 0;
ctx->progress_last_percent = (int) 10 * percent;
/*
* If we've already updated the spinner once within
* the last 1/8th of a second, no point doing it
* again.
*/
gettimeofday(&tv, NULL); gettimeofday(&tv, NULL);
tick = (tv.tv_sec << 3) + (tv.tv_usec / (1000000 / 8)); tick = (tv.tv_sec << 3) + (tv.tv_usec / (1000000 / 8));
if ((tick == ctx->progress_last_time) && if ((tick == ctx->progress_last_time) &&
(cur != max) && (cur != 0)) (cur != max) && (cur != 0))
return 0; return 0;
ctx->progress_last_time = tick; ctx->progress_last_time = tick;
/*
* Advance the spinner, and note that the progress bar
* will be on the screen
*/
ctx->progress_pos = (ctx->progress_pos+1) & 3; ctx->progress_pos = (ctx->progress_pos+1) & 3;
ctx->flags |= E2F_FLAG_PROG_BAR; ctx->flags |= E2F_FLAG_PROG_BAR;
percent = calc_percent(&e2fsck_tbl, pass, cur, max);
if (ctx->progress_last_percent == (int) 10 * percent)
return 0;
ctx->progress_last_percent = (int) 10 * percent;
i = ((percent * dpywidth) + 50) / 100; i = ((percent * dpywidth) + 50) / 100;
printf("%s: |%s%s", ctx->device_name, printf("%s: |%s%s", ctx->device_name,
bar + (sizeof(bar) - (i+1)), bar + (sizeof(bar) - (i+1)),

View File

@ -1,3 +1,7 @@
2000-07-05 <tytso@snap.thunk.org>
* Makefile.in (install): Install resize2fs in /sbin, not /usr/sbin.
2000-06-12 Theodore Ts'o <tytso@valinux.com> 2000-06-12 Theodore Ts'o <tytso@valinux.com>
* main.c, resize2fs.c, resize2fs.h, extent.c: Add NLS support. * main.c, resize2fs.c, resize2fs.h, extent.c: Add NLS support.

View File

@ -50,13 +50,13 @@ test_extent: $(TEST_EXTENT_OBJS)
$(CC) $(ALL_LDFLAGS) -o test_extent $(TEST_EXTENT_OBJS) $(LIBS) $(CC) $(ALL_LDFLAGS) -o test_extent $(TEST_EXTENT_OBJS) $(LIBS)
installdirs: installdirs:
$(top_srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) \ $(top_srcdir)/mkinstalldirs $(DESTDIR)$(root_sbindir) \
$(DESTDIR)$(man8dir) $(DESTDIR)$(man8dir)
install: $(PROGS) $(MANPAGES) installdirs install: $(PROGS) $(MANPAGES) installdirs
for i in $(PROGS); do \ for i in $(PROGS); do \
$(INSTALL_PROGRAM) $$i $(DESTDIR)$(sbindir)/$$i; \ $(INSTALL_PROGRAM) $$i $(DESTDIR)$(root_sbindir)/$$i; \
$(STRIP) $(DESTDIR)$(sbindir)/$$i; \ $(STRIP) $(DESTDIR)$(root_sbindir)/$$i; \
done done
for i in $(MANPAGES); do \ for i in $(MANPAGES); do \
$(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \ $(INSTALL_DATA) $$i $(DESTDIR)$(man8dir)/$$i; \
@ -64,7 +64,7 @@ install: $(PROGS) $(MANPAGES) installdirs
uninstall: uninstall:
for i in $(PROGS); do \ for i in $(PROGS); do \
$(RM) -f $(DESTDIR)$(sbindir)/$$i; \ $(RM) -f $(DESTDIR)$(root_sbindir)/$$i; \
done done
for i in $(MANPAGES); do \ for i in $(MANPAGES); do \
$(RM) -f $(DESTDIR)$(man8dir)/$$i; \ $(RM) -f $(DESTDIR)$(man8dir)/$$i; \