Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] profile-sync-daemon "bad substitution" at boot
Date: Thu, 06 Sep 2018 08:27:32
Message-Id: 2590696.IllPHginTI@dell_xps
In Reply to: Re: [gentoo-user] profile-sync-daemon "bad substitution" at boot by Alexander Kapshuk
1 On Thursday, 6 September 2018 09:22:35 BST Alexander Kapshuk wrote:
2 > On Thu, Sep 6, 2018 at 11:18 AM Alexander Kapshuk
3 >
4 > <alexander.kapshuk@×××××.com> wrote:
5 > > On Thu, Sep 6, 2018 at 10:48 AM Samuraiii <samurai.no.dojo@×××××.com>
6 wrote:
7 > > > On 5.9.2018 21:20, Mick wrote:
8 > > >
9 > > > Hi All,
10 > > >
11 > > > I just noticed a psd error at boot time:
12 > > >
13 > > > /usr/bin/profile-sync-daemon: line 325: ${#DIRArr[@]##*/}: bad
14 > > > substitution
15 > > >
16 > > > Any idea what's brought this about?
17 > > >
18 > > > Hi,
19 > > >
20 > > > my bet is that your /bin/sh != /bin/bash and
21 > > > /usr/bin/profile-sync-daemon starts with #!/bin/sh.
22 > > >
23 > > > The other way around /usr/bin/profile-sync-daemon contains bashishms.
24 > > >
25 > > > You can try (as a test) to change #!/bin/sh for #!/bin/bash...
26 > > >
27 > > > S
28 > >
29 > > The shebang in the master repository is '#!/bin/bash'.
30 > > https://raw.githubusercontent.com/graysky2/profile-sync-daemon/master/comm
31 > > on/profile-sync-daemon.in
32 > >
33 > > The error message is a shell parameter expansion syntax error, which
34 > > comprises two different expansion constructs referenced below.
35 > > ${#parameter}
36 > > String Length.
37 > >
38 > > ${parameter##[word]}
39 > > Remove Largest Prefix Pattern.
40 > >
41 > > See section 2.6.2 Parameter Expansion,
42 > > http://pubs.opengroup.org/onlinepubs/9699919799/nframe.html.
43 > >
44 > > The script in the master repository referenced above does not contain
45 > > the line in question. It has '${#DIRArr[@]/}' and '${DIRArr[@]##*/}'.
46 >
47 > This appears to have been reported as a bug in Debian [1]
48 > [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839049
49 > And applied upstream [2].
50 > https://github.com/graysky2/profile-sync-daemon/pull/185/files/654f5359abfe7
51 > aab2e1616dd74c8ba0f76ce4ab4
52
53 Thanks Alexander, good catch!
54 --
55 Regards,
56 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature