aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-01-16 15:18:55 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-01-16 15:22:08 +0200
commitb2eed67d1b65ffa65c7164216bd27a222a442a6f (patch)
tree1ae728abf062a63378b4f333067845d23b5e3c64
parent0ddbe02c5fadcef7dfb579ae484b134162c66621 (diff)
downloadbeam-b2eed67d1b65ffa65c7164216bd27a222a442a6f.tar.gz
beam-b2eed67d1b65ffa65c7164216bd27a222a442a6f.tar.bz2
Fix threshold calculation in cleaner.in
* cleaner.in: Fix 0ddbe02c. * NEWS: Version 1.4 * configure.ac: Update. * doc/beam-module.5in: Fix formatting.
-rw-r--r--NEWS11
-rwxr-xr-xcleaner.in15
-rw-r--r--configure.ac4
-rw-r--r--doc/beam-module.5in10
4 files changed, 26 insertions, 14 deletions
diff --git a/NEWS b/NEWS
index 0b81bed..4d1f507 100644
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,13 @@
-BEAM NEWS -- history of user-visible changes. 2012-07-15
-Copyright (C) 2012 Sergey Poznyakoff.
+BEAM NEWS -- history of user-visible changes. 2013-01-16
+Copyright (C) 2012, 2013 Sergey Poznyakoff.
See the end of file for copying conditions.
Please send mailutils bug reports to <gray@gnu.org.ua>.
+
+Version 1.4, 2013-01-16
+
+* Fix beam-cleaner to handle end-of-year week wraparound.
+* Various bugfixes
Version 1.3
@@ -33,7 +38,7 @@ First release.
----------------------------------------------------------------------
Copyright information:
-Copyright (C) 2012 Sergey Poznyakoff.
+Copyright (C) 2012, 2013 Sergey Poznyakoff.
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
diff --git a/cleaner.in b/cleaner.in
index 1d14fd4..0413943 100755
--- a/cleaner.in
+++ b/cleaner.in
@@ -56,7 +56,7 @@ thisweek=$(date +%U)
if [ $thisweek -gt $retainweeks ]; then
lastweek=$((thisweek - retainweeks))
else
- lastweek=$((thisweek + 53 - retainweeks))
+ lastweek=$((thisweek + 54 - retainweeks))
fi
$verbose \# removing from $dir files ending in $suffix and older than week $lastweek
@@ -70,8 +70,15 @@ fi |
do
$verbose \# considering $name
week=$(expr "$name" : '[^-][^-]*-\([0-9][0-9]*\)-.*')
- if [ $week -le $lastweek ]; then
- $verbose \# removing $name
- $dry_run rm $dir/$name
+ if [ $thisweek -ge $week ]; then
+ if [ $((thisweek - week)) -gt $retainweeks ]; then
+ $verbose \# removing $name
+ $dry_run rm $dir/$name
+ fi
+ else
+ if [ $((thisweek + 54 - week)) -gt $retainweeks ]; then
+ $verbose \# removing $name
+ $dry_run rm $dir/$name
+ fi
fi
done
diff --git a/configure.ac b/configure.ac
index 5028c87..d89ad2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
# This file is part of BEAM -*- autoconf -*-
-# Copyright (C) 2012 Sergey Poznyakoff
+# Copyright (C) 2012, 2013 Sergey Poznyakoff
#
# BEAM is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
AC_PREREQ(2.63)
-AC_INIT(beam, 1.3, gray@gnu.org.ua)
+AC_INIT(beam, 1.4, gray@gnu.org.ua)
AC_CONFIG_SRCDIR(backup.in)
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.11 tar-ustar silent-rules])
diff --git a/doc/beam-module.5in b/doc/beam-module.5in
index 79e3114..f650c65 100644
--- a/doc/beam-module.5in
+++ b/doc/beam-module.5in
@@ -14,7 +14,7 @@
.\" You should have received a copy of the GNU General Public License
.\" along with BEAM. If not, see <http://www.gnu.org/licenses/>.
.\"
-.TH BEAM\-MODULE 5 "July 15, 2012" "BEAM" "BEAM Programmer Reference"
+.TH BEAM\-MODULE 5 "January 16, 2013" "BEAM" "BEAM Programmer Reference"
.SH NAME
beam\-module \- format of
.BR beam (1)
@@ -109,8 +109,8 @@ module. It verifies whether the two mandatory parameters,
fs_check() {
local rc=0 root files
- eval root=\$${1}_dir
- eval files=\$${1}_files
+ eval root=\\$${1}_dir
+ eval files=\\$${1}_files
test \-z "$root" && rc=1 && error "${1}_dir not set"
test \-z "$files" && rc=1 && error "${1}_files not set"
@@ -139,7 +139,7 @@ module:
fs_list() {
local dir files
- eval dir=\$${1}_dir files=\$${1}_files
+ eval dir=\\$${1}_dir files=\\$${1}_files
echo "${2}Files and directories in $dir:$files"
}
.in
@@ -160,7 +160,7 @@ fs_backup() {
local basename text root files exclude addopts s e
basename=$1\-$week\-$round\-$level
- eval dir=\$${1}_dir files=\$${1}_files
+ eval dir=\\$${1}_dir files=\\$${1}_files
$dry_run tar $verbose $taroptions \\
\-f $backup_archive_dir/$basename.$tar_suffix \\

Return to:

Send suggestions and report system problems to the System administrator.