Re: [OE-core] should "${D}${systemd_unitdir}/system" => "${D}${systemd_system_unitdir}"?

Peter Kjellerstedt
2021-08-25T12:55:03Z

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Robert P. J. Day
> Sent: den 25 augusti 2021 14:42
> To: Ross Burton <ross@burtonini.com>
> Cc: OE Core mailing list <openembedded-core@lists.openembedded.org>
> Subject: Re: [OE-core] should "${D}${systemd_unitdir}/system" =>
> "${D}${systemd_system_unitdir}"?
>
> On Wed, 18 Aug 2021, Ross Burton wrote:
>
> > No, yes. systemd_system_unitdir is newer so it's used less.
> >
> > Ross
> >
> > On Wed, 18 Aug 2021 at 08:48, Robert P. J. Day <rpjday@crashcourse.ca>
> wrote:
> > >
> > >
> > > i've (so far) run across a small number of OE recipes that use the
> > > identifier "${D}${systemd_unitdir}/system", which appears(?) to be
> > > equivalent to "${D}${systemd_system_unitdir}". is there any potential
> > > functional difference, or should this be standardized?
>
> please help me with basic REs ... i want to run a single perl
> command of the form
>
> $ perl -pi -e 's|...|...|' $(all the relevant files)
>
> to change "${D}${systemd_unitdir}/system" ->
> "${D}${systemd_system_unitdir}"
>
> and then eyeball it afterwards to make sure it's sane, but i can't get
> the proper combination of quotes versus backslashes. i can generate
> the list of appropriate files with:
>
> $ grep -rl '${systemd_unitdir}/system' *
>
> but it's the perl expression that is defeating me. help.
>
> rday

Just use sed, it's what it's there for:

sed -ri -e 's|\$\{systemd_unitdir\}/system|${systemd_system_unitdir}|g' **/*(.)

(the **/*(.) part only works if you use zsh, for bash you will have
to use find and xargs instead).

//Peter