Skip to content

Commit

Permalink
Merge pull request #119 from sam-at-github/issue/open3-retval
Browse files Browse the repository at this point in the history
Fix double 8 bit shift bug introduced with #65. Refs #102, #103, #114, #118
  • Loading branch information
sgpinkus committed Dec 8, 2015
2 parents 56723a5 + 778ab47 commit 2720956
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 31 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
os:
- linux
- osx
#- osx
language: perl
perl:
- "5.20"
# - "5.20"
- "5.18"
- "5.16"
- "5.14"
Expand Down
25 changes: 12 additions & 13 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ man: $(man_MANS)
rsnapshot.1 : rsnapshot
@# perl 5.8 for this
pod2man -c 'rsnapshot-tools' -n 'rsnapshot' -r 'rsnapshot-tools' rsnapshot > rsnapshot.1

rsnapshot-diff.1 : rsnapshot-diff
@# perl 5.8 for this
pod2man -c 'rsnapshot-tools' -n 'rsnapshot-diff' -r 'rsnapshot-tools' rsnapshot-diff > rsnapshot-diff.1

html: rsnapshot.html
rsnapshot.html: rsnapshot
pod2html rsnapshot | grep -v 'link rev' > rsnapshot.html
Expand All @@ -35,40 +35,40 @@ clean:
rm -f t/support/etc/*.conf
rm -f t/support/files/a/{1,2}
rm -rf t/support/snapshots/*.*


tar: rsnapshot-$(VERSION).tar.gz
@touch tar

rsnapshot-$(VERSION).tar.gz: $(man_MANS) Makefile $(bin_SCRIPTS) $(sysconf_DATA)
@echo building tar file
@echo building tar file
mkdir rsnapshot-$(VERSION)/

@# core files
cp -apr AUTHORS ChangeLog COPYING INSTALL.md Makefile.am README.md \
cp -a AUTHORS ChangeLog COPYING INSTALL.md Makefile.am README.md \
rsnapshot.conf.default.in rsnapshot-diff.pl rsnapshot-program.pl \
rsnapshot-$(VERSION)

@# autoconf files
cp -apr configure.ac Makefile.am \
cp -a configure.ac Makefile.am \
aclocal.m4 autom4te.cache configure install-sh Makefile.in missing \
rsnapshot-$(VERSION)/

@# documentation files
cp -apr docs \
cp -a docs \
rsnapshot-$(VERSION)/

@# utils
cp -apr utils/ \
cp -a utils/ \
rsnapshot-$(VERSION)/

@# testsuite
cp -apr t/ \
cp -a t/ \
rsnapshot-$(VERSION)/

@# remove git-files
find rsnapshot-$(VERSION)/ -depth -name .gitignore -exec rm -rf {} \;

@# change ownership to root, and delete build dir
fakeroot chown -R root:root rsnapshot-$(VERSION)/
rm -f rsnapshot-$(VERSION).tar.gz
Expand All @@ -89,4 +89,3 @@ test: rsnapshot $(test_cases) $(test_configs) $(test_modules)
bin_SCRIPTS = rsnapshot rsnapshot-diff
man_MANS = rsnapshot.1 rsnapshot-diff.1
sysconf_DATA = rsnapshot.conf.default

25 changes: 10 additions & 15 deletions rsnapshot-program.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3920,19 +3920,14 @@ sub rsync_backup_point {
}

waitpid($pid, 0);
$result = $? >> 8;
$result = get_retval($?);
$tryCount += 1;
}

# now we see if rsync ran successfully, and what to do about it
if ($result != 0) {

# bitmask return value
my $retval = get_retval($result);

# print warnings, and set this backup point to rollback if we're using --link-dest
#
handle_rsync_error($retval, $bp_ref);
handle_rsync_error($result, $bp_ref);
}
else {
print_msg("rsync succeeded", 5);
Expand Down Expand Up @@ -6708,7 +6703,7 @@ =head1 CONFIGURATION
B<snapshot_root> Local filesystem path to save all snapshots
B<include_conf> Include another file in the configuration at this point.
=over 4
This is recursive, but you may need to be careful about paths when specifying
Expand Down Expand Up @@ -6783,7 +6778,7 @@ =head1 CONFIGURATION
=over 4
Paths to lvcreate, lvremove, mount and umount commands, for use with Linux
LVMs. You may include options to the commands also.
LVMs. You may include options to the commands also.
The lvcreate, lvremove, mount and umount commands are required for
managing snapshots of LVM volumes and are otherwise optional.
Expand Down Expand Up @@ -6964,7 +6959,7 @@ =head1 CONFIGURATION
List of long arguments to pass to rsync. The default values are
--delete --numeric-ids --relative --delete-excluded
This means that the directory structure in each backup point destination
This means that the directory structure in each backup point destination
will match that in the backup point source.
Quotes are permitted in rsync_long_args, eg --rsync-path="sudo /usr/bin/rsync".
Expand Down Expand Up @@ -7029,7 +7024,7 @@ =head1 CONFIGURATION
=over 4
Changes default behavior of rsnapshot and does not initially remove the
Changes default behavior of rsnapshot and does not initially remove the
oldest snapshot. Instead it moves that directory to _delete.[processid] and
continues as normal. Once the backup has been completed, the lockfile will
be removed before rsnapshot starts deleting the directory.
Expand Down Expand Up @@ -7075,7 +7070,7 @@ =head1 CONFIGURATION
=over 4
Mount point to use to temporarily mount the snapshot(s).
Mount point to use to temporarily mount the snapshot(s).
=back
Expand Down Expand Up @@ -7175,8 +7170,8 @@ =head1 CONFIGURATION
=over 4
Backs up the LVM logical volume called home, of volume group vg0, to
<snapshot_root>/<interval>.0/lvm-vg0/. Will create, mount, backup, unmount and remove an LVM
Backs up the LVM logical volume called home, of volume group vg0, to
<snapshot_root>/<interval>.0/lvm-vg0/. Will create, mount, backup, unmount and remove an LVM
snapshot for each lvm:// entry.
=back
Expand Down Expand Up @@ -7341,7 +7336,7 @@ =head1 USAGE
(which usually includes deleting the oldest beta snapshot), then you
should increase the time between the backup levels.
Otherwise (assuming you have set the B<lockfile> parameter, as is recommended)
your alpha snapshot will fail sometimes because the beta still has the lock.
your alpha snapshot will fail sometimes because the beta still has the lock.
Remember that these are just the times that the program runs.
To set the number of backups stored, set the B<retain> numbers in
Expand Down
2 changes: 1 addition & 1 deletion t/rsync-exitcode/conf/rsync-exitcode-bad.conf.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
config_version 1.2
snapshot_root @SNAP@
cmd_rsync false
cmd_rsync /bin/false
interval hourly 6
backup @TEST@/support/files/a/ localhost/

0 comments on commit 2720956

Please sign in to comment.