Skip to content

Script execution debug log: Replace back-tick by single quote#18

Closed
bbczeuz wants to merge 2 commits intoNetworkConfiguration:masterfrom
bbczeuz:zseng-fix-log-quotes
Closed

Script execution debug log: Replace back-tick by single quote#18
bbczeuz wants to merge 2 commits intoNetworkConfiguration:masterfrom
bbczeuz:zseng-fix-log-quotes

Conversation

@bbczeuz
Copy link

@bbczeuz bbczeuz commented Sep 9, 2020

This PR replaces the initial back-tick before the script name by a single quote. Simplifies parsing of the output log

Before:

dhcpcd-9.1.4 starting
no such user dhcpcd
DUID 00:04:72:01:1e:01:52:c2:11:cb:9d:49:d3:65:99:10:ec:5c
dummy0: executing `/usr/libexec/dhcpcd-run-hooks' PREINIT
dummy0: executing `/usr/libexec/dhcpcd-run-hooks' CARRIER
dummy0: IAID 26:55:d3:72
dummy0: delaying IPv4 for 0.7 seconds
dummy0: reading lease `/var/db/dhcpcd/dummy0.lease'
dummy0: soliciting a DHCP lease
dummy0: sending DISCOVER (xid 0xc74ba8ba), next in 3.1 seconds
[...]

After:

dhcpcd-9.1.4 starting
no such user dhcpcd
DUID 00:04:72:01:1e:01:52:c2:11:cb:9d:49:d3:65:99:10:ec:5c
dummy0: executing '/usr/libexec/dhcpcd-run-hooks' PREINIT
dummy0: executing '/usr/libexec/dhcpcd-run-hooks' CARRIER
dummy0: IAID 26:55:d3:72
dummy0: delaying IPv4 for 0.7 seconds
dummy0: reading lease '/var/db/dhcpcd/dummy0.lease'
dummy0: soliciting a DHCP lease
dummy0: sending DISCOVER (xid 0xc74ba8ba), next in 3.1 seconds
[...]

(Compare lines 4, 5 & 8)

@bbczeuz
Copy link
Author

bbczeuz commented Sep 9, 2020

Don't merge yet, there are more similar issues. Is there some intention behind this?

@bbczeuz
Copy link
Author

bbczeuz commented Sep 9, 2020

Actually, there are still 28 such cases. What's the intention behind this?

@bbczeuz
Copy link
Author

bbczeuz commented Sep 9, 2020

Commit 127c06e fixes the remaining cases, just in case you want to merge this change.

@rsmarples
Copy link
Member

@bbczeuz I think the intention was that gcc at the time - or something else I was using many years ago, did the same.
I think I would be happier if we just removed them and maybe prefix with : .... like so

dummy0: executing '/usr/libexec/dhcpcd-run-hooks' CARRIER
dummy0: reading lease `/var/db/dhcpcd/dummy0.lease'

becomes

dummy0: executing: /usr/libexec/dhcpcd-run-hooks CARRIER
dummy0: reading lease: /var/db/dhcpcd/dummy0.lease

Thoughts?

@bbczeuz
Copy link
Author

bbczeuz commented Oct 1, 2020

I don't really mind. Quotes suggest a string, but we don't do any escaping anyhow, so it doesn't matter. Do you want me to update the PR to the colon-version (and rebase?)?

@rsmarples
Copy link
Member

It's all a string :)
A lot of BSD tools behave like this, so I fine with it.
If people want to be nutty enough to put a space in the script filename for example, that's up to them.
Note that the SSID used in lease files is escaped so would look like

/var/db/dhcpcd/dummy0\ a\ spaced\ ssid.lease

Although it might escape using octal rather than a space. I've not checked that in a while.

Sure, go head and do it and we'll see about merging it.

@rsmarples
Copy link
Member

I've decided to do this myself as I need to get a release out soon.
Thanks anyway for the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants