FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 06-02-2008, 04:15 PM
Allan McRae
 
Default makepkg : switch from getopt to getopts builtin

Alessio Bolognino wrote:
> On Mon 2008-06-02 11:54, Xavier wrote:
>
>> >From f5c5a277e2df14650ae441f32950aa6d4deee50f Mon Sep 17 00:00:00 2001
>> From: Xavier Chantry <shiningxc@gmail.com>
>> Date: Wed, 28 May 2008 21:57:28 +0200
>> Subject: [PATCH] makepkg : switch from getopt to getopts builtin
>>
>> getopt is an external script for parsing and is less portable than getopts
>> which is a bash builtin.
>> The main problem is that it only supports short opts, so long opts had to be
>> dropped.
>> The benefits are a much better portability and a simpler code for the
>> arguments parsing.
>>
>
> Maybe dropping all long options is not a great idea: makepkg has a lot
> of options and find an alphanumeric character for each is not that
> easy/intuitive; Furthermore getopt is ported virtually everywhere: Mac
> OS X, FreeBSD, OpenBSD, NetBSD etc. and stuff like asciidoc
> depends upon it.
>
>

Wasn't the whole point of this that getopt didn't work properly/as
expected on BSD?

> Bear in mind I don't have a strong opinion about that, I was just
> playing devil's advocate
>

Well, I am not a fan! Has anybody looked into parsing options
manually? I seem to recall Xavier point out a bash implementation that
could be used. makepkg does not have anything too complex (options take
one arg max) so it should be fairly easy. I'd much prefer a
parse_options function to be added than to lose all the long options.
However, if that proves too complex a solution, I will graciously accept
defeat...

Allan



_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 03:54 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org