You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Dario Niedermann <dn...@tiscali.it> on 2016/09/27 10:59:44 UTC

[Linux] Hook hashbang hardships

Hello! I've been having trouble getting my own pre-revprop-change
hook script to work. Svn was refusing any change to a revprop with
the following error:
________________________________________
svn: E165001: Revprop change blocked by pre-revprop-change hook
(exit code 1) with no output.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Until I found out that the issue was in the script's shebang:

	#!/bin/bash -e

which wouldn't work. Had to remove ' -e'. Is this expected behaviour
or is there something wrong with svn (version 1.9.4 (r1740329) on
Linux/x86_64) ?

Thanks,
DN

RE: [Linux] Hook hashbang hardships

Posted by Andrew Reedick <jr...@incomm.com>.

> -----Original Message-----
> From: Branko Čibej [mailto:brane@apache.org] 
> Sent: Friday, October 14, 2016 9:38 AM
> To: users@subversion.apache.org
> Subject: Re: [Linux] Hook hashbang hardships
>
> On 14.10.2016 14:58, Andrew Reedick wrote:
> >> Hello! I've been having trouble getting my own pre-revprop-change hook script to work. Svn was refusing any change to a revprop with the following error:
> >> ________________________________________
> >> svn: E165001: Revprop change blocked by pre-revprop-change hook (exit code 1) with no output.
> >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >>
> >> Until I found out that the issue was in the script's shebang:
> >>
> >> 	#!/bin/bash -e
> >>
> >> which wouldn't work. Had to remove ' -e'. Is this expected behaviour or is there something wrong with svn (version 1.9.4 (r1740329) on
> >> Linux/x86_64) ?
> >
> > Bash doesn't appear to have a "-e" option.  (There is a "-e" test to check if a path exists, but that's not a command line arg you pass in to bash.)
> >
> > /bin/bash --help
> > man bash
> > https://linux.die.net/man/1/bash
>
>
> You really need to read the manpage, which says:
>
>     All  of  the   single-character  shell  options  documented  in the
>     description of the *set* builtin command can be used as options when
>     the shell is invoked.


Let's go all the way down the rabbit hole:  http://ss64.com/bash/set.html

-e  Exit immediately if a simple command exits with a non-zero status, unless
       the command that fails is part of an until or  while loop, part of an
       if statement, part of a && or || list, or if the command's return status
       is being inverted using !.  -o errexit

Plan B; add -x to see what's going on:  #!/bin/bash -ex




Re: [Linux] Hook hashbang hardships

Posted by Branko Čibej <br...@apache.org>.
On 14.10.2016 14:58, Andrew Reedick wrote:
>> Hello! I've been having trouble getting my own pre-revprop-change hook script to work. Svn was refusing any change to a revprop with the following error:
>> ________________________________________
>> svn: E165001: Revprop change blocked by pre-revprop-change hook (exit code 1) with no output.
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Until I found out that the issue was in the script's shebang:
>>
>> 	#!/bin/bash -e
>>
>> which wouldn't work. Had to remove ' -e'. Is this expected behaviour or is there something wrong with svn (version 1.9.4 (r1740329) on
>> Linux/x86_64) ?
>
> Bash doesn't appear to have a "-e" option.  (There is a "-e" test to check if a path exists, but that's not a command line arg you pass in to bash.)
>
> /bin/bash --help
> man bash
> https://linux.die.net/man/1/bash


You really need to read the manpage, which says:

    All  of  the   single-character  shell  options  documented  in the
    description of the *set* builtin command can be used as options when
    the shell is invoked.


-- Brane

RE: [Linux] Hook hashbang hardships

Posted by Andrew Reedick <jr...@incomm.com>.
> Hello! I've been having trouble getting my own pre-revprop-change hook script to work. Svn was refusing any change to a revprop with the following error:
> ________________________________________
> svn: E165001: Revprop change blocked by pre-revprop-change hook (exit code 1) with no output.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Until I found out that the issue was in the script's shebang:
>
>	#!/bin/bash -e
>
> which wouldn't work. Had to remove ' -e'. Is this expected behaviour or is there something wrong with svn (version 1.9.4 (r1740329) on
> Linux/x86_64) ?


Bash doesn't appear to have a "-e" option.  (There is a "-e" test to check if a path exists, but that's not a command line arg you pass in to bash.)

/bin/bash --help
man bash
https://linux.die.net/man/1/bash


Re: [Linux] Hook hashbang hardships

Posted by Ralph Seichter <su...@seichter.de>.
On 27.09.2016 12:59, Dario Niedermann wrote:

> I found out that the issue was in the script's shebang:
>
> #!/bin/bash -e
>
> which wouldn't work. Had to remove ' -e'. Is this expected behaviour or
> is there something wrong with svn (version 1.9.4 (r1740329) on
> Linux/x86_64) ?

Why would anything be wrong with Subversion? Apparently something is not
going as expected in your own script, causing bash to exit.

Scripts always have to be adapted to local needs. On some systems, the
path for bash might be different, or bash might not be available at all.
That's each user's own responsibility.

-Ralph