From: Andre Noll Date: Mon, 13 Nov 2017 16:46:57 +0000 (+0100) Subject: Merge branch 'refs/heads/t/configtest' X-Git-Tag: v1.0.0~18 X-Git-Url: http://git.tuebingen.mpg.de/dss.git/log?a=commitdiff_plain;h=a4544b07746d58815d78c4f1213ccdb96d256919;hp=8faa178794f36d419e9146c0deb0eb11fec2d074;p=dss.git Merge branch 'refs/heads/t/configtest' A single patch which adds the new configtest subcommand, plus a fixup for a formatting issue which was noticed only after the branch had already been merged to next. * refs/heads/t/configtest: show_subcommand_summary(): Increase column width. New subcommand: configtest. --- diff --git a/.gitignore b/.gitignore index 977f1dc..1bb2a25 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,9 @@ Makefile.deps -*.[oa] -cmdline.[ch] +*.o +*.swp dss.lsg.* dss dss.1 dss.1.html +dss.png +index.html diff --git a/INSTALL b/INSTALL index 8c70c34..09d8505 100644 --- a/INSTALL +++ b/INSTALL @@ -24,7 +24,7 @@ to install in /usr/local, or to install in /somewhere/else. -Also make sure that [rsync](http://rsync.samba.org/) is installed on +Also make sure that [rsync](https://rsync.samba.org/) is installed on your system. Version 2.6.1 or newer is required. Examples: @@ -70,7 +70,7 @@ system boundaries and increases the number of snapshots. rsync-option "--exclude-from=/etc/dss.exclude" # don't cross filesystem boundaries rsync-option "--one-file-system" - # maintain 2^6 - 1 = 63 snaphots + # maintain 2^6 - 1 = 63 snapshots num-intervals "6" The /etc/dss.exclude file could look like this (see rsync(1) for diff --git a/Makefile b/Makefile index a8e045c..f5c34af 100644 --- a/Makefile +++ b/Makefile @@ -37,8 +37,8 @@ dss: $(dss_objects) %.o: %.c Makefile $(CC) -c $(DSS_CPPFLAGS) $(CPPFLAGS) $(DSS_CFLAGS) $(CFLAGS) $< -%.png: %.dia - dia -e $@ -t png $< +dss.png: mklogo + ./mklogo > $@ %.lsg.h: %.suite lopsubgen --gen-h=$@ < $< diff --git a/NEWS b/NEWS index 755cad2..1dfffd0 100644 --- a/NEWS +++ b/NEWS @@ -7,10 +7,13 @@ x.y.z (to be announced) - 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](http://people.tuebingen.mpg.de/maan/lopsub) library. Hence lopsub must be installed to compile this package. Also help2man is no longer required since lopsub has built-in roff support. + - New subcommand "configtest" to check the command line options and + the configuration file for syntactic correctness. + - "make install" will install the executable and the man page. - In run mode, dss no longer exits successfully if another instance @@ -21,6 +24,8 @@ x.y.z (to be announced) - 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. + ------------------ 0.1.7 (2017-04-17) ------------------ diff --git a/README b/README index c5abb29..79b8889 100644 --- a/README +++ b/README @@ -11,7 +11,7 @@ configured, and there is no database to maintain. dss is also user-friendly because users can browse the snapshot directories without admin intervention and see the contents of the file -system at the various times a snapshot was taken. Each snaphot looks +system at the various times a snapshot was taken. Each snapshot looks like a full backup, so users can easily restore accidentally removed files by using their favorite file browser to simply copy files from the snapshot directory back to the live system. diff --git a/dss.c b/dss.c index f80fd39..57abf02 100644 --- a/dss.c +++ b/dss.c @@ -729,6 +729,7 @@ static int try_to_free_disk_space(void) if (!low_disk_space) goto out; DSS_WARNING_LOG(("disk space low and nothing obvious to remove\n")); + why = "oldest"; victim = find_oldest_removable_snapshot(&sl); if (victim) goto remove; diff --git a/dss.dia b/dss.dia deleted file mode 100644 index a02f700..0000000 --- a/dss.dia +++ /dev/null @@ -1,960 +0,0 @@ - - - - - - - - - - - - - #A4# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #DSS# - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mklogo b/mklogo new file mode 100755 index 0000000..54c8c95 --- /dev/null +++ b/mklogo @@ -0,0 +1,100 @@ +#!/bin/bash + +# Script for Image Magick that writes the dss logo in png format +# to stdout. + +set -u + +width=320 +height=110 +border=5 +radius1=4 +radius2=5 +circle_y=90 +arrow_y=70 +text_x=128 +text_y=55 +pointsize=36 + +declare -a circle arrow rectangle text + +make_circles() +{ + local inner='stroke black fill red circle' + local outer='stroke black fill black circle' + local num=1 + local idx=0 + local y=$circle_y + local step x0 i j idx num + + for ((i = 0; i < 4; i++)); do + step=$(((width / 4 + num) / (num + 1))) + x0=$((border + width / 4 * i)) + for ((j = 1; j <= $num; j++)); do + x=$((x0 + j * $step)) + circle[$idx]='-draw'; let idx++ + circle[$idx]="$outer $x,$y,$((x + radius2)),$y"; let idx++ + circle[$idx]='-draw'; let idx++ + circle[$idx]="$inner $x,$y,$((x + radius1)),$y"; let idx++ + done + num=$((num * 2)) + done + #echo "${circle[@]}"; exit 0 +} + +make_arrow() +{ + local arrow_head='l -15,-5 +5,+5 -5,+5 +15,-5 z' + local idx=0 + local x0 x1 y + + arrow[$idx]='-draw'; let idx++ + x0=$((3 * border)); x1=$((width - 2 * border)) + y=$arrow_y + arrow[$idx]="stroke white line $x0,$y $x1,$y"; let idx++ + arrow[$idx]='-draw'; let idx++ + x0=$((width - 2 * border)) + arrow[$idx]="stroke white fill white path 'M $x0,$y $arrow_head'" + #echo "${arrow[@]}"; exit 0 +} + +make_rectangles() +{ + local idx=0 + local x x0 x1 y y0 y1 i red_green color + + rectangle[$idx]='-draw'; let idx++ + x=$((width + 2 * border)) + y=$((height + 2 * border)) + rectangle[$idx]="stroke yellow fill yellow rectangle 0,0 $x,$y"; let idx++ + for ((i = 0; i < 4; i++)); do + rectangle[$idx]='-draw'; let idx++ + red_green="$(printf '%02x' $(((3 - i) * 60)))" + color="#${red_green}${red_green}ff" + x0=$((border + i * width / 4)); x1=$((x0 + width / 4 - 1)) + y0=$border; y1=$((y0 + height)) + rectangle[$idx]="stroke $color fill $color rectangle $x0,$y0 $x1,$y1" + let idx++ + done + #echo "${rectangle[@]}"; exit 0 +} + +make_text() +{ + text=(-pointsize $pointsize -draw \ + "fill white text $text_x,$text_y DSS") + #echo "${text[@]}"; exit 0 +} + +make_rectangles +make_arrow +make_circles +make_text + +convert -size $((width + 2 * border))x$((height + 2 * border)) \ + -background none xc: \ + "${rectangle[@]}" \ + "${arrow[@]}" \ + "${circle[@]}" \ + "${text[@]}" \ + png:-