diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-09-18 12:49:23 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-09-18 12:49:23 +0000 |
commit | 5b71d8999ceb185e7875c59042690a5d8fa0e5b3 (patch) | |
tree | b6f612e855717ca75dbd1b10753cff690903f90f /etc/rc.subr | |
parent | 5e7b54b184da2c11df01c50ca53be077a14be081 (diff) | |
download | src-5b71d8999ceb185e7875c59042690a5d8fa0e5b3.tar.gz src-5b71d8999ceb185e7875c59042690a5d8fa0e5b3.zip |
Notes
Diffstat (limited to 'etc/rc.subr')
-rw-r--r-- | etc/rc.subr | 76 |
1 files changed, 15 insertions, 61 deletions
diff --git a/etc/rc.subr b/etc/rc.subr index 8da111acec8f..5b29ccf2e0b7 100644 --- a/etc/rc.subr +++ b/etc/rc.subr @@ -1532,28 +1532,20 @@ debug() # # backup_file action file cur backup # Make a backup copy of `file' into `cur', and save the previous -# version of `cur' as `backup' or use rcs for archiving. -# -# This routine checks the value of the backup_uses_rcs variable, -# which can be either YES or NO. +# version of `cur' as `backup'. # # The `action' keyword can be one of the following: # # add `file' is now being backed up (and is possibly # being reentered into the backups system). `cur' -# is created and RCS files, if necessary, are -# created as well. +# is created. # # update `file' has changed and needs to be backed up. -# If `cur' exists, it is copied to to `back' or -# checked into RCS (if the repository file is old), -# and then `file' is copied to `cur'. Another RCS -# check in done here if RCS is being used. +# If `cur' exists, it is copied to to `back' +# and then `file' is copied to `cur'. # # remove `file' is no longer being tracked by the backups -# system. If RCS is not being used, `cur' is moved -# to `back', otherwise an empty file is checked in, -# and then `cur' is removed. +# system. `cur' is moved `back'. # # backup_file() @@ -1563,56 +1555,18 @@ backup_file() _cur=$3 _back=$4 - if checkyesno backup_uses_rcs; then - _msg0="backup archive" - _msg1="update" - - # ensure that history file is not locked - if [ -f $_cur,v ]; then - rcs -q -u -U -M $_cur - fi - - # ensure after switching to rcs that the - # current backup is not lost + case $_action in + add|update) if [ -f $_cur ]; then - # no archive, or current newer than archive - if [ ! -f $_cur,v -o $_cur -nt $_cur,v ]; then - ci -q -f -u -t-"$_msg0" -m"$_msg1" $_cur - rcs -q -kb -U $_cur - co -q -f -u $_cur - fi + cp -p $_cur $_back fi - - case $_action in - add|update) - cp -p $_file $_cur - ci -q -f -u -t-"$_msg0" -m"$_msg1" $_cur - rcs -q -kb -U $_cur - co -q -f -u $_cur - chown root:wheel $_cur $_cur,v - ;; - remove) - cp /dev/null $_cur - ci -q -f -u -t-"$_msg0" -m"$_msg1" $_cur - rcs -q -kb -U $_cur - chown root:wheel $_cur $_cur,v - rm $_cur - ;; - esac - else - case $_action in - add|update) - if [ -f $_cur ]; then - cp -p $_cur $_back - fi - cp -p $_file $_cur - chown root:wheel $_cur - ;; - remove) - mv -f $_cur $_back - ;; - esac - fi + cp -p $_file $_cur + chown root:wheel $_cur + ;; + remove) + mv -f $_cur $_back + ;; + esac } # make_symlink src link |