On Mon, Apr 25, 2016 at 03:23:47PM +0000, Robert Peichaer wrote:
> On Mon, Apr 25, 2016 at 10:57:37AM -0400, Ted Unangst wrote:
> > Theo de Raadt wrote:
> > > +                 cp -p /usr/lib/$_lib /usr/lib/$_tmplib
> > > +                 install -o root -g bin -m 0444 $_lib /usr/lib/$_lib &&
> > > +                         rm -f /usr/lib/$_tmplib ||
> > > +                         mv /usr/lib/$_tmplib /usr/lib/$_lib
> > 
> > I'm a little confused by what's going on here. If the install fails, do we
> > still want to overwrite the lib?
>  
> 
> If the install fails, the original library file is restored.
> 
> The "install .. && rm .. || mv ..." is identical to if-then-else and could
> be written like this too.

Nitpicking: nope, It is not identical, see:
https://github.com/koalaman/shellcheck/wiki/SC2015

Though, may not matter here.

>       if install -o root -g bin -m 0444 $_lib /usr/lib/$_lib; then
>               rm -f /usr/lib/$_tmplib
>       else
>               mv /usr/lib/$_tmplib /usr/lib/$_lib
>       fi
> 

Reply via email to