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 04-12-2012, 02:54 PM
Dave Reisner
 
Default makepkg: adopt parseopts for option parsing

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
---
doc/makepkg.8.txt | 3 ++-
scripts/Makefile.am | 2 +-
scripts/makepkg.sh.in | 10 +++++-----
3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt
index df41e18..f80d7f2 100644
--- a/doc/makepkg.8.txt
+++ b/doc/makepkg.8.txt
@@ -153,7 +153,8 @@ Options
the GPL when distributing binary packages.

*--pkg <list>*::
- Only build listed packages from a split package.
+ Only build listed packages from a split package. Multiple packages should
+ be comma separated in the list.

*--check*::
Run the check() function in the PKGBUILD, overriding the setting in
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 7662fba..0df90e1 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -68,7 +68,7 @@ $(OURSCRIPTS): Makefile

makepkg:
$(srcdir)/makepkg.sh.in
- $(srcdir)/library/parse_options.sh
+ $(srcdir)/library/parseopts.sh

pacman-db-upgrade:
$(srcdir)/pacman-db-upgrade.sh.in
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 46191ee..4e3b0e3 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1885,7 +1885,7 @@ canonicalize_path() {
fi
}

-m4_include(library/parse_options.sh)
+m4_include(library/parseopts.sh)

usage() {
printf "makepkg (pacman) %s
" "$myver"
@@ -1962,11 +1962,11 @@ OPT_LONG+=",version,config:"

# Pacman Options
OPT_LONG+=",noconfirm,noprogressbar"
-if ! OPT_TEMP="$(parse_options $OPT_SHORT $OPT_LONG "$@")"; then
+if ! parseopts "$OPT_SHORT" "$OPT_LONG" "$@"; then
echo; usage; exit 1 # E_INVALID_OPTION;
fi
-eval set -- "$OPT_TEMP"
-unset OPT_SHORT OPT_LONG OPT_TEMP
+set -- "${OPTRET[@]}"
+unset OPT_SHORT OPT_LONG OPTRET

while true; do
case "$1" in
@@ -1997,7 +1997,7 @@ while true; do
--nosign) SIGNPKG='n' ;;
-o|--nobuild) NOBUILD=1 ;;
-p) shift; BUILDFILE=$1 ;;
- --pkg) shift; PKGLIST=($1) ;;
+ --pkg) shift; IFS=, read -ra PKGLIST <<<"$1" ;;
-r|--rmdeps) RMDEPS=1 ;;
-R|--repackage) REPKG=1 ;;
--skipchecksums) SKIPCHECKSUMS=1 ;;
--
1.7.10
 
Old 04-13-2012, 03:53 AM
Allan McRae
 
Default makepkg: adopt parseopts for option parsing

On 13/04/12 00:54, Dave Reisner wrote:
> Signed-off-by: Dave Reisner <dreisner@archlinux.org>

Ack once a patch is added to prevent pkgname containing a comma. As no
package in existence (being the Arch repos and the AUR...) has a comma
in its name, that will not break anything so I decided it is best to be
proactive here.

Allan
 

Thread Tools




All times are GMT. The time now is 01:06 PM.

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