[PATCH] import-rsnapshot: avoid bashism in script

19 views
Skip to first unread message

Gabriel Filion

unread,
Jun 20, 2015, 11:51:45 PM6/20/15
to bup-...@googlegroups.com, Gabriel Filion
Using a negative exit code is a bashism and since we use /bin/sh to
interpret the script, we should avoid it.

This was reported by Raphael Geissert <ato...@gmail.com> in a debian
bug report:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772222

Signed-off-by: Gabriel Filion <gab...@lelutin.ca>
---

Note that this also makes the "usage" exit code similar to what's currently
used in import-rdiff-backup

cmd/import-rsnapshot-cmd.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmd/import-rsnapshot-cmd.sh b/cmd/import-rsnapshot-cmd.sh
index d04fbbb..6ab3984 100755
--- a/cmd/import-rsnapshot-cmd.sh
+++ b/cmd/import-rsnapshot-cmd.sh
@@ -5,7 +5,7 @@ usage() {
echo "Usage: bup import-rsnapshot [-n]" \
"<path to snapshot_root> [<backuptarget>]"
echo "-n,--dry-run: just print what would be done"
- exit -1
+ exit 1
}

DRY_RUN=
--
2.1.4

Rob Browning

unread,
Jul 4, 2015, 10:36:45 AM7/4/15
to Gabriel Filion, bup-...@googlegroups.com
Gabriel Filion <gab...@lelutin.ca> writes:

> Using a negative exit code is a bashism and since we use /bin/sh to
> interpret the script, we should avoid it.

Pushed to master:

commit 4f9cb846f3fc61816c498fe5f31cb8be2926c2db
Author: Gabriel Filion <gab...@lelutin.ca>
Date: Sat Jun 20 23:51:15 2015 -0400

import-rsnapshot: exit with 1, not -1

Using a negative exit code is a bashism and since we use /bin/sh to
interpret the script, we should avoid it.

This was reported by Raphael Geissert in a Debian bug report:
[r...@defaultvalue.org: adjust commit message]
Reviewed-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>

Thanks
--
Rob Browning
rlb @defaultvalue.org and @debian.org
GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A
GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
Reply all
Reply to author
Forward
0 new messages