[rear-users] need testing advice - REQUIRED_PROGS containing spaces

Robert Owens rowens at fdrinnovation.com
Wed Oct 21 18:07:27 CEST 2015


FDR/Upstream installs by default in /opt/fdrupstream, and we do not add 
that to $PATH. So I was happy to find that I could specify the fully 
qualified names of programs to check.

I agree that spaces in the install path should generally be avoided, but 
we allow users to specify an alternate install path, and we don't 
prohibit spaces.  So I'm glad that ReaR will accept pull requests to 
make things easier for the troublemakers out there who like spaces in 
their install paths.

Thanks to both you and Gratien for your feedback.

-Rob

On 10/21/2015 11:50 AM, Schlomo Schapiro wrote:
> Hi Robert,
>
> quoting is always good and I can't imagine a case where it would have
> been a feature that quoting is bad. The really few cases where I used
> Bash tricks I actually put a large comment above it mentioning the fact
> that this line does not have quotes on purpose.
>
> The reason why there are no quotes so far is very simple: The has_binary
> function is intended to check for the existance of programs in $PATH,
> without the need to know where exactly in $PATH the program lies. The
> fact that it also works with fully qualified file names is more of a
> welcome side effect and not the typical use case.
>
> I noticed the use of fully qualified file names in your pull requests
> and decided to not talk about it because I thought that you have your
> reasons.
>
> IMHO on Unix/Linux installing software in directories with spaces in the
> name is a really bad idea and not something that is a very common
> requirement.
>
> But, the purpose of ReaR is to serve the needs ot our users so that we
> will be happy to accept pull requests that enable ReaR to support such
> scenarios like you describe.
>
> :-)
>
> Kind Regards,
> Schlomo
>
> On 21 October 2015 at 18:04, Gratien D'haese <gratien.dhaese at it3.be
> <mailto:gratien.dhaese at it3.be>> wrote:
>
>     That should work in other situations as well - more testing required
>     of course
>     Gratien
>
>
>     On Wed, 21 Oct 2015 11:19:04 -0400, Robert Owens
>     <rowens at fdrinnovation.com <mailto:rowens at fdrinnovation.com>> wrote:
>
>         I'd like to make a change that would allow spaces in the contents of
>         REQUIRED_PROGS.  This would allow checking for programs that may be
>         installed in a directory containing a space.
>
>         I've tested this using BACKUP=FDRUPSTREAM and it works.  But since
>         this change would affect all ReaR users, and not just users of my
>         company's backup product, I'm looking for advice on test cases, or
>         thoughts on where this could go wrong.
>
>         The change is small.  I've simply quoted the two variables in the
>         has_binary function of
>         /usr/share/rear/lib/_input-output-functions.sh:
>
>         # Check if any of the binaries/aliases exist
>         has_binary() {
>                  for bin in "$@"; do
>                          if type "$bin" >&8 2>&1; then
>                                  return 0
>                          fi
>                  done
>                  return 1
>         }
>
>         Thoughts?
>
>         _______________________________________________
>         rear-users mailing list
>         rear-users at lists.relax-and-recover.org
>         <mailto:rear-users at lists.relax-and-recover.org>
>         http://pikachu.3ti.be/mailman/listinfo/rear-users
>
>
>     --
>     Gratien D'haese
>     IT3 Consultants bvba
>     Vennestraat 15, B-2560 Nijlen
>
>     _______________________________________________
>     rear-users mailing list
>     rear-users at lists.relax-and-recover.org
>     <mailto:rear-users at lists.relax-and-recover.org>
>     http://pikachu.3ti.be/mailman/listinfo/rear-users



More information about the rear-users mailing list