Pacman-dev
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
October 2016
- 26 participants
- 40 discussions
Hello everyone,
We have had some discussion about that local database and how it could
be improved.
I thought it would be useful to have a summary of what options touch
what files in the local db:
-R <pkg>
all "desc" files
single "files" file
-S (something that installs a package...)
all "desc" files
single/multiple "files" files during package upgrades
-Q stuff:
-c <pkg> -> single "changelog" file per package
-l <pkg> -> single "files" file per package
-k <pkg> -> single "files/mtree" file per package
-kk <pkg> -> single "mtree" file per package
-d, -e, -g, -i, -m, -s, -t, -u
all "desc" files
-l, -o (, -k)
all "files" files
-c
all "changelog" files
-kk (, -k)
all "mtree" files
What can we conclude from this?
1) no operation reads a single "desc" file
2) -Qo is the only operation to gain from efficient reading of all
"files" files. (-Ql may also gain, but is probably output bound)
3) having "desc" and "files" files separate and only loading these files
if we need it is a gain.
4) all operations on mtree files require lots of disk access, so there
is not much gain in increasing the efficiency of reading these.
Allan
2
2
[pacman-dev] [GIT] The official pacman repository branch, master, updated. v5.0.1-95-gfa06951
by allan@archlinux.org 22 Oct '16
by allan@archlinux.org 22 Oct '16
22 Oct '16
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The official pacman repository".
The branch, master has been updated
via fa06951d90fee028ece95fc7caab39fc7d35d55f (commit)
via a55adb81d0f6fcd7fe98cc444806b3b0d25efc9c (commit)
via a79be86f5751b4341f1339a32a5a8737439ac28d (commit)
via e8c35bea2bc6cdf616af71806558034f08cb58a3 (commit)
via 4c4ce473d6a671234be534414ba3660c7267c9ee (commit)
via 577701250d645d1fc1a505cde34aedbeb3208ea5 (commit)
via 603f087cd73aff0d39bf0ebfb23aaae5626cb814 (commit)
via 1f8f0bd9ac4c11cdc1b9506f9f64d8192ecad4ee (commit)
via dfc78129be7acaa0ebe71fe407d63b5141c10150 (commit)
via aca153bfa6b1bcd828f0b35db453bb9fea6a08bf (commit)
via 8c55c0096c355e973ce6111cb25a1c4fa05953cf (commit)
from ad27aa30fbcac7a07586072d29d3db50009994e9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fa06951d90fee028ece95fc7caab39fc7d35d55f
Author: Ivy Foster <ivy.foster(a)gmail.com>
Date: Wed Oct 12 15:13:32 2016 -0500
Represent bitfields as ints, not enums
Many bitfield variables are declared to be enums, because they are
generated using bitwise operations on enums such. However, their
actual values aren't necessary members of their parent enum, so
declaring them 'int' is more accurate.
Signed-off-by: Ivy Foster <ivy.foster(a)gmail.com>
Signed-off-by: Allan McRae <allan(a)archlinux.org>
commit a55adb81d0f6fcd7fe98cc444806b3b0d25efc9c
Author: Ivy Foster <ivy.foster(a)gmail.com>
Date: Wed Oct 12 15:13:31 2016 -0500
Add ALPM_ERR_OK to _alpm_errno_t
This allows functions which return an _alpm_errno_t to always return a
genuine _alpm_errno_t for consistency, even in cases where there are
no errors. Since ALPM_ERR_OK = 0, their callers can still simply check
'err = some_fn(); if (!err) { ... }'.
Signed-off-by: Ivy Foster <ivy.foster(a)gmail.com>
Signed-off-by: Allan McRae <allan(a)archlinux.org>
commit a79be86f5751b4341f1339a32a5a8737439ac28d
Author: Ivy Foster <ivy.foster(a)gmail.com>
Date: Fri Oct 14 17:13:05 2016 -0500
doc/pacman.8.txt: improve description of -Qt
Though correct, the wording of the description of Query's
-t/--unrequired option was confusing. Closes FS#48144.
Signed-off-by: Ivy Foster <ivy.foster(a)gmail.com>
Signed-off-by: Allan McRae <allan(a)archlinux.org>
commit e8c35bea2bc6cdf616af71806558034f08cb58a3
Author: Ivy Foster <ivy.foster(a)gmail.com>
Date: Sat Oct 15 18:34:49 2016 -0500
makepkg: print files with refs to $srcdir/$pkgdir
Since rewriting build_references() anyway, tweaked quoting.
Implements FS#31558.
Signed-off-by: Ivy Foster <ivy.foster(a)gmail.com>
Signed-off-by: Allan McRae <allan(a)archlinux.org>
commit 4c4ce473d6a671234be534414ba3660c7267c9ee
Author: Allan McRae <allan(a)archlinux.org>
Date: Mon Oct 17 22:00:11 2016 +1000
Remove pactree
This has been moved to the pacman-contrib project.
Signed-off-by: Allan McRae <allan(a)archlinux.org>
commit 577701250d645d1fc1a505cde34aedbeb3208ea5
Author: Allan McRae <allan(a)archlinux.org>
Date: Tue Oct 11 23:04:25 2016 +1000
Use coreutils binaries for checking/generating checksums
If pacman is build against a crypto library other than openssl, it makes no
sense to require makepkg to use it.
The only currently considered alternative to openssl is nettle, which has no
binary for base64 encode/decode. This means that we could replace the hashing
cacluations with nettle-hash, but would require base64 from coreutils.
Given makepkg already relies heavily on coreutils, we might as well use all
the coreutils hashing binaries too.
This patch also improves the checking of required binaries for hashing
operations.
Signed-off-by: Allan McRae <allan(a)archlinux.org>
commit 603f087cd73aff0d39bf0ebfb23aaae5626cb814
Author: Florian Weigelt <weigelt.florian(a)gmx.net>
Date: Tue Oct 11 21:20:11 2016 +1000
Allow replacing libcrypto with libnettle in pacman
Add a --with-nettle configure option that directs pacman to use the libnettle
hashing functions. Only one of the --with-libssl and --with-nettle configure
options can be specified.
[Allan: rewrote configure check]
Signed-off-by: Allan McRae <allan(a)archlinux.org>
commit 1f8f0bd9ac4c11cdc1b9506f9f64d8192ecad4ee
Author: Alad Wenter <alad(a)archlinux.info>
Date: Mon Oct 10 10:47:38 2016 +0200
makepkg: Move parseopts from library to libmakepkg
parseopts is used in makepkg and other scripts such as pacman-key as a
getopt replacement.
Instead of including it in those scripts via a macro, move it to
libmakepkg/util/parseopts.sh and have scripts source this file where
appropriate.
To keep the parseopts test, a new variable was introduced:
PM_LIBMAKEPKG_DIR
Signed-off-by: Alad Wenter <alad(a)archlinux.info>
Signed-off-by: Allan McRae <allan(a)archlinux.org>
commit dfc78129be7acaa0ebe71fe407d63b5141c10150
Author: Allan McRae <allan(a)archlinux.org>
Date: Wed Oct 12 15:27:26 2016 +1000
Generalise makepkg-wrapper to handle any script using libmakepkg
Signed-off-by: Allan McRae <allan(a)archlinux.org>
commit aca153bfa6b1bcd828f0b35db453bb9fea6a08bf
Author: Alad Wenter <alad(a)archlinux.info>
Date: Sat Oct 8 19:34:15 2016 +0200
libmakepkg: generate all scripts
In order for the scripts to be used in testsuites, it is easiest to generate
all of them so they are found in the build directory (which may be different
to the source directory).
Signed-off-by: Alad Wenter <alad(a)archlinux.info>
Signed-off-by: Allan McRae <allan(a)archlinux.org>
commit 8c55c0096c355e973ce6111cb25a1c4fa05953cf
Author: Martin Kühne <mysatyre(a)gmail.com>
Date: Tue Oct 11 18:36:17 2016 +0200
Use f_bavail for diskspace calculations
This should make pacman's behavior consistent with GNU coreutils df,
as well as follow advice from affected filesystems' devs as well as
`man statvfs`.
This fixes FS#37402
Signed-off-by: Martin Kühne <mysatyre(a)gmail.com>
Signed-off-by: Allan McRae <allan(a)archlinux.org>
-----------------------------------------------------------------------
Summary of changes:
Makefile.am | 3 +-
configure.ac | 32 +-
doc/.gitignore | 1 -
doc/Makefile.am | 4 -
doc/pacman.8.txt | 8 +-
doc/pactree.8.txt | 69 ---
lib/libalpm/Makefile.am | 6 +-
lib/libalpm/alpm.c | 2 +-
lib/libalpm/alpm.h | 36 +-
lib/libalpm/be_local.c | 8 +-
lib/libalpm/be_package.c | 10 +-
lib/libalpm/be_sync.c | 30 +-
lib/libalpm/db.c | 26 +-
lib/libalpm/db.h | 16 +-
lib/libalpm/diskspace.c | 6 +-
lib/libalpm/dload.c | 2 +-
lib/libalpm/handle.c | 12 +-
lib/libalpm/handle.h | 6 +-
lib/libalpm/libalpm.pc.in | 2 +-
lib/libalpm/package.c | 82 ++--
lib/libalpm/package.h | 13 +-
lib/libalpm/signing.c | 6 +-
lib/libalpm/sync.c | 24 +-
lib/libalpm/trans.c | 4 +-
lib/libalpm/trans.h | 6 +-
lib/libalpm/util.c | 41 +-
lib/libalpm/util.h | 4 +-
scripts/.gitignore | 2 +-
scripts/Makefile.am | 58 ++-
.../libmakepkg/integrity/generate_checksum.sh.in | 9 +-
scripts/libmakepkg/integrity/verify_checksum.sh.in | 4 +-
.../libmakepkg/lint_package/build_references.sh.in | 16 +-
.../libmakepkg/util/{message.sh => message.sh.in} | 0
.../libmakepkg/util/{option.sh => option.sh.in} | 0
.../util/parseopts.sh.in} | 50 +-
scripts/libmakepkg/util/{util.sh => util.sh.in} | 0
scripts/library/README | 20 -
scripts/makepkg.sh.in | 26 +-
scripts/pacman-db-upgrade.sh.in | 5 +-
scripts/pacman-key.sh.in | 7 +-
scripts/pkgdelta.sh.in | 7 +-
scripts/po/POTFILES.in | 4 +-
scripts/repo-add.sh.in | 16 +-
scripts/{makepkg-wrapper.sh.in => wrapper.sh.in} | 4 +-
src/pacman/conf.c | 17 +-
src/pacman/conf.h | 24 +-
src/pacman/package.c | 2 +-
src/pacman/sync.c | 2 +-
src/pacman/upgrade.c | 8 +-
src/pacman/util.c | 2 +-
src/pacman/util.h | 3 +-
src/util/.gitignore | 2 -
src/util/Makefile.am | 5 +-
src/util/cleanupdelta.c | 4 +-
src/util/pactree.c | 510 ---------------------
src/util/testpkg.c | 4 +-
test/scripts/parseopts_test.sh | 2 +-
57 files changed, 391 insertions(+), 881 deletions(-)
delete mode 100644 doc/pactree.8.txt
rename scripts/libmakepkg/util/{message.sh => message.sh.in} (100%)
rename scripts/libmakepkg/util/{option.sh => option.sh.in} (100%)
rename scripts/{library/parseopts.sh => libmakepkg/util/parseopts.sh.in} (56%)
rename scripts/libmakepkg/util/{util.sh => util.sh.in} (100%)
rename scripts/{makepkg-wrapper.sh.in => wrapper.sh.in} (84%)
delete mode 100644 src/util/pactree.c
hooks/post-receive
--
The official pacman repository
1
0
[pacman-dev] [PATCH v3 1/2] makepkg: Move parseopts from library to libmakepkg
by Alad Wenter 22 Oct '16
by Alad Wenter 22 Oct '16
22 Oct '16
parseopts is used in makepkg and other scripts such as pacman-key as a
getopt replacement.
Instead of including it in those scripts via a macro, move it to
libmakepkg/util/option.sh and have scripts source libmakepkg where
appropriate.
To keep the parseopts test, a new variable was introduced:
PM_LIBMAKEPKG_DIR
Signed-off-by: Alad Wenter <alad(a)archlinux.info>
---
Makefile.am | 3 +-
scripts/Makefile.am | 9 +--
scripts/libmakepkg/util/option.sh | 157 ++++++++++++++++++++++++++++++++++++++
scripts/library/README | 20 -----
scripts/library/parseopts.sh | 137 ---------------------------------
scripts/makepkg.sh.in | 2 -
scripts/pacman-db-upgrade.sh.in | 7 +-
scripts/pacman-key.sh.in | 7 +-
scripts/pkgdelta.sh.in | 9 ++-
scripts/po/POTFILES.in | 2 +-
scripts/po/ar.po | 10 +--
scripts/po/ast.po | 10 +--
scripts/po/az_AZ.po | 10 +--
scripts/po/bg.po | 10 +--
scripts/po/br.po | 10 +--
scripts/po/ca.po | 10 +--
scripts/po/cs.po | 10 +--
scripts/po/da.po | 10 +--
scripts/po/de.po | 10 +--
scripts/po/el.po | 10 +--
scripts/po/en_GB.po | 10 +--
scripts/po/eo.po | 10 +--
scripts/po/es.po | 10 +--
scripts/po/es_419.po | 10 +--
scripts/po/eu.po | 10 +--
scripts/po/fi.po | 10 +--
scripts/po/fr.po | 10 +--
scripts/po/gl.po | 10 +--
scripts/po/hr.po | 10 +--
scripts/po/hu.po | 10 +--
scripts/po/id.po | 10 +--
scripts/po/is.po | 10 +--
scripts/po/it.po | 10 +--
scripts/po/ja.po | 10 +--
scripts/po/ka.po | 10 +--
scripts/po/kk.po | 10 +--
scripts/po/ko.po | 10 +--
scripts/po/lt.po | 10 +--
scripts/po/nb.po | 10 +--
scripts/po/nl.po | 10 +--
scripts/po/pacman-scripts.pot | 10 +--
scripts/po/pl.po | 10 +--
scripts/po/pt.po | 10 +--
scripts/po/pt_BR.po | 10 +--
scripts/po/ro.po | 10 +--
scripts/po/ru.po | 10 +--
scripts/po/sk.po | 10 +--
scripts/po/sl.po | 10 +--
scripts/po/sr.po | 10 +--
scripts/po/sr(a)latin.po | 10 +--
scripts/po/sv.po | 10 +--
scripts/po/tr.po | 10 +--
scripts/po/uk.po | 10 +--
scripts/po/uz.po | 10 +--
scripts/po/zh_CN.po | 10 +--
scripts/po/zh_TW.po | 10 +--
test/scripts/parseopts_test.sh | 2 +-
57 files changed, 413 insertions(+), 402 deletions(-)
delete mode 100644 scripts/library/parseopts.sh
diff --git a/Makefile.am b/Makefile.am
index a676878..f58344a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,7 +39,8 @@ TEST_EXTENSIONS = .py
AM_TESTS_ENVIRONMENT = \
PMTEST_UTIL_DIR=$(top_builddir)/src/util/; export PMTEST_UTIL_DIR; \
PMTEST_SCRIPT_DIR=$(top_builddir)/scripts/; export PMTEST_SCRIPT_DIR; \
- PMTEST_SCRIPTLIB_DIR=$(top_srcdir)/scripts/library/; export PMTEST_SCRIPTLIB_DIR;
+ PMTEST_SCRIPTLIB_DIR=$(top_srcdir)/scripts/library/; export PMTEST_SCRIPTLIB_DIR; \
+ PMTEST_LIBMAKEPKG_DIR=$(top_builddir)/scripts/libmakepkg/; export PMTEST_LIBMAKEPKG_DIR;
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/build-aux/tap-driver.sh
PY_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index e4f9fb1..339b8ba 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -33,7 +33,6 @@ EXTRA_DIST = \
LIBRARY = \
library/output_format.sh \
- library/parseopts.sh \
library/human_to_size.sh \
library/size_to_human.sh \
library/term_colors.sh
@@ -162,7 +161,6 @@ $(LIBMAKEPKG_IN): %: %.in Makefile
makepkg: \
$(srcdir)/makepkg.sh.in \
$(srcdir)/makepkg-wrapper.sh.in \
- $(srcdir)/library/parseopts.sh \
$(LIBMAKEPKG_IN)
makepkg-template: \
@@ -179,8 +177,7 @@ pacman-db-upgrade: \
pacman-key: \
$(srcdir)/pacman-key.sh.in \
- $(srcdir)/library/output_format.sh \
- $(srcdir)/library/parseopts.sh
+ $(srcdir)/library/output_format.sh
pacman-optimize: \
$(srcdir)/pacman-optimize.sh.in \
@@ -188,8 +185,7 @@ pacman-optimize: \
pkgdelta: \
$(srcdir)/pkgdelta.sh.in \
- $(srcdir)/library/output_format.sh \
- $(srcdir)/library/parseopts.sh
+ $(srcdir)/library/output_format.sh
repo-add: \
$(srcdir)/repo-add.sh.in \
@@ -207,7 +203,6 @@ makepkg-wrapper: \
Makefile \
$(srcdir)/makepkg-wrapper.sh.in \
$(srcdir)/makepkg.sh.in \
- $(srcdir)/library/parseopts.sh \
| makepkg
$(AM_V_at)$(MKDIR_P) .lib
$(AM_V_at)mv -f makepkg .lib
diff --git a/scripts/libmakepkg/util/option.sh b/scripts/libmakepkg/util/option.sh
index 54ba474..9d0cd05 100644
--- a/scripts/libmakepkg/util/option.sh
+++ b/scripts/libmakepkg/util/option.sh
@@ -140,3 +140,160 @@ check_buildoption() {
# not found
return 127
}
+
+
+##
+# A getopt_long-like parser which portably supports longopts and
+# shortopts with some GNU extensions. It does not allow for options
+# with optional arguments. For both short and long opts, options
+# requiring an argument should be suffixed with a colon. After the
+# first argument containing the short opts, any number of valid long
+# opts may be be passed. The end of the options delimiter must then be
+# added, followed by the user arguments to the calling program.
+#
+# Recommended Usage:
+# OPT_SHORT='fb:z'
+# OPT_LONG=('foo' 'bar:' 'baz')
+# if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
+# exit 1
+# fi
+# set -- "${OPTRET[@]}"
+# return : 0 - parse success
+# 1 - parse failure (error message supplied)
+##
+parseopts() {
+ local opt= optarg= i= shortopts=$1
+ local -a longopts=() unused_argv=()
+
+ shift
+ while [[ $1 && $1 != '--' ]]; do
+ longopts+=("$1")
+ shift
+ done
+ shift
+
+ longoptmatch() {
+ local o longmatch=()
+ for o in "${longopts[@]}"; do
+ if [[ ${o%:} = "$1" ]]; then
+ longmatch=("$o")
+ break
+ fi
+ [[ ${o%:} = "$1"* ]] && longmatch+=("$o")
+ done
+
+ case ${#longmatch[*]} in
+ 1)
+ # success, override with opt and return arg req (0 == none, 1 == required)
+ opt=${longmatch%:}
+ if [[ $longmatch = *: ]]; then
+ return 1
+ else
+ return 0
+ fi ;;
+ 0)
+ # fail, no match found
+ return 255 ;;
+ *)
+ # fail, ambiguous match
+ printf "%s: $(gettext "option '%s' is ambiguous; possibilities:")" "${0##*/}" "--$1"
+ printf " '%s'" "${longmatch[@]%:}"
+ printf '\n'
+ return 254 ;;
+ esac >&2
+ }
+
+ while (( $# )); do
+ case $1 in
+ --) # explicit end of options
+ shift
+ break
+ ;;
+ -[!-]*) # short option
+ for (( i = 1; i < ${#1}; i++ )); do
+ opt=${1:i:1}
+
+ # option doesn't exist
+ if [[ $shortopts != *$opt* ]]; then
+ printf "%s: $(gettext "invalid option") -- '%s'\n" "${0##*/}" "$opt" >&2
+ OPTRET=(--)
+ return 1
+ fi
+
+ OPTRET+=("-$opt")
+ # option requires optarg
+ if [[ $shortopts = *$opt:* ]]; then
+ # if we're not at the end of the option chunk, the rest is the optarg
+ if (( i < ${#1} - 1 )); then
+ OPTRET+=("${1:i+1}")
+ break
+ # if we're at the end, grab the the next positional, if it exists
+ elif (( i == ${#1} - 1 )) && [[ $2 ]]; then
+ OPTRET+=("$2")
+ shift
+ break
+ # parse failure
+ else
+ printf "%s: $(gettext "option requires an argument") -- '%s'\n" "${0##*/}" "$opt" >&2
+ OPTRET=(--)
+ return 1
+ fi
+ fi
+ done
+ ;;
+ --?*=*|--?*) # long option
+ IFS='=' read -r opt optarg <<< "${1#--}"
+ longoptmatch "$opt"
+ case $? in
+ 0)
+ # parse failure
+ if [[ $optarg ]]; then
+ printf "%s: $(gettext "option '%s' does not allow an argument")\n" "${0##*/}" "--$opt" >&2
+ OPTRET=(--)
+ return 1
+ # --longopt
+ else
+ OPTRET+=("--$opt")
+ fi
+ ;;
+ 1)
+ # --longopt=optarg
+ if [[ $optarg ]]; then
+ OPTRET+=("--$opt" "$optarg")
+ # --longopt optarg
+ elif [[ $2 ]]; then
+ OPTRET+=("--$opt" "$2" )
+ shift
+ # parse failure
+ else
+ printf "%s: $(gettext "option '%s' requires an argument")\n" "${0##*/}" "--$opt" >&2
+ OPTRET=(--)
+ return 1
+ fi
+ ;;
+ 254)
+ # ambiguous option -- error was reported for us by longoptmatch()
+ OPTRET=(--)
+ return 1
+ ;;
+ 255)
+ # parse failure
+ printf "%s: $(gettext "invalid option") '--%s'\n" "${0##*/}" "$opt" >&2
+ OPTRET=(--)
+ return 1
+ ;;
+ esac
+ ;;
+ *) # non-option arg encountered, add it as a parameter
+ unused_argv+=("$1")
+ ;;
+ esac
+ shift
+ done
+
+ # add end-of-opt terminator and any leftover positional parameters
+ OPTRET+=('--' "${unused_argv[@]}" "$@")
+ unset longoptmatch
+
+ return 0
+}
diff --git a/scripts/library/README b/scripts/library/README
index e9615a2..a9d15f1 100644
--- a/scripts/library/README
+++ b/scripts/library/README
@@ -8,26 +8,6 @@ stdout and can be silenced by defining 'QUIET'. The 'warning' and 'error'
functions print to stderr with the appropriate prefix added to the
message.
-parseopts.sh:
-A getopt_long-like parser which portably supports longopts and shortopts
-with some GNU extensions. It does not allow for options with optional
-arguments. For both short and long opts, options requiring an argument
-should be suffixed with a colon. After the first argument containing
-the short opts, any number of valid long opts may be be passed. The end
-of the options delimiter must then be added, followed by the user arguments
-to the calling program.
-
-Recommended Usage:
- OPT_SHORT='fb:z'
- OPT_LONG=('foo' 'bar:' 'baz')
- if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
- exit 1
- fi
- set -- "${OPTRET[@]}"
-Returns:
- 0: parse success
- 1: parse failure (error message supplied)
-
human_to_size.sh:
A function to convert human readable sizes (such as "5.3 GiB") to raw byte
equivalents. base10 and base2 suffixes are supported, case sensitively. If
diff --git a/scripts/library/parseopts.sh b/scripts/library/parseopts.sh
deleted file mode 100644
index cf6aa6c..0000000
--- a/scripts/library/parseopts.sh
+++ /dev/null
@@ -1,137 +0,0 @@
-# getopt-like parser
-parseopts() {
- local opt= optarg= i= shortopts=$1
- local -a longopts=() unused_argv=()
-
- shift
- while [[ $1 && $1 != '--' ]]; do
- longopts+=("$1")
- shift
- done
- shift
-
- longoptmatch() {
- local o longmatch=()
- for o in "${longopts[@]}"; do
- if [[ ${o%:} = "$1" ]]; then
- longmatch=("$o")
- break
- fi
- [[ ${o%:} = "$1"* ]] && longmatch+=("$o")
- done
-
- case ${#longmatch[*]} in
- 1)
- # success, override with opt and return arg req (0 == none, 1 == required)
- opt=${longmatch%:}
- if [[ $longmatch = *: ]]; then
- return 1
- else
- return 0
- fi ;;
- 0)
- # fail, no match found
- return 255 ;;
- *)
- # fail, ambiguous match
- printf "@SCRIPTNAME@: $(gettext "option '%s' is ambiguous; possibilities:")" "--$1"
- printf " '%s'" "${longmatch[@]%:}"
- printf '\n'
- return 254 ;;
- esac >&2
- }
-
- while (( $# )); do
- case $1 in
- --) # explicit end of options
- shift
- break
- ;;
- -[!-]*) # short option
- for (( i = 1; i < ${#1}; i++ )); do
- opt=${1:i:1}
-
- # option doesn't exist
- if [[ $shortopts != *$opt* ]]; then
- printf "@SCRIPTNAME@: $(gettext "invalid option") -- '%s'\n" "$opt" >&2
- OPTRET=(--)
- return 1
- fi
-
- OPTRET+=("-$opt")
- # option requires optarg
- if [[ $shortopts = *$opt:* ]]; then
- # if we're not at the end of the option chunk, the rest is the optarg
- if (( i < ${#1} - 1 )); then
- OPTRET+=("${1:i+1}")
- break
- # if we're at the end, grab the the next positional, if it exists
- elif (( i == ${#1} - 1 )) && [[ $2 ]]; then
- OPTRET+=("$2")
- shift
- break
- # parse failure
- else
- printf "@SCRIPTNAME@: $(gettext "option requires an argument") -- '%s'\n" "$opt" >&2
- OPTRET=(--)
- return 1
- fi
- fi
- done
- ;;
- --?*=*|--?*) # long option
- IFS='=' read -r opt optarg <<< "${1#--}"
- longoptmatch "$opt"
- case $? in
- 0)
- # parse failure
- if [[ $optarg ]]; then
- printf "@SCRIPTNAME@: $(gettext "option '%s' does not allow an argument")\n" "--$opt" >&2
- OPTRET=(--)
- return 1
- # --longopt
- else
- OPTRET+=("--$opt")
- fi
- ;;
- 1)
- # --longopt=optarg
- if [[ $optarg ]]; then
- OPTRET+=("--$opt" "$optarg")
- # --longopt optarg
- elif [[ $2 ]]; then
- OPTRET+=("--$opt" "$2" )
- shift
- # parse failure
- else
- printf "@SCRIPTNAME@: $(gettext "option '%s' requires an argument")\n" "--$opt" >&2
- OPTRET=(--)
- return 1
- fi
- ;;
- 254)
- # ambiguous option -- error was reported for us by longoptmatch()
- OPTRET=(--)
- return 1
- ;;
- 255)
- # parse failure
- printf "@SCRIPTNAME@: $(gettext "invalid option") '--%s'\n" "$opt" >&2
- OPTRET=(--)
- return 1
- ;;
- esac
- ;;
- *) # non-option arg encountered, add it as a parameter
- unused_argv+=("$1")
- ;;
- esac
- shift
- done
-
- # add end-of-opt terminator and any leftover positional parameters
- OPTRET+=('--' "${unused_argv[@]}" "$@")
- unset longoptmatch
-
- return 0
-}
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 7b2ce51..b3cafa8 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1153,8 +1153,6 @@ run_split_packaging() {
pkgname=("${pkgname_backup[@]}")
}
-m4_include(library/parseopts.sh)
-
usage() {
printf "makepkg (pacman) %s\n" "$makepkg_version"
echo
diff --git a/scripts/pacman-db-upgrade.sh.in b/scripts/pacman-db-upgrade.sh.in
index 79e1c59..129715c 100644
--- a/scripts/pacman-db-upgrade.sh.in
+++ b/scripts/pacman-db-upgrade.sh.in
@@ -28,9 +28,14 @@ export TEXTDOMAINDIR='@localedir@'
declare -r myver='@PACKAGE_VERSION@'
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
m4_include(library/output_format.sh)
-m4_include(library/parseopts.sh)
+# Import libmakepkg
+for lib in "$LIBRARY"/*.sh; do
+ source "$lib"
+done
usage() {
printf "pacman-db-upgrade (pacman) %s\n" "${myver}"
diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in
index ffefc68..5994a45 100644
--- a/scripts/pacman-key.sh.in
+++ b/scripts/pacman-key.sh.in
@@ -26,6 +26,8 @@ export TEXTDOMAINDIR='@localedir@'
declare -r myver="@PACKAGE_VERSION@"
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
# Options
ADD=0
DELETE=0
@@ -50,7 +52,10 @@ DEFAULT_KEYSERVER='hkp://pool.sks-keyservers.net'
m4_include(library/output_format.sh)
-m4_include(library/parseopts.sh)
+# Import libmakepkg
+for lib in "$LIBRARY"/*.sh; do
+ source "$lib"
+done
usage() {
printf "pacman-key (pacman) %s\n" ${myver}
diff --git a/scripts/pkgdelta.sh.in b/scripts/pkgdelta.sh.in
index fe63974..ae75f54 100644
--- a/scripts/pkgdelta.sh.in
+++ b/scripts/pkgdelta.sh.in
@@ -28,6 +28,9 @@ export TEXTDOMAINDIR='@localedir@'
declare -r myver='@PACKAGE_VERSION@'
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
+# Options
QUIET=0
USE_COLOR='y'
@@ -41,9 +44,13 @@ max_delta_size=70
# ensure we have a sane umask set
umask 0022
-m4_include(library/parseopts.sh)
m4_include(library/output_format.sh)
+# Import libmakepkg
+for lib in "$LIBRARY"/*.sh; do
+ source "$lib"
+done
+
# print usage instructions
usage() {
printf "pkgdelta (pacman) %s\n" "${myver}"
diff --git a/scripts/po/POTFILES.in b/scripts/po/POTFILES.in
index 53dd545..018ac6b 100644
--- a/scripts/po/POTFILES.in
+++ b/scripts/po/POTFILES.in
@@ -50,6 +50,6 @@ scripts/libmakepkg/tidy/staticlibs.sh.in
scripts/libmakepkg/tidy/strip.sh.in
scripts/libmakepkg/tidy/zipman.sh.in
scripts/libmakepkg/util/message.sh
+scripts/libmakepkg/util/option.sh
scripts/libmakepkg/util/source.sh.in
scripts/library/output_format.sh
-scripts/library/parseopts.sh
diff --git a/scripts/po/ar.po b/scripts/po/ar.po
index 4ba5779..9b3e240 100644
--- a/scripts/po/ar.po
+++ b/scripts/po/ar.po
@@ -1795,22 +1795,22 @@ msgstr "خطأ:"
msgid "The download program %s is not installed."
msgstr "برنامج التحميل %s غير مثبت."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "الخيار '%s' مبهم; الامكانيات:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "خيار خاطئ"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "الخيار يحتاج الى معطى"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "الخيار '%s' لايسمح بمعطى"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "الخيار '%s' يحتاج الى معطى"
diff --git a/scripts/po/ast.po b/scripts/po/ast.po
index 26db3d9..c15c583 100644
--- a/scripts/po/ast.po
+++ b/scripts/po/ast.po
@@ -1804,22 +1804,22 @@ msgstr "FALLU:"
msgid "The download program %s is not installed."
msgstr "El programa de descarga %s nun ta instaláu."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr ""
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "opción non válida"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "la opción rique un argumentu"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "la opción '%s' nun permite un argumentu"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "la opción '%s' rique un argumentu"
diff --git a/scripts/po/az_AZ.po b/scripts/po/az_AZ.po
index bf7dfb6..70cb3e4 100644
--- a/scripts/po/az_AZ.po
+++ b/scripts/po/az_AZ.po
@@ -1790,22 +1790,22 @@ msgstr "SƏHV:"
msgid "The download program %s is not installed."
msgstr "Proqram köçürülmüşdür %s yüklənməmişdir."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr ""
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr ""
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr ""
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr ""
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr ""
diff --git a/scripts/po/bg.po b/scripts/po/bg.po
index 212a387..11882a3 100644
--- a/scripts/po/bg.po
+++ b/scripts/po/bg.po
@@ -1802,22 +1802,22 @@ msgstr "ГРЕШКА:"
msgid "The download program %s is not installed."
msgstr "Програмата за сваляне %s не е инсталирана."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "опцията '%s' е амбициозна; възможности:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "невалидна опция"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "опцията изисква аргумент"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "опцията '%s' непозволява аргумент"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "опцията '%s' изисква аргумент"
diff --git a/scripts/po/br.po b/scripts/po/br.po
index 12a5d65..e613d5a 100644
--- a/scripts/po/br.po
+++ b/scripts/po/br.po
@@ -1885,22 +1885,22 @@ msgstr "FAZI :"
msgid "The download program %s is not installed."
msgstr "N'eo ket staliet ar meziant pellgargañ %s."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "forc'hellek eo an dibarzh '%s'; diskoulmoù :"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "Dibarzh direizh"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "un arguzenn a zo dleet gant an dibarzh"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "N'eo ket aotreet un arguzen gant an dibarzh '%s'"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "Un arguzenn a zo azgoulennet gant an dibarzh '%s'"
diff --git a/scripts/po/ca.po b/scripts/po/ca.po
index de2d938..e6aaf00 100644
--- a/scripts/po/ca.po
+++ b/scripts/po/ca.po
@@ -1966,22 +1966,22 @@ msgstr "ERROR:"
msgid "The download program %s is not installed."
msgstr "El programa de baixades %s no està instal·lat."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "L'opció \"%s\" és ambigua; possibilitats:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "opció no vàlida"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "l'opció requereix un argument"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "L'opció \"%s\" no accepta cap argument"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "l'opció \"%s\" requereix un argument"
diff --git a/scripts/po/cs.po b/scripts/po/cs.po
index 04363f9..4a72dd3 100644
--- a/scripts/po/cs.po
+++ b/scripts/po/cs.po
@@ -1863,22 +1863,22 @@ msgstr "CHYBA:"
msgid "The download program %s is not installed."
msgstr "Program pro stahování %s není nainstalován."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "volba '%s' je nejasná; možnosti: "
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "neplatný přepínač"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "volba vyžaduje nějaký argument"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "volba '%s' nedovoluje žádný argument"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "volba '%s' vyžaduje nějaký argument"
diff --git a/scripts/po/da.po b/scripts/po/da.po
index b9f7671..c1f3142 100644
--- a/scripts/po/da.po
+++ b/scripts/po/da.po
@@ -1880,22 +1880,22 @@ msgstr "FEJL:"
msgid "The download program %s is not installed."
msgstr "Downloadprogrammet %s er ikke installeret."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "valgmuligheden '%s' er tvetydigt; muligheder\""
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "ugyldig valgmulighed"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "valgmuligheden kræver et argument"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "valgmuligheden '%s' må ikke have et argument"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "valgmuligheden '%s' kræver et argument"
diff --git a/scripts/po/de.po b/scripts/po/de.po
index 6889018..555a505 100644
--- a/scripts/po/de.po
+++ b/scripts/po/de.po
@@ -1986,22 +1986,22 @@ msgstr "FEHLER:"
msgid "The download program %s is not installed."
msgstr "Das Download-Programm %s ist nicht installiert."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "Option '%s' ist zweideutig; Möglichkeiten:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "Ungültige Option"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "Option erfordert ein Argument"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "Option '%s' erlaubt kein Argument"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "Option '%s' erfordert ein Argument"
diff --git a/scripts/po/el.po b/scripts/po/el.po
index ca39f3e..dfdc992 100644
--- a/scripts/po/el.po
+++ b/scripts/po/el.po
@@ -1897,22 +1897,22 @@ msgstr "ΣΦΑΛΜΑ:"
msgid "The download program %s is not installed."
msgstr "Μη εγκατεστημένο πρόγραμμα λήψεων %s."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "ασαφής επιλογή '%s'· δυνατότητες:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "άκυρη επιλογή"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "η επιλογή απαιτεί όρισμα"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "η επιλογή '%s' δεν επιτρέπει όρισμα"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "η επιλογή '%s' απαιτεί όρισμα"
diff --git a/scripts/po/en_GB.po b/scripts/po/en_GB.po
index 6937a8f..acaea5e 100644
--- a/scripts/po/en_GB.po
+++ b/scripts/po/en_GB.po
@@ -1861,22 +1861,22 @@ msgstr "ERROR:"
msgid "The download program %s is not installed."
msgstr "The download program %s is not installed."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "option '%s' is ambiguous; possibilities:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "invalid option"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "option requires an argument"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "option '%s' does not allow an argument"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "option '%s' requires an argument"
diff --git a/scripts/po/eo.po b/scripts/po/eo.po
index 6aea7db..db85289 100644
--- a/scripts/po/eo.po
+++ b/scripts/po/eo.po
@@ -1886,22 +1886,22 @@ msgstr "ERARO:"
msgid "The download program %s is not installed."
msgstr "La elŝuta programo %s ne estas instalita."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "opcio '%s' estas malklara; eblecoj:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "nevalida opcio"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "opcio bezonas argumenton"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "opcio '%s' ne permesas argumenton"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "opcio '%s' bezonas argumenton"
diff --git a/scripts/po/es.po b/scripts/po/es.po
index f0a1706..7d4c34e 100644
--- a/scripts/po/es.po
+++ b/scripts/po/es.po
@@ -1976,22 +1976,22 @@ msgstr "ERROR:"
msgid "The download program %s is not installed."
msgstr "El programa de descarga %s no está instalado."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "la opción «%s» es ambigua; posibilidades:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "la opción no es válida"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "la opción requiere un argumento"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "la opción «%s» no permite argumentos"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "la opción «%s» requiere un argumento"
diff --git a/scripts/po/es_419.po b/scripts/po/es_419.po
index f75a591..d590e57 100644
--- a/scripts/po/es_419.po
+++ b/scripts/po/es_419.po
@@ -1948,22 +1948,22 @@ msgstr "ERROR:"
msgid "The download program %s is not installed."
msgstr "El programa de descarga %s no está instalado."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "la opción «%s» es ambigua; posibilidades:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "la opción no es válida"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "la opción requiere un argumento"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "la opción «%s» no permite argumentos"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "la opción «%s» requiere un argumento"
diff --git a/scripts/po/eu.po b/scripts/po/eu.po
index efcd5fe..4f08d61 100644
--- a/scripts/po/eu.po
+++ b/scripts/po/eu.po
@@ -1803,22 +1803,22 @@ msgstr "ERROREA:"
msgid "The download program %s is not installed."
msgstr "%s deskarga programa ez dago instalatuta."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "'%s' aukera anbiguoa da; izan liteke:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "aukera baliogabea"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "aukerak argumentu bat behar du"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "'%s' aukerak ez du argumenturik onartzen"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "'%s' aukerak argumentu bat behar du"
diff --git a/scripts/po/fi.po b/scripts/po/fi.po
index 06f9fbc..ecdfc50 100644
--- a/scripts/po/fi.po
+++ b/scripts/po/fi.po
@@ -1850,22 +1850,22 @@ msgstr "VIRHE:"
msgid "The download program %s is not installed."
msgstr "Latausohjelmaa %s ei ole asennettu."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "valitsin '%s' on moniselitteinen; vaihtoehdot:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "virheellinen valitsin"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "valitsin tarvitsee parametrin"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "valitsin '%s' ei salli parametria"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "valitsin '%s' tarvitsee parametrin"
diff --git a/scripts/po/fr.po b/scripts/po/fr.po
index 6e570b5..6c3b866 100644
--- a/scripts/po/fr.po
+++ b/scripts/po/fr.po
@@ -1999,22 +1999,22 @@ msgstr "ERREUR :"
msgid "The download program %s is not installed."
msgstr "Le programme de téléchargement %s n’est pas installé."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "l’option « %s » est ambigüe ; possibilités :"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "option invalide"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "l’option requiert un argument"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "l’option « %s » n’accepte pas d’argument"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "l’option « %s » requiert un argument"
diff --git a/scripts/po/gl.po b/scripts/po/gl.po
index 3378bf9..06a5c44 100644
--- a/scripts/po/gl.po
+++ b/scripts/po/gl.po
@@ -1995,22 +1995,22 @@ msgstr "Erro:"
msgid "The download program %s is not installed."
msgstr "O programa de descarga, «%s», non está instalado."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "A opción «%s» é ambigua. As posibilidades son:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "Opción non válida."
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "A opción precisa dun argumento."
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "A opción «%s» non permite un argumento."
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "A opción «%s» precisa dun argumento."
diff --git a/scripts/po/hr.po b/scripts/po/hr.po
index 955d38c..bb835ac 100644
--- a/scripts/po/hr.po
+++ b/scripts/po/hr.po
@@ -1791,22 +1791,22 @@ msgstr "GREŠKA:"
msgid "The download program %s is not installed."
msgstr "Program preuzimanja %s nije instaliran."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr ""
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr ""
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr ""
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr ""
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr ""
diff --git a/scripts/po/hu.po b/scripts/po/hu.po
index bb81e8e..d843d8e 100644
--- a/scripts/po/hu.po
+++ b/scripts/po/hu.po
@@ -1905,22 +1905,22 @@ msgstr "HIBA:"
msgid "The download program %s is not installed."
msgstr "A(z) %s letöltőprogram nincs telepítve."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "a(z) '%s' opció kétértelmű; lehetőségek:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "érvénytelen opció"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "az opció egy argumentumot igényel"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "a(z) '%s' opció nem enged meg argumentumot"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "a(z) '%s' opció igényel egy argumentumot"
diff --git a/scripts/po/id.po b/scripts/po/id.po
index b785b95..1ada086 100644
--- a/scripts/po/id.po
+++ b/scripts/po/id.po
@@ -1881,22 +1881,22 @@ msgstr "GALAT:"
msgid "The download program %s is not installed."
msgstr "Program unduhan %s tidak dipasang."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "opsi '%s' ambigu; kemungkinan:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "opsi tidak valid"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "opsi membutuhkan argumen"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "opsi '%s' tidak membutuhkan argumen"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "opsi '%s' membutuhkan argumen"
diff --git a/scripts/po/is.po b/scripts/po/is.po
index 814ee36..08f6bcd 100644
--- a/scripts/po/is.po
+++ b/scripts/po/is.po
@@ -1790,22 +1790,22 @@ msgstr "VILLA:"
msgid "The download program %s is not installed."
msgstr ""
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr ""
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr ""
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr ""
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr ""
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr ""
diff --git a/scripts/po/it.po b/scripts/po/it.po
index 137259d..1bedc53 100644
--- a/scripts/po/it.po
+++ b/scripts/po/it.po
@@ -1923,22 +1923,22 @@ msgstr "ERRORE:"
msgid "The download program %s is not installed."
msgstr "Il programma %s per il download non è installato."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "l'opzione '%s' è ambigua; possibilità:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "opzione non valida"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "l'opzione richiede un argomento"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "l'opzione '%s' non consente l'uso di un argomento"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "l'opzione '%s' richiede un argomento"
diff --git a/scripts/po/ja.po b/scripts/po/ja.po
index 8618a9d..1be9827 100644
--- a/scripts/po/ja.po
+++ b/scripts/po/ja.po
@@ -1877,22 +1877,22 @@ msgstr "エラー:"
msgid "The download program %s is not installed."
msgstr "ダウンロードプログラム %s がインストールされていません。"
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "オプション '%s' はあいまいです; 候補:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "無効なオプション"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "オプションに引数が必要です"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "オプション '%s' に引数はつけられません"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "オプション '%s' には引数が必要です"
diff --git a/scripts/po/ka.po b/scripts/po/ka.po
index 74c44d8..6139d70 100644
--- a/scripts/po/ka.po
+++ b/scripts/po/ka.po
@@ -1790,22 +1790,22 @@ msgstr "შეცდომა:"
msgid "The download program %s is not installed."
msgstr "ჩამოტვირთვის პროგრამა %s დაინსტალირებული არაა."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr ""
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr ""
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr ""
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr ""
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr ""
diff --git a/scripts/po/kk.po b/scripts/po/kk.po
index 7b1a86b2..2cc957d 100644
--- a/scripts/po/kk.po
+++ b/scripts/po/kk.po
@@ -1810,22 +1810,22 @@ msgstr "ҚАТЕ:"
msgid "The download program %s is not installed."
msgstr "%s жүктеу бағдарламасы орнатылмаған."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr ""
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr ""
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr ""
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr ""
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr ""
diff --git a/scripts/po/ko.po b/scripts/po/ko.po
index 5e80880..813f7a1 100644
--- a/scripts/po/ko.po
+++ b/scripts/po/ko.po
@@ -1862,22 +1862,22 @@ msgstr "오류:"
msgid "The download program %s is not installed."
msgstr "다운로드한 프로그램 %s를 설치하지 않았습니다."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "'%s' 옵션은 애매모호합니다. 가능한 옵션은 다음과 같습니다:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "잘못된 옵션입니다"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "옵션은 인자 하나를 필요로 합니다"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "'%s' 옵션은 인자를 허용하지 않습니다"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "'%s' 옵션은 인자 하나가 필요합니다"
diff --git a/scripts/po/lt.po b/scripts/po/lt.po
index 1cf62e1..26acac9 100644
--- a/scripts/po/lt.po
+++ b/scripts/po/lt.po
@@ -1912,22 +1912,22 @@ msgstr "KLAIDA:"
msgid "The download program %s is not installed."
msgstr "Parsiuntimo programa %s neįdiegta."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "parinktis „%s“ yra dviprasmė, galimybės:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "netinkama parinktis"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "parinkčiai reikia argumento"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "parinktis „%s“ neleidžia argumentų"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "parinkčiai „%s“ reikia argumento"
diff --git a/scripts/po/nb.po b/scripts/po/nb.po
index 5061d8f..c5fd1da 100644
--- a/scripts/po/nb.po
+++ b/scripts/po/nb.po
@@ -1880,22 +1880,22 @@ msgstr "FEIL:"
msgid "The download program %s is not installed."
msgstr "Nedlastingsprogrammet %s er ikke installert."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "valg '%s' er tvetydig; mulige valg:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "ugyldig valg"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "valg krever en parameter"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "valg '%s' kan ikke ta en parameter"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "valg '%s' krever en parameter"
diff --git a/scripts/po/nl.po b/scripts/po/nl.po
index 175afbe..8d658e0 100644
--- a/scripts/po/nl.po
+++ b/scripts/po/nl.po
@@ -1904,22 +1904,22 @@ msgstr "FOUT:"
msgid "The download program %s is not installed."
msgstr "Het download programma %s is niet geïnstalleerd."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "optie '%s' is dubbelzinnig; mogelijkheden:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "ongeldige optie"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "optie vereist een argument"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "optie '%s' staat geen argumenten toe"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "optie '%s' vereist een argument"
diff --git a/scripts/po/pacman-scripts.pot b/scripts/po/pacman-scripts.pot
index ff8918a..5b9573d 100644
--- a/scripts/po/pacman-scripts.pot
+++ b/scripts/po/pacman-scripts.pot
@@ -1787,22 +1787,22 @@ msgstr ""
msgid "The download program %s is not installed."
msgstr ""
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr ""
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr ""
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr ""
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr ""
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr ""
diff --git a/scripts/po/pl.po b/scripts/po/pl.po
index 10100e6..8802b00 100644
--- a/scripts/po/pl.po
+++ b/scripts/po/pl.po
@@ -1907,22 +1907,22 @@ msgstr "BŁĄD:"
msgid "The download program %s is not installed."
msgstr "Program do pobierania %s nie jest zainstalowany."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "opcja '%s' nie jest jednoznaczna; dostępne możliwości:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "nieprawidłowa opcja"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "opcja wymaga argumentu"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "opcja '%s' nie jest dozwolonym argumentem"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "opcja '%s' wymaga argumentu"
diff --git a/scripts/po/pt.po b/scripts/po/pt.po
index f7f813f..c5be363 100644
--- a/scripts/po/pt.po
+++ b/scripts/po/pt.po
@@ -1952,22 +1952,22 @@ msgstr "ERRO:"
msgid "The download program %s is not installed."
msgstr "O programa de descargas %s não está instalado."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "opção '%s' é ambígua; possibilidades:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "opção inválida"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "opção requer um argumento"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "opção '%s' não permite argumentos"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "opção '%s' requer um argumento"
diff --git a/scripts/po/pt_BR.po b/scripts/po/pt_BR.po
index 9fc357a..3cc0785 100644
--- a/scripts/po/pt_BR.po
+++ b/scripts/po/pt_BR.po
@@ -1953,22 +1953,22 @@ msgstr "ERRO:"
msgid "The download program %s is not installed."
msgstr "O programa de download %s não está instalado."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "opção \"%s\" é ambígua; possibilidades:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "opção inválida"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "opção requer um argumento"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "opção \"%s\" não permite um argumento"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "opção \"%s\" requer um argumento"
diff --git a/scripts/po/ro.po b/scripts/po/ro.po
index e347c07..15dbadd 100644
--- a/scripts/po/ro.po
+++ b/scripts/po/ro.po
@@ -1934,22 +1934,22 @@ msgstr "EROARE:"
msgid "The download program %s is not installed."
msgstr "Programul de descărcare %s nu este instalat."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "opțiunea '%s' este ambiguă; posibilități:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "opțiune nevalidă"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "opțiunea necesită un argument"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "opțiunea '%s' nu permite un argument"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "opțiunea '%s' necesită un argument"
diff --git a/scripts/po/ru.po b/scripts/po/ru.po
index 17d25f9..d7e1e57 100644
--- a/scripts/po/ru.po
+++ b/scripts/po/ru.po
@@ -1874,22 +1874,22 @@ msgstr "ОШИБКА:"
msgid "The download program %s is not installed."
msgstr "Программа для загрузки %s не установлена."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "неоднозначный параметр '%s'; варианты:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "неверный параметр"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "параметру требуется аргумент"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "параметр '%s' не имеет аргументов"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "параметр '%s' требует аргумента"
diff --git a/scripts/po/sk.po b/scripts/po/sk.po
index 46ac6fb..91bfdce 100644
--- a/scripts/po/sk.po
+++ b/scripts/po/sk.po
@@ -1865,22 +1865,22 @@ msgstr "CHYBA:"
msgid "The download program %s is not installed."
msgstr "Program pre sťahovanie %s nie je nainštalovaný."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "voľba '%s' nie je jednoznačná; možnosti:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "neplatná voľba"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "voľba vyžaduje argument"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "voľba '%s' neumožňuje argument"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "voľba '%s' vyžaduje argument"
diff --git a/scripts/po/sl.po b/scripts/po/sl.po
index 4de6a61..b779bb8 100644
--- a/scripts/po/sl.po
+++ b/scripts/po/sl.po
@@ -1863,22 +1863,22 @@ msgstr "NAPAKA:"
msgid "The download program %s is not installed."
msgstr "Program za prenos %s ni nameščen."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "stikalo '%s' je dvoumna; možnosti:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "neveljavna stikalo"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "stikalo zahteva argument"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "Stikalo '%s' ne dovoljuje uporabe trditve"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "stikalo '%s' zahteva trditev"
diff --git a/scripts/po/sr.po b/scripts/po/sr.po
index 6f180c8..6638ef7 100644
--- a/scripts/po/sr.po
+++ b/scripts/po/sr.po
@@ -1880,22 +1880,22 @@ msgstr "ГРЕШКА:"
msgid "The download program %s is not installed."
msgstr "Програм за преузимање %s није инсталиран."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "опција „%s“ је двосмислена; могућности:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "неисправна опција"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "опција захтева аргумент"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "опција „%s“ не дозвољава аргументе"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "опција „%s“ захтева аргумент"
diff --git a/scripts/po/sr(a)latin.po b/scripts/po/sr(a)latin.po
index 6e70462..d8517cf 100644
--- a/scripts/po/sr(a)latin.po
+++ b/scripts/po/sr(a)latin.po
@@ -1882,22 +1882,22 @@ msgstr "GREŠKA:"
msgid "The download program %s is not installed."
msgstr "Program za preuzimanje %s nije instaliran."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "opcija „%s“ je dvosmislena; mogućnosti:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "neispravna opcija"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "opcija zahteva argument"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "opcija „%s“ ne dozvoljava argumente"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "opcija „%s“ zahteva argument"
diff --git a/scripts/po/sv.po b/scripts/po/sv.po
index cbef3bc..545917a 100644
--- a/scripts/po/sv.po
+++ b/scripts/po/sv.po
@@ -1854,22 +1854,22 @@ msgstr "FEL: "
msgid "The download program %s is not installed."
msgstr "Nerladdningsprogramet %s är inte installerat."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "alternativ '%s' är mångtydigt; möjliga:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "ogiltigt alternativ"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "alternativ behöver ett argument"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "alternativ '%s' tillåter inte ett argument"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "alternativ '%s' behöver ett argument"
diff --git a/scripts/po/tr.po b/scripts/po/tr.po
index 98b2869..2acd50d 100644
--- a/scripts/po/tr.po
+++ b/scripts/po/tr.po
@@ -1879,22 +1879,22 @@ msgstr "HATA:"
msgid "The download program %s is not installed."
msgstr "İndirme programı %s kurulu değil."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "'%s' seçeneği belirsiz; muhtemel seçenekler:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "geçersiz seçenek"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "seçenek parametre gerektirir"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "'%s' seçeneği parametre kabul etmemektedir"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "'%s' seçeneği için parametre gereklidir"
diff --git a/scripts/po/uk.po b/scripts/po/uk.po
index c8b4287..d63ccb7 100644
--- a/scripts/po/uk.po
+++ b/scripts/po/uk.po
@@ -1891,22 +1891,22 @@ msgstr "ПОМИЛКА:"
msgid "The download program %s is not installed."
msgstr "Програму завантаження %s не встановлено."
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "параметр '%s' неоднозначний; можливі варіанти:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "нерозпізнаний параметр"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "параметр вимагає аргументу"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "параметр '%s' не дозволяє аргументу"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "параметр '%s' вимагає аргументу"
diff --git a/scripts/po/uz.po b/scripts/po/uz.po
index 8a2d53c..ff9279a 100644
--- a/scripts/po/uz.po
+++ b/scripts/po/uz.po
@@ -1802,22 +1802,22 @@ msgstr "XATO:"
msgid "The download program %s is not installed."
msgstr ""
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr ""
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr ""
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr ""
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr ""
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr ""
diff --git a/scripts/po/zh_CN.po b/scripts/po/zh_CN.po
index c593fdd..0f81f02 100644
--- a/scripts/po/zh_CN.po
+++ b/scripts/po/zh_CN.po
@@ -1827,22 +1827,22 @@ msgstr "错误:"
msgid "The download program %s is not installed."
msgstr "下载程序 %s 没有安装。"
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "'%s' 选项有歧义;可能为:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "无效选项"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "选项要求带一个参数"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "选项 '%s' 不能带参数"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "选项 '%s' 要求带一个参数"
diff --git a/scripts/po/zh_TW.po b/scripts/po/zh_TW.po
index 1553ccf..98ab227 100644
--- a/scripts/po/zh_TW.po
+++ b/scripts/po/zh_TW.po
@@ -1826,22 +1826,22 @@ msgstr "錯誤:"
msgid "The download program %s is not installed."
msgstr "尚未安裝已下載的程式 %s。"
-#: scripts/library/parseopts.sh:37
+#: scripts/libmakepkg/util/option.sh:199
msgid "option '%s' is ambiguous; possibilities:"
msgstr "選項「%s」模糊;可能是:"
-#: scripts/library/parseopts.sh:56 scripts/library/parseopts.sh:119
+#: scripts/libmakepkg/util/option.sh:218 scripts/libmakepkg/util/option.sh:281
msgid "invalid option"
msgstr "無效選項"
-#: scripts/library/parseopts.sh:75
+#: scripts/libmakepkg/util/option.sh:237
msgid "option requires an argument"
msgstr "選項需要引數"
-#: scripts/library/parseopts.sh:89
+#: scripts/libmakepkg/util/option.sh:251
msgid "option '%s' does not allow an argument"
msgstr "選項「%s」不允許引數"
-#: scripts/library/parseopts.sh:107
+#: scripts/libmakepkg/util/option.sh:269
msgid "option '%s' requires an argument"
msgstr "選項「%s」需要引數"
diff --git a/test/scripts/parseopts_test.sh b/test/scripts/parseopts_test.sh
index a8738a4..af1f8d7 100755
--- a/test/scripts/parseopts_test.sh
+++ b/test/scripts/parseopts_test.sh
@@ -3,7 +3,7 @@
source "$(dirname "$0")"/../tap.sh || exit 1
# source the library function
-lib=${1:-${PMTEST_SCRIPTLIB_DIR}parseopts.sh}
+lib=${1:-${PMTEST_LIBMAKEPKG_DIR}util/option.sh}
if [[ -z $lib || ! -f $lib ]]; then
tap_bail "parseopts library ($lib) could not be located"
exit 1
--
2.10.0
4
9
22 Oct '16
Good day, all
TL;DR:
Is there a parameter for makepkg that ignores runtime dependencies but
does not ignore build-time dependencies?
Long version:
I prefer using a custom cower/makepkg script (as a user) followed by
pacman (as root) over using yaourt. I regularly come across the
situation where a package has several runtime dependencies that I'm also
about to build and install. The result used to be the following before I
realised I could use --nodeps:
build a (error, rundeps b >= old and d >= old)
build b (error, rundeps d >= old
build d (error, rundeps c >= old)
build c
install c
build d
install d
build c
install c
build a
install a
<success>
So of course I now bypass all of this by using makepkg --nodeps:
build a
build b
build c
build d
install a b c d
<success>
Sometimes however that will result in errors due to build time
dependencies being ignored.
Instead, I would like to specify "--noruntimedeps" - or some similar
flag, so I see potential build time dependencies immediately but also
ignore run time dependencies that are going to be installed anyway.
One obscure use I see for this is that it could make it simpler to build
pkg files that are intended to be installed on a separate system.
--
__________
Brendan Hide
http://swiftspirit.co.za/
http://www.webafrica.co.za/?AFF1E97
7
8
[pacman-dev] Another try at building cleanly with clang's -Wassign-enum
by ivy.foster@gmail.com 17 Oct '16
by ivy.foster@gmail.com 17 Oct '16
17 Oct '16
Thanks to feedback from Andrew, I have revised the patch[1] I recently
sent in that tries to fix a class of warning offered by clang,
-Wassign-enum. To make review a bit easier, I've split it into
separate patches, based on the cause of the warning in question.
Patch 1: Functions returning _alpm_errno_t return 0 when there is no
error. This patch just names that 0 ALPM_ERR_OK, making the convention
explicit.
Patch 2: This is the biggest one. Many variables are actually integer
bitfields, but are declared to be a member of the enumerated type used
to create or check the bitfield. Thanks to Andrew pointing me in the
right direction, I caught some that clang didn't (because they were
technically enums, but conceptually still being used as bitfields).
Quite a bit of git grepping and following the chain of function calls
leads me to believe that I got 'em all.
Patch 3: alpm_pkg_get_origin and alpm_pkg_get_reason are declared to
return enums, but may return -1 on error. They've been declared int,
instead.
Patch 4: After all that, this patch adds -Wassign-enum to
configure.ac, for anyone building with clang and with warnings
enabled.
As always, I welcome critiques.
Enjoy,
Ivy
[1]: https://lists.archlinux.org/pipermail/pacman-dev/2016-September/021383.html
3
8
[pacman-dev] [PATCH v2] Parametrise the different ways in which the payload is reset
by mar77i 17 Oct '16
by mar77i 17 Oct '16
17 Oct '16
In FS#43434, Downloads which fail and are restarted on a different server
will resume and may display a negative download speed. The payload's progress
in libalpm was not properly reset which ultimately caused terminal noise
because the line width calculation assumes positive download speeds.
This patch fixes the incomplete reset of the payload by mimicing what
be_sync.c:alpm_db_update() does over in sync.c:download_single_file().
dload.c:_alpm_dload_payload_reset() bundles and extends over the current
behavior by updating initial_size and prevprogress for this case.
This makes pacman reset the progress properly in the next invocation of the
callback and display positive download speeds.
Fixes FS#43434.
Signed-off-by: Martin Kühne <mysatyre(a)gmail.com>
---
lib/libalpm/be_sync.c | 4 ++--
lib/libalpm/dload.c | 15 +++++++++++----
lib/libalpm/dload.h | 2 +-
lib/libalpm/sync.c | 4 +---
4 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index a836277..2425359 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -244,7 +244,7 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
payload.unlink_on_fail = 1;
ret = _alpm_download(&payload, syncpath, NULL, &final_db_url);
- _alpm_dload_payload_reset(&payload);
+ _alpm_dload_payload_reset(&payload, 0);
updated = (updated || ret == 0);
if(ret != -1 && updated && (level & ALPM_SIG_DATABASE)) {
@@ -300,7 +300,7 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
sig_ret = _alpm_download(&payload, syncpath, NULL, NULL);
/* errors_ok suppresses error messages, but not the return code */
sig_ret = payload.errors_ok ? 0 : sig_ret;
- _alpm_dload_payload_reset(&payload);
+ _alpm_dload_payload_reset(&payload, 0);
}
if(ret != -1 && sig_ret != -1) {
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index dc57c92..55ff41f 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -697,7 +697,7 @@ char SYMEXPORT *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url)
/* download the file */
ret = _alpm_download(&payload, cachedir, &final_file, &final_pkg_url);
- _alpm_dload_payload_reset(&payload);
+ _alpm_dload_payload_reset(&payload, 0);
if(ret == -1) {
_alpm_log(handle, ALPM_LOG_WARNING, _("failed to download %s\n"), url);
free(final_file);
@@ -738,7 +738,7 @@ char SYMEXPORT *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url)
FREE(sig_final_file);
}
free(sig_filepath);
- _alpm_dload_payload_reset(&payload);
+ _alpm_dload_payload_reset(&payload, 0);
}
/* we should be able to find the file the second time around */
@@ -750,15 +750,22 @@ char SYMEXPORT *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url)
return filepath;
}
-void _alpm_dload_payload_reset(struct dload_payload *payload)
+void _alpm_dload_payload_reset(struct dload_payload *payload, int allow_resume)
{
ASSERT(payload, return);
+ FREE(payload->fileurl);
+ if(allow_resume) {
+ payload->initial_size += payload->prevprogress;
+ payload->prevprogress = 0;
+ payload->unlink_on_fail = 0;
+ return;
+ }
+
FREE(payload->remote_name);
FREE(payload->tempfile_name);
FREE(payload->destfile_name);
FREE(payload->content_disp_name);
- FREE(payload->fileurl);
memset(payload, '\0', sizeof(*payload));
}
diff --git a/lib/libalpm/dload.h b/lib/libalpm/dload.h
index 427c486..c9c94b8 100644
--- a/lib/libalpm/dload.h
+++ b/lib/libalpm/dload.h
@@ -46,7 +46,7 @@ struct dload_payload {
#endif
};
-void _alpm_dload_payload_reset(struct dload_payload *payload);
+void _alpm_dload_payload_reset(struct dload_payload *payload, int allow_resume);
int _alpm_download(struct dload_payload *payload, const char *localpath,
char **final_file, const char **final_url);
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 00b68d0..81900df 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -946,9 +946,7 @@ static int download_single_file(alpm_handle_t *handle, struct dload_payload *pay
EVENT(handle, &event);
return 0;
}
-
- FREE(payload->fileurl);
- payload->unlink_on_fail = 0;
+ _alpm_dload_payload_reset(payload, 1);
}
event.type = ALPM_EVENT_PKGDOWNLOAD_FAILED;
--
2.10.0
2
1
[pacman-dev] [PATCH] doc/pacman.8.txt: improve description of -Qt
by ivy.foster@gmail.com 17 Oct '16
by ivy.foster@gmail.com 17 Oct '16
17 Oct '16
From: Ivy Foster <ivy.foster(a)gmail.com>
Though correct, the wording of the description of Query's
-t/--unrequired option was confusing. Closes FS#48144.
Signed-off-by: Ivy Foster <ivy.foster(a)gmail.com>
---
doc/pacman.8.txt | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/doc/pacman.8.txt b/doc/pacman.8.txt
index 2bafa41..0fa727e 100644
--- a/doc/pacman.8.txt
+++ b/doc/pacman.8.txt
@@ -338,10 +338,10 @@ Query Options (apply to '-Q')[[QO]]
with descriptions matching ALL of those terms are returned.
*-t, \--unrequired*::
- Restrict or filter output to packages not required or optionally required by
- any currently installed package. Specify this option twice to only filter
- packages that are direct dependencies (i.e. do not filter optional
- dependencies).
+ Restrict or filter output to print only packages neither required nor
+ optionally required by any currently installed package. Specify this
+ option twice to include packages which are optionally, but not directly,
+ required by another package.
*-u, \--upgrades*::
Restrict or filter output to packages that are out-of-date on the local
--
2.10.0
2
1
[pacman-dev] [PATCH] makepkg: print filenames and line numbers of references to $srcdir & $pkgdir in built package
by ivy.foster@gmail.com 17 Oct '16
by ivy.foster@gmail.com 17 Oct '16
17 Oct '16
From: Ivy Foster <ivy.foster(a)gmail.com>
grep -n output is used to match format of compiler warnings.
Since rewriting build_references() anyway, tweaked quoting.
Implements FS#31558.
Signed-off-by: Ivy Foster <ivy.foster(a)gmail.com>
---
scripts/libmakepkg/lint_package/build_references.sh.in | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/scripts/libmakepkg/lint_package/build_references.sh.in b/scripts/libmakepkg/lint_package/build_references.sh.in
index 67c14e6..32554b2 100644
--- a/scripts/libmakepkg/lint_package/build_references.sh.in
+++ b/scripts/libmakepkg/lint_package/build_references.sh.in
@@ -29,10 +29,17 @@ source "$LIBRARY/util/message.sh"
lint_package_functions+=('warn_build_references')
warn_build_references() {
- if find "${pkgdir}" -type f -print0 | xargs -0 grep -q -I "${srcdir}" ; then
- warning "$(gettext "Package contains reference to %s")" "\$srcdir"
+ local srcdir_refs pkgdir_refs
+
+ mapfile -t srcdir_refs < <(find "$pkgdir" -type f -print0 | xargs -0 grep -n "$srcdir")
+ mapfile -t pkgdir_refs < <(find "$pkgdir" -type f -print0 | xargs -0 grep -n "$pkgdirbase")
+
+ if [[ ${#srcdir_refs} -gt 0 ]]; then
+ warning "$(gettext 'Package contains reference to %s')" '$srcdir'
+ printf '%s\n' "${srcdir_refs[@]}" >&2
fi
- if find "${pkgdir}" -type f -print0 | xargs -0 grep -q -I "${pkgdirbase}" ; then
- warning "$(gettext "Package contains reference to %s")" "\$pkgdir"
+ if [[ ${#pkgdir_refs} -gt 0 ]]; then
+ warning "$(gettext 'Package contains reference to %s')" '$pkgdir'
+ printf '%s\n' "${pkgdir_refs[@]}" >&2
fi
}
--
2.10.0
4
7
[pacman-dev] [PATCH v2] Allow replacing libcrypto with libnettle in pacman
by Allan McRae 12 Oct '16
by Allan McRae 12 Oct '16
12 Oct '16
From: Florian Weigelt <weigelt.florian(a)gmx.net>
Add a --with-nettle configure option that directs pacman to use the libnettle
hashing functions. Only one of the --with-libssl and --with-nettle configure
options can be specified.
[Allan: rewrote configure check]
Signed-off-by: Allan McRae <allan(a)archlinux.org>
---
v2:
- add correct author
- rewrite configure check. Now select crypto library with:
--with-crypto={openssl|nettle}
select crypto implementation [default=openssl]
configure.ac | 32 ++++++++++++++++++++------------
lib/libalpm/Makefile.am | 6 ++++--
lib/libalpm/libalpm.pc.in | 2 +-
lib/libalpm/util.c | 41 +++++++++++++++++++++++++++++++++++++++--
4 files changed, 64 insertions(+), 17 deletions(-)
diff --git a/configure.ac b/configure.ac
index f6b87e5..1991be6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -120,10 +120,11 @@ AC_ARG_WITH(ldconfig,
[set the full path to ldconfig]),
[LDCONFIG=$withval], [LDCONFIG=/sbin/ldconfig])
-# Help line for using OpenSSL
-AC_ARG_WITH(openssl,
- AS_HELP_STRING([--with-openssl], [use OpenSSL crypto implementations instead of internal routines]),
- [], [with_openssl=check])
+# Help line for selecting a crypto library
+AC_ARG_WITH(crypto,
+ AS_HELP_STRING([--with-crypto={openssl|nettle}],
+ [select crypto implementation @<:@default=openssl@:>@]),
+ [with_crypto=$withval], [with_crypto=openssl])
# Help line for using gpgme
AC_ARG_WITH(gpgme,
@@ -220,19 +221,25 @@ PKG_CHECK_MODULES(LIBARCHIVE, [libarchive >= 2.8.0], ,
# Check for OpenSSL
have_openssl=no
-if test "x$with_openssl" != "xno"; then
+have_nettle=no
+if test "x$with_crypto" == "xnettle"; then
+ PKG_CHECK_MODULES(NETTLE, [nettle],
+ [AC_DEFINE(HAVE_LIBNETTLE, 1, [Define whether to use nettle]) have_nettle=yes], have_nettle=no)
+ if test "x$have_nettle" = xno -a "x$with_crypto" = xnettle; then
+ AC_MSG_ERROR([*** nettle support requested but libraries not found])
+ fi
+else if test "x$with_crypto" == "xopenssl"; then
PKG_CHECK_MODULES(LIBSSL, [libcrypto],
[AC_DEFINE(HAVE_LIBSSL, 1, [Define if libcrypto is available]) have_openssl=yes], have_openssl=no)
- if test "x$have_openssl" = xno -a "x$with_openssl" = xyes; then
+ if test "x$have_openssl" = xno; then
AC_MSG_ERROR([*** openssl support requested but libraries not found])
fi
+else
+ AC_MSG_ERROR([*** unknown crypto support library requested - $with_crypto])
fi
-AM_CONDITIONAL(HAVE_LIBSSL, [test "$have_openssl" = "yes"])
-
-# Ensure one library for generating checksums is present
-if test "$have_openssl" != "yes"; then
- AC_MSG_ERROR([*** no library for checksum generation found])
fi
+AM_CONDITIONAL(HAVE_LIBSSL, [test "$have_openssl" = "yes"])
+AM_CONDITIONAL(HAVE_LIBNETTLE, [test "$have_nettle" = "yes"])
# Check for libcurl
have_libcurl=no
@@ -542,7 +549,7 @@ ${PACKAGE_NAME}:
compiler : ${CC}
preprocessor flags : ${CPPFLAGS}
compiler flags : ${WARNING_CFLAGS} ${CFLAGS}
- library flags : ${LIBS} ${LIBSSL_LIBS} ${LIBARCHIVE_LIBS} ${LIBCURL_LIBS} ${GPGME_LIBS}
+ library flags : ${LIBS} ${LIBSSL_LIBS} ${NETTLE_LIBS} ${LIBARCHIVE_LIBS} ${LIBCURL_LIBS} ${GPGME_LIBS}
linker flags : ${LDFLAGS}
Architecture : ${CARCH}
@@ -569,6 +576,7 @@ ${PACKAGE_NAME}:
Use libcurl : ${have_libcurl}
Use GPGME : ${have_gpgme}
Use OpenSSL : ${have_openssl}
+ Use nettle : ${have_nettle}
Run make in doc/ dir : ${wantdoc} ${asciidoc}
Doxygen support : ${usedoxygen}
debug support : ${debug}
diff --git a/lib/libalpm/Makefile.am b/lib/libalpm/Makefile.am
index 945a612..f4f20e6 100644
--- a/lib/libalpm/Makefile.am
+++ b/lib/libalpm/Makefile.am
@@ -65,13 +65,15 @@ libalpm_la_CFLAGS = \
$(GPGME_CFLAGS) \
$(LIBARCHIVE_CFLAGS) \
$(LIBCURL_CFLAGS) \
- $(LIBSSL_CFLAGS)
+ $(LIBSSL_CFLAGS) \
+ $(NETTLE_CFLAGS)
libalpm_la_LIBADD = \
$(LTLIBINTL) \
$(GPGME_LIBS) \
$(LIBARCHIVE_LIBS) \
$(LIBCURL_LIBS) \
- $(LIBSSL_LIBS)
+ $(LIBSSL_LIBS) \
+ $(NETTLE_LIBS)
# vim:set noet:
diff --git a/lib/libalpm/libalpm.pc.in b/lib/libalpm/libalpm.pc.in
index e4be174..e1d74ef 100644
--- a/lib/libalpm/libalpm.pc.in
+++ b/lib/libalpm/libalpm.pc.in
@@ -9,4 +9,4 @@ URL: http://www.archlinux.org/pacman/
Version: @LIB_VERSION@
Cflags: -I${includedir} @LFS_CFLAGS@
Libs: -L${libdir} -lalpm
-Libs.private: @LIBS@ @LIBARCHIVE_LIBS@ @LIBSSL_LIBS@ @LIBCURL_LIBS@ @GPGME_LIBS@
+Libs.private: @LIBS@ @LIBARCHIVE_LIBS@ @LIBSSL_LIBS@ @NETTLE_LIBS@ @LIBCURL_LIBS@ @GPGME_LIBS@
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 7ef4bf3..d0b9097 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -42,6 +42,11 @@
#include <openssl/sha.h>
#endif
+#ifdef HAVE_LIBNETTLE
+#include <nettle/md5.h>
+#include <nettle/sha2.h>
+#endif
+
/* libalpm */
#include "util.h"
#include "log.h"
@@ -856,7 +861,7 @@ const char *_alpm_filecache_setup(alpm_handle_t *handle)
return cachedir;
}
-#ifdef HAVE_LIBSSL
+#if defined HAVE_LIBSSL || defined HAVE_LIBNETTLE
/** Compute the MD5 message digest of a file.
* @param path file path of file to compute MD5 digest of
* @param output string to hold computed MD5 digest
@@ -864,7 +869,11 @@ const char *_alpm_filecache_setup(alpm_handle_t *handle)
*/
static int md5_file(const char *path, unsigned char output[16])
{
+#if HAVE_LIBSSL
MD5_CTX ctx;
+#else /* HAVE_LIBNETTLE */
+ struct md5_ctx ctx;
+#endif
unsigned char *buf;
ssize_t n;
int fd;
@@ -877,13 +886,21 @@ static int md5_file(const char *path, unsigned char output[16])
return 1;
}
+#if HAVE_LIBSSL
MD5_Init(&ctx);
+#else /* HAVE_LIBNETTLE */
+ md5_init(&ctx);
+#endif
while((n = read(fd, buf, ALPM_BUFFER_SIZE)) > 0 || errno == EINTR) {
if(n < 0) {
continue;
}
+#if HAVE_LIBSSL
MD5_Update(&ctx, buf, n);
+#else /* HAVE_LIBNETTLE */
+ md5_update(&ctx, n, buf);
+#endif
}
close(fd);
@@ -893,7 +910,11 @@ static int md5_file(const char *path, unsigned char output[16])
return 2;
}
+#if HAVE_LIBSSL
MD5_Final(output, &ctx);
+#else /* HAVE_LIBNETTLE */
+ md5_digest(&ctx, MD5_DIGEST_SIZE, output);
+#endif
return 0;
}
@@ -904,7 +925,11 @@ static int md5_file(const char *path, unsigned char output[16])
*/
static int sha256_file(const char *path, unsigned char output[32])
{
+#if HAVE_LIBSSL
SHA256_CTX ctx;
+#else /* HAVE_LIBNETTLE */
+ struct sha256_ctx ctx;
+#endif
unsigned char *buf;
ssize_t n;
int fd;
@@ -917,13 +942,21 @@ static int sha256_file(const char *path, unsigned char output[32])
return 1;
}
+#if HAVE_LIBSSL
SHA256_Init(&ctx);
+#else /* HAVE_LIBNETTLE */
+ sha256_init(&ctx);
+#endif
while((n = read(fd, buf, ALPM_BUFFER_SIZE)) > 0 || errno == EINTR) {
if(n < 0) {
continue;
}
+#if HAVE_LIBSSL
SHA256_Update(&ctx, buf, n);
+#else /* HAVE_LIBNETTLE */
+ sha256_update(&ctx, n, buf);
+#endif
}
close(fd);
@@ -933,10 +966,14 @@ static int sha256_file(const char *path, unsigned char output[32])
return 2;
}
+#if HAVE_LIBSSL
SHA256_Final(output, &ctx);
+#else /* HAVE_LIBNETTLE */
+ sha256_digest(&ctx, SHA256_DIGEST_SIZE, output);
+#endif
return 0;
}
-#endif
+#endif /* HAVE_LIBSSL || HAVE_LIBNETTLE */
/** Create a string representing bytes in hexadecimal.
* @param bytes the bytes to represent in hexadecimal
--
2.10.0
1
0
[pacman-dev] [PATCH v5] makepkg: Move parseopts from library to libmakepkg
by Alad Wenter 12 Oct '16
by Alad Wenter 12 Oct '16
12 Oct '16
parseopts is used in makepkg and other scripts such as pacman-key as a
getopt replacement.
Instead of including it in those scripts via a macro, move it to
libmakepkg/util/parseopts.sh and have scripts source this file where
appropriate.
To keep the parseopts test, a new variable was introduced:
PM_LIBMAKEPKG_DIR
Signed-off-by: Alad Wenter <alad(a)archlinux.info>
---
v5: update README
Makefile.am | 3 +-
scripts/Makefile.am | 9 +---
scripts/{library => libmakepkg/util}/parseopts.sh | 50 +++++++++++++++++++----
scripts/library/README | 20 ---------
scripts/makepkg.sh.in | 2 -
scripts/pacman-db-upgrade.sh.in | 5 ++-
scripts/pacman-key.sh.in | 7 +++-
scripts/pkgdelta.sh.in | 7 +++-
scripts/po/POTFILES.in | 2 +-
test/scripts/parseopts_test.sh | 2 +-
10 files changed, 64 insertions(+), 43 deletions(-)
rename scripts/{library => libmakepkg/util}/parseopts.sh (56%)
diff --git a/Makefile.am b/Makefile.am
index a676878..f58344a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,7 +39,8 @@ TEST_EXTENSIONS = .py
AM_TESTS_ENVIRONMENT = \
PMTEST_UTIL_DIR=$(top_builddir)/src/util/; export PMTEST_UTIL_DIR; \
PMTEST_SCRIPT_DIR=$(top_builddir)/scripts/; export PMTEST_SCRIPT_DIR; \
- PMTEST_SCRIPTLIB_DIR=$(top_srcdir)/scripts/library/; export PMTEST_SCRIPTLIB_DIR;
+ PMTEST_SCRIPTLIB_DIR=$(top_srcdir)/scripts/library/; export PMTEST_SCRIPTLIB_DIR; \
+ PMTEST_LIBMAKEPKG_DIR=$(top_builddir)/scripts/libmakepkg/; export PMTEST_LIBMAKEPKG_DIR;
LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/build-aux/tap-driver.sh
PY_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index e4f9fb1..339b8ba 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -33,7 +33,6 @@ EXTRA_DIST = \
LIBRARY = \
library/output_format.sh \
- library/parseopts.sh \
library/human_to_size.sh \
library/size_to_human.sh \
library/term_colors.sh
@@ -162,7 +161,6 @@ $(LIBMAKEPKG_IN): %: %.in Makefile
makepkg: \
$(srcdir)/makepkg.sh.in \
$(srcdir)/makepkg-wrapper.sh.in \
- $(srcdir)/library/parseopts.sh \
$(LIBMAKEPKG_IN)
makepkg-template: \
@@ -179,8 +177,7 @@ pacman-db-upgrade: \
pacman-key: \
$(srcdir)/pacman-key.sh.in \
- $(srcdir)/library/output_format.sh \
- $(srcdir)/library/parseopts.sh
+ $(srcdir)/library/output_format.sh
pacman-optimize: \
$(srcdir)/pacman-optimize.sh.in \
@@ -188,8 +185,7 @@ pacman-optimize: \
pkgdelta: \
$(srcdir)/pkgdelta.sh.in \
- $(srcdir)/library/output_format.sh \
- $(srcdir)/library/parseopts.sh
+ $(srcdir)/library/output_format.sh
repo-add: \
$(srcdir)/repo-add.sh.in \
@@ -207,7 +203,6 @@ makepkg-wrapper: \
Makefile \
$(srcdir)/makepkg-wrapper.sh.in \
$(srcdir)/makepkg.sh.in \
- $(srcdir)/library/parseopts.sh \
| makepkg
$(AM_V_at)$(MKDIR_P) .lib
$(AM_V_at)mv -f makepkg .lib
diff --git a/scripts/library/parseopts.sh b/scripts/libmakepkg/util/parseopts.sh
similarity index 56%
rename from scripts/library/parseopts.sh
rename to scripts/libmakepkg/util/parseopts.sh
index cf6aa6c..802275e 100644
--- a/scripts/library/parseopts.sh
+++ b/scripts/libmakepkg/util/parseopts.sh
@@ -1,4 +1,40 @@
-# getopt-like parser
+#!/bin/bash
+#
+# parseopts.sh - getopt_long-like parser
+#
+# Copyright (c) 2012-2016 Pacman Development Team <pacman-dev(a)archlinux.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# A getopt_long-like parser which portably supports longopts and
+# shortopts with some GNU extensions. It does not allow for options
+# with optional arguments. For both short and long opts, options
+# requiring an argument should be suffixed with a colon. After the
+# first argument containing the short opts, any number of valid long
+# opts may be be passed. The end of the options delimiter must then be
+# added, followed by the user arguments to the calling program.
+#
+# Recommended Usage:
+# OPT_SHORT='fb:z'
+# OPT_LONG=('foo' 'bar:' 'baz')
+# if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
+# exit 1
+# fi
+# set -- "${OPTRET[@]}"
+# Returns:
+# 0: parse success
+# 1: parse failure (error message supplied)
parseopts() {
local opt= optarg= i= shortopts=$1
local -a longopts=() unused_argv=()
@@ -34,7 +70,7 @@ parseopts() {
return 255 ;;
*)
# fail, ambiguous match
- printf "@SCRIPTNAME@: $(gettext "option '%s' is ambiguous; possibilities:")" "--$1"
+ printf "${0##*/}: $(gettext "option '%s' is ambiguous; possibilities:")" "--$1"
printf " '%s'" "${longmatch[@]%:}"
printf '\n'
return 254 ;;
@@ -53,7 +89,7 @@ parseopts() {
# option doesn't exist
if [[ $shortopts != *$opt* ]]; then
- printf "@SCRIPTNAME@: $(gettext "invalid option") -- '%s'\n" "$opt" >&2
+ printf "${0##*/}: $(gettext "invalid option") -- '%s'\n" "$opt" >&2
OPTRET=(--)
return 1
fi
@@ -72,7 +108,7 @@ parseopts() {
break
# parse failure
else
- printf "@SCRIPTNAME@: $(gettext "option requires an argument") -- '%s'\n" "$opt" >&2
+ printf "${0##*/}: $(gettext "option requires an argument") -- '%s'\n" "$opt" >&2
OPTRET=(--)
return 1
fi
@@ -86,7 +122,7 @@ parseopts() {
0)
# parse failure
if [[ $optarg ]]; then
- printf "@SCRIPTNAME@: $(gettext "option '%s' does not allow an argument")\n" "--$opt" >&2
+ printf "${0##*/}: $(gettext "option '%s' does not allow an argument")\n" "--$opt" >&2
OPTRET=(--)
return 1
# --longopt
@@ -104,7 +140,7 @@ parseopts() {
shift
# parse failure
else
- printf "@SCRIPTNAME@: $(gettext "option '%s' requires an argument")\n" "--$opt" >&2
+ printf "${0##*/}: $(gettext "option '%s' requires an argument")\n" "--$opt" >&2
OPTRET=(--)
return 1
fi
@@ -116,7 +152,7 @@ parseopts() {
;;
255)
# parse failure
- printf "@SCRIPTNAME@: $(gettext "invalid option") '--%s'\n" "$opt" >&2
+ printf "${0##*/}: $(gettext "invalid option") '--%s'\n" "$opt" >&2
OPTRET=(--)
return 1
;;
diff --git a/scripts/library/README b/scripts/library/README
index e9615a2..a9d15f1 100644
--- a/scripts/library/README
+++ b/scripts/library/README
@@ -8,26 +8,6 @@ stdout and can be silenced by defining 'QUIET'. The 'warning' and 'error'
functions print to stderr with the appropriate prefix added to the
message.
-parseopts.sh:
-A getopt_long-like parser which portably supports longopts and shortopts
-with some GNU extensions. It does not allow for options with optional
-arguments. For both short and long opts, options requiring an argument
-should be suffixed with a colon. After the first argument containing
-the short opts, any number of valid long opts may be be passed. The end
-of the options delimiter must then be added, followed by the user arguments
-to the calling program.
-
-Recommended Usage:
- OPT_SHORT='fb:z'
- OPT_LONG=('foo' 'bar:' 'baz')
- if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
- exit 1
- fi
- set -- "${OPTRET[@]}"
-Returns:
- 0: parse success
- 1: parse failure (error message supplied)
-
human_to_size.sh:
A function to convert human readable sizes (such as "5.3 GiB") to raw byte
equivalents. base10 and base2 suffixes are supported, case sensitively. If
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 7b2ce51..b3cafa8 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1153,8 +1153,6 @@ run_split_packaging() {
pkgname=("${pkgname_backup[@]}")
}
-m4_include(library/parseopts.sh)
-
usage() {
printf "makepkg (pacman) %s\n" "$makepkg_version"
echo
diff --git a/scripts/pacman-db-upgrade.sh.in b/scripts/pacman-db-upgrade.sh.in
index 79e1c59..62f4285 100644
--- a/scripts/pacman-db-upgrade.sh.in
+++ b/scripts/pacman-db-upgrade.sh.in
@@ -28,7 +28,10 @@ export TEXTDOMAINDIR='@localedir@'
declare -r myver='@PACKAGE_VERSION@'
-m4_include(library/output_format.sh)
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
+# Import parseopts.sh
+source "$LIBRARY"/util/parseopts.sh
m4_include(library/parseopts.sh)
diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in
index ffefc68..81bea0b 100644
--- a/scripts/pacman-key.sh.in
+++ b/scripts/pacman-key.sh.in
@@ -26,6 +26,11 @@ export TEXTDOMAINDIR='@localedir@'
declare -r myver="@PACKAGE_VERSION@"
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
+# Import parseopts.sh
+source "$LIBRARY"/util/parseopts.sh
+
# Options
ADD=0
DELETE=0
@@ -50,8 +55,6 @@ DEFAULT_KEYSERVER='hkp://pool.sks-keyservers.net'
m4_include(library/output_format.sh)
-m4_include(library/parseopts.sh)
-
usage() {
printf "pacman-key (pacman) %s\n" ${myver}
echo
diff --git a/scripts/pkgdelta.sh.in b/scripts/pkgdelta.sh.in
index fe63974..9f87185 100644
--- a/scripts/pkgdelta.sh.in
+++ b/scripts/pkgdelta.sh.in
@@ -28,6 +28,12 @@ export TEXTDOMAINDIR='@localedir@'
declare -r myver='@PACKAGE_VERSION@'
+LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+
+# Import parseopts.sh
+source "$LIBRARY"/util/parseopts.sh
+
+# Options
QUIET=0
USE_COLOR='y'
@@ -41,7 +47,6 @@ max_delta_size=70
# ensure we have a sane umask set
umask 0022
-m4_include(library/parseopts.sh)
m4_include(library/output_format.sh)
# print usage instructions
diff --git a/scripts/po/POTFILES.in b/scripts/po/POTFILES.in
index 53dd545..81e3acd 100644
--- a/scripts/po/POTFILES.in
+++ b/scripts/po/POTFILES.in
@@ -50,6 +50,6 @@ scripts/libmakepkg/tidy/staticlibs.sh.in
scripts/libmakepkg/tidy/strip.sh.in
scripts/libmakepkg/tidy/zipman.sh.in
scripts/libmakepkg/util/message.sh
+scripts/libmakepkg/util/parseopts.sh
scripts/libmakepkg/util/source.sh.in
scripts/library/output_format.sh
-scripts/library/parseopts.sh
diff --git a/test/scripts/parseopts_test.sh b/test/scripts/parseopts_test.sh
index a8738a4..a582198 100755
--- a/test/scripts/parseopts_test.sh
+++ b/test/scripts/parseopts_test.sh
@@ -3,7 +3,7 @@
source "$(dirname "$0")"/../tap.sh || exit 1
# source the library function
-lib=${1:-${PMTEST_SCRIPTLIB_DIR}parseopts.sh}
+lib=${1:-${PMTEST_LIBMAKEPKG_DIR}util/parseopts.sh}
if [[ -z $lib || ! -f $lib ]]; then
tap_bail "parseopts library ($lib) could not be located"
exit 1
--
2.10.0
2
2