poky.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: "Ramsay, Lincoln" <Lincoln.Ramsay@digi.com>
To: poky@lists.yoctoproject.org
Subject: Cannot enable a templated service where the instance starts with a number
Date: Wed, 05 Jul 2023 17:36:47 -0700	[thread overview]
Message-ID: <zaH1.1688603807958251008.7uhU@lists.yoctoproject.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]

Hi folks,

We just tried to update our poky submodule (kirkstone branch) and hit a problem because of this change: https://git.yoctoproject.org/poky/commit/?h=kirkstone&id=7f8a4aa6cf240a5cdda012837f3f3f7a0f9bbf1c

The problem is that we install some templated services like so:

SYSTEMD_SERVICE:${PN} = "\
wsapi-fcgi.socket \
wsapi-fcgi@1.service \

In do_rootfs, the poky systemctl is told to enable the service and so instance is set to "1".

The problem is that the re.sub uses \\1 and then pastes the instance name in, so in our case, it ends up as \\11, which fails because there is only 1 match in the pattern.

python has a solution for this, which is to use \\g<1>.

eg.

-                dependent = re.sub("([^%](%%)*)%i", "\\1{}".format(instance), dependent)
+                dependent = re.sub("([^%](%%)*)%i", "\\g<1>{}".format(instance), dependent)

I am not sure which other poky branches this change is on... presumably at least all of the newer ones.

I'm not sure of the normal process for proposing patches to poky, hence this email.

Thanks,
Lincoln

[-- Attachment #2: Type: text/html, Size: 15710 bytes --]

             reply	other threads:[~2023-07-06  0:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06  0:36 Ramsay, Lincoln [this message]
2023-07-06  9:50 ` [poky] Cannot enable a templated service where the instance starts with a number Alexander Kanavin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=zaH1.1688603807958251008.7uhU@lists.yoctoproject.org \
    --to=lincoln.ramsay@digi.com \
    --cc=poky@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).