From: Andre Noll Date: Thu, 16 Nov 2017 19:57:34 +0000 (+0100) Subject: Merge branch 'refs/heads/t/ls-incomplete-duration' X-Git-Tag: v1.0.0~9 X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=commitdiff_plain;h=07ab37b55e1bf4ad7ef65fd25db84fa2a5f50f56;hp=c9fd9f2239319b95c46e49b1b7040e1a898cdcf7 Merge branch 'refs/heads/t/ls-incomplete-duration' A simple patch which improves the ls output. Cooking for 10 days. * refs/heads/t/ls-incomplete-duration: ls: Print current duration of incomplete snapshots. --- diff --git a/NEWS b/NEWS index 75fe3a2..f103fb4 100644 --- a/NEWS +++ b/NEWS @@ -1,14 +1,10 @@ ----------------------- -x.y.z (to be announced) +1.0.0 (to be announced) ----------------------- - - Improved error diagnostics for the kill subcommand. - - - The --no-resume option has been removed. - - The gengetopt option parser has been replaced by the [lopsub](http://people.tuebingen.mpg.de/maan/lopsub) library. Hence - lopsub must be installed to compile this package. Also help2man is + lopsub must be installed to compile this package. help2man is no longer required since lopsub has built-in roff support. - New subcommand "configtest" to check the command line options and @@ -17,19 +13,26 @@ x.y.z (to be announced) - New option: --mountpoint. If this option is given, dss aborts if no file system is mounted on the destination directory. - - "make install" will install the executable and the man page. + - The --no-resume option has been removed. + + - The ls subcommand now shows the age of incomplete snapshots rather + than 0:00. + + - New option --checksum to let rsync compute checksums occasionally. - In run mode, dss no longer exits successfully if another instance is already running. - - New option --checksum to let rsync compute checksums occasionally. + - "make install" will install the executable and the man page. - - CFLAGS, CPPFLAGS and LDFLAGS can now be used to override the flags - of the build system. + - Improved error diagnostics for the kill subcommand. - For all subcommands other than "run", timestamps and function names are omitted from the log output. + - CFLAGS, CPPFLAGS and LDFLAGS can now be used to override the flags + of the build system. + - The dss logo is now created with ImageMagick rather than dia. ------------------ diff --git a/dss.c b/dss.c index bd9e577..24d77eb 100644 --- a/dss.c +++ b/dss.c @@ -1709,13 +1709,17 @@ static int com_ls(void) int i; struct snapshot_list sl; struct snapshot *s; + int64_t now = get_current_time(); dss_get_snapshot_list(&sl); FOR_EACH_SNAPSHOT(s, i, &sl) { - int64_t d = 0; + int64_t d; if (s->flags & SS_COMPLETE) d = (s->completion_time - s->creation_time) / 60; - dss_msg("%u\t%s\t%3" PRId64 ":%02" PRId64 "\n", s->interval, s->name, d/60, d%60); + else + d = (now - s->creation_time) / 60; + dss_msg("%u\t%s\t%3" PRId64 ":%02" PRId64 "\n", s->interval, + s->name, d / 60, d % 60); } free_snapshot_list(&sl); return 1;