[OE-core] [PATCH] util-linux: Use u-a for getopt

Martin Jansa martin.jansa at gmail.com
Fri Mar 22 09:15:49 UTC 2013


On Fri, Mar 22, 2013 at 09:08:34AM +0100, Bernhard Reutner-Fischer wrote:
> On 20 March 2013 16:09:10 Martin Jansa <martin.jansa at gmail.com> wrote:
> > * when enable busybox installs getopt to ${base_bindir} and
> >   util-linux to ${bindir}, so there is no file conflict, but
> >   because busybox implementation does not support --long used
> 
> Do you mean that Busybox' getopt does not support long options?
> If so, enable FEATURE_GETOPT_LONG in busybox instead of this patch?

Having lsb working correctly even when someone has bad busybox defconfig
is right thing to do, isn't it?

busybox's getopt supports --longoptions, but util-linux's also supports
--long alias for that and that's what lsb is using

$ getopt --longoptions
getopt: option '--longoptions' requires an argument
Try `getopt --help' for more information.
$ getopt --long
getopt: option '--longoptions' requires an argument
Try `getopt --help' for more information.

busybox (IIRC even with FEATURE_GETOPT_LONG enabled) reports
getopt: unrecognized option '--long'
BusyBox v1.20.2 (2013-03-16 17:45:30 PDT) multi-call binary.

lsb already RDEPENDS on util-linux, changing lsb to use --longoptions
would be good, but having /bin/getopt and /usr/bin/getopt without u-a 
to select preferred one is bad, that's why I used this solution instead.

> >   by lsb_release (which RDEPENDS on util-linux) we need to use
> >   util-linux getopt even when busybox defconfig has it enabled
> >
> > Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
> > ---
> >  meta/recipes-core/util-linux/util-linux.inc       | 6 ++++--
> >  meta/recipes-core/util-linux/util-linux_2.22.2.bb | 2 +-
> >  2 files changed, 5 insertions(+), 3 deletions(-)
> >
> > diff --git a/meta/recipes-core/util-linux/util-linux.inc 
> > b/meta/recipes-core/util-linux/util-linux.inc
> > index 41a5471..c75d318 100644
> > --- a/meta/recipes-core/util-linux/util-linux.inc
> > +++ b/meta/recipes-core/util-linux/util-linux.inc
> > @@ -110,7 +110,7 @@ do_install () {
> >
> >          sbinprogs="agetty ctrlaltdel cfdisk vipw vigr"
> >          sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup 
> >          swapon fdisk readprofile fsck blkid blockdev"
> > -        usrbinprogs_a="chfn chsh hexdump last logger mesg newgrp 
> > renice utmpdump wall setsid chrt flock"
> > +        usrbinprogs_a="chfn chsh hexdump last logger mesg newgrp 
> > renice utmpdump wall setsid chrt flock getopt"
> >          binprogs_a="dmesg kill more umount mount login reset"
> >
> >          if [ "${base_sbindir}" != "${sbindir}" ]; then
> > @@ -146,7 +146,7 @@ ALTERNATIVE_PRIORITY = "100"
> >
> >  ALTERNATIVE_${PN}  = "dmesg kill more mkswap blockdev pivot_root"
> >  ALTERNATIVE_${PN} += "mkfs.minix hexdump last logger mesg renice wall"
> > -ALTERNATIVE_${PN} += "setsid chrt flock hwclock utmpdump eject"
> > +ALTERNATIVE_${PN} += "setsid chrt flock hwclock utmpdump eject getopt"
> >
> >  ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
> >  ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
> > @@ -156,6 +156,8 @@ ALTERNATIVE_LINK_NAME[blockdev] = 
> > "${base_sbindir}/blockdev"
> >  ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
> >  ALTERNATIVE_LINK_NAME[mkfs.minix] = "${base_sbindir}/mkfs.minix"
> >  ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
> > +ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt"
> > +ALTERNATIVE_TARGET[getopt] = "${bindir}/getopt"
> >
> >  ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 mesg.1 wall.1 sulogin.8 
> >  utmpdump.1"
> >
> > diff --git a/meta/recipes-core/util-linux/util-linux_2.22.2.bb 
> > b/meta/recipes-core/util-linux/util-linux_2.22.2.bb
> > index 9b94a47..43a55a6 100644
> > --- a/meta/recipes-core/util-linux/util-linux_2.22.2.bb
> > +++ b/meta/recipes-core/util-linux/util-linux_2.22.2.bb
> > @@ -1,5 +1,5 @@
> >  MAJOR_VERSION = "2.22"
> > -PR = "r2"
> > +PR = "r3"
> >  require util-linux.inc
> >
> >  SRC_URI += "file://util-linux-ng-replace-siginterrupt.patch \
> > --
> > 1.8.1.5
> >
> >
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core at lists.openembedded.org
> > http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
> 
> 
> Sent with AquaMail for Android
> http://www.aqua-mail.com
> 
> 

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20130322/523c2fd8/attachment-0002.sig>


More information about the Openembedded-core mailing list