On Tue, Jun 06, 2017 at 06:00:51PM +0200, Michael Olbrich wrote:
> On Tue, Jun 06, 2017 at 05:28:48PM +0200, Gavin Schenk wrote:
> > rc-once ist based on systemd offline update mechanism.
> > https://www.freedesktop.org/software/systemd/man/systemd.offline-updates
> > 
> > To make it possible to have multiple update services beside rc-once the
> > script should check where the link /system-update points to.
> > 
> > rc-once will only run if the link points to etc/rc-once.d or
> > /etc/rc-once.d.
> > 
> > Signed-off-by: Gavin Schenk <g.sch...@eckelmann.de>
> > ---
> >  projectroot/usr/lib/init/rc-once.sh | 5 +++++
> >  rules/rc-once.in                    | 3 +++
> >  2 files changed, 8 insertions(+)
> > 
> > diff --git a/projectroot/usr/lib/init/rc-once.sh 
> > b/projectroot/usr/lib/init/rc-once.sh
> > index 8689a32bc..d225ad5c2 100644
> > --- a/projectroot/usr/lib/init/rc-once.sh
> > +++ b/projectroot/usr/lib/init/rc-once.sh
> > @@ -6,6 +6,11 @@ STAMP="$DONE_DIR/rc-once"
> >  
> >  run_rc_once() {
> >     failed=0
> > +   UPDATE_TARGET=$(readlink -f /system-update)
> 
> This needs quotes in case the link target contains spaces.

I think that's wrong. It only needs quoting when being used:

        $ cat test.sh 
        #!/bin/sh

        tmpdir=$(mktemp -d)

        touch "$tmpdir/file with        spaces";

        FILE=$(ls $tmpdir)

        echo "$FILE"

        rm -rf $tmpdir

        $ bash test.sh  | hexdump -C
        00000000  66 69 6c 65 20 77 69 74  68 09 73 70 61 63 65 73  |file 
with.spaces|
        00000010  0a                                                |.|
        00000011

That being said, quotes don't hurt either.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to