Skip to contentSkip to conversation

logger 2.26: regression, option -i not combinable with other options

bug Juergen Daubert 4 participants 7 messages Feb 20, 2015 – Mar 5, 2015 Util-Linux package

lore
Share & tools
lore
#0 lore raw

Hello,

with logger from util-linux 2.25.x it's possible to combine the option -i with other options like:

logger -is

with 2.26 I get the following error message:

$:~> logger -is
logger: failed to parse id: 's'

The changed behaviour breaks existing scripts like dhcpcd-run-hooks [1] from dhcpcd [2].

Posible solution:
- don't combine the -i and --id options but keep the behaviour of -i and make --id a long-form only option.

Thanks and best regards
Juergen

[1] http://roy.marples.name/projects/dhcpcd/artifact/953bd27
[2] http://roy.marples.name/projects/dhcpcd/index

maintainer
#1 lore raw
Quoted 5 lines · Juergen Daubert

with logger from util-linux 2.25.x it's possible to combine the option -i with other options like:

logger -is

Quoted 7 lines

with 2.26 I get the following error message:

$:~> logger -is
logger: failed to parse id: 's'

The changed behaviour breaks existing scripts like dhcpcd-run-hooks [1] from dhcpcd [2].

Hmm... stupid regression, next time it would be probably better to introduce optional arguments for long options only.

Anyway, always use long options in scripts. It's more robust and more readable.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#2 lore raw
Quoted 11 lines · Karel Zak
Quoted 10 lines · Juergen Daubert

with logger from util-linux 2.25.x it's possible to combine the option -i with other options like:

logger -is

with 2.26 I get the following error message:

$:~> logger -is
logger: failed to parse id: 's'

Quoted 8 lines
Quoted 2 lines

The changed behaviour breaks existing scripts like dhcpcd-run-hooks [1] from dhcpcd [2].

Hmm... stupid regression, next time it would be probably better to introduce optional arguments for long options only.

Anyway, always use long options in scripts. It's more robust and more readable.

here's the response from dhcpcd's author:

The original BSD sources from which logger is clearly based don't support long options .... and dhcpcd needs to work with them.

Greetings
Juergen

#3 lore raw
Quoted 9 lines · Juergen Daubert
Quoted 8 lines · Karel Zak
Quoted 7 lines · Juergen Daubert

with logger from util-linux 2.25.x it's possible to combine the option -i with other options like:

logger -is

with 2.26 I get the following error message:

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

$:~> logger -is
logger: failed to parse id: 's'

The changed behaviour breaks existing scripts like dhcpcd-run-hooks [1] from dhcpcd [2].

Hmm... stupid regression, next time it would be probably better to introduce optional arguments for long options only.

I agree about both; stupid regression and the --id should not be mixed with -i option.

Quoted 7 lines
Quoted 2 lines

Anyway, always use long options in scripts. It's more robust and more readable.

here's the response from dhcpcd's author:

The original BSD sources from which logger is clearly based don't support long options .... and dhcpcd needs to work with them.

Technically speaking assigning short options is against POSIX.

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/logger.html

But removing short options would be so user unfriendly that proposing such change would lead to immediate tosspot of the year nomination. Clearly the 'logger -is' should keep on working the same way it always has. Here's my proposal how regression could be fixed.

https://github.com/kerolasa/lelux-utiliteetit/commit/bfe6c5d2381b510a4a0330c1c809a63e49b26840

Signature · 2 lines
Sami Kerola
http://www.iki.fi/kerolasa/
#4 lore raw
Quoted 4 lines · Sami Kerola

Clearly the 'logger -is' should keep on working the same way it always has. Here's my proposal how regression could be fixed.

https://github.com/kerolasa/lelux-utiliteetit/commit/bfe6c5d2381b510a4a0330c1c809a63e49b26840

The fix looks fine, of course. Just about the commit message:

s/loggerit's/logger it's/
s/options such as:/options, such as -s. But currently:/

Also, to make the fix complete the -i and -id options have to be separated in the usage text and the man page.

Benno

Signature · 1 line
http://www.fastmail.com - Does exactly what it says on the tin
#5 lore raw
Quoted 6 lines · Benno Schulenberg
Quoted 4 lines · Sami Kerola

Clearly the 'logger -is' should keep on working the same way it always has. Here's my proposal how regression could be fixed.

https://github.com/kerolasa/lelux-utiliteetit/commit/bfe6c5d2381b510a4a0330c1c809a63e49b26840

Quoted 7 lines

The fix looks fine, of course. Just about the commit message:

s/loggerit's/logger it's/
s/options such as:/options, such as -s. But currently:/

Also, to make the fix complete the -i and -id options have to be separated in the usage text and the man page.

Cheers Benno,

Improvements you mentioned are included in

https://github.com/kerolasa/lelux-utiliteetit/commit/87a34e69ff79ef5c2b81cee33902885e2255ac39

Signature · 2 lines
Sami Kerola
http://www.iki.fi/kerolasa/
maintainer
#6 lore raw
In reply to Juergen Daubert
Quoted 7 lines · Juergen Daubert

Hello,

with logger from util-linux 2.25.x it's possible to combine the option -i with other options like:

logger -is

Quoted 7 lines

with 2.26 I get the following error message:

$:~> logger -is
logger: failed to parse id: 's'

The changed behaviour breaks existing scripts like dhcpcd-run-hooks [1] from dhcpcd [2].

Fixed in git tree, the bugfix will be in v2.26.1 (probably last week this month or early).

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com