Pacman-dev
Threads by month
- ----- 2026 -----
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 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
- 7335 discussions
[pacman-dev] [RFC] Add Server-specific options, currently only PinnedPubKey
by Travis Burtrum 02 Nov '16
by Travis Burtrum 02 Nov '16
02 Nov '16
Hi all,
Here is a rough go at a patch for server-specific options. It works,
but what still needs done is:
1. Changing alpm_db_remove_server, does it still take a char* url?
or the entire alpm_server_t struct that alpm_db_add_server does?
2. Deciding what to do with alpm_cb_fetch's signature, should a new
struct be added to make adding new server options easier? Should
alpm_server_t be sent in instead? (this gets messy in some places).
3. Documentation updates.
The end result looks like:
Server = https://example.org/ PinnedPubKey=sha256//eEHQC9au2QRAP1FnvcYEsmvXT7511EXQ2gw8ppBfseM=
Is this a sound approach? Any other comments appreciated.
Thanks,
Travis
>From ebf448cd4da77bdea833dc75e60de5c992f21eaf Mon Sep 17 00:00:00 2001
From: Travis Burtrum <travis.archlinux(a)burtrum.org>
Date: Tue, 1 Nov 2016 23:02:43 -0400
Subject: [PATCH] [RFC] Add Server-specific options, currently only
PinnedPubKey supported
---
lib/libalpm/Makefile.am | 1 +
lib/libalpm/alpm.c | 1 +
lib/libalpm/alpm.h | 18 ++++++++--
lib/libalpm/be_sync.c | 7 +++-
lib/libalpm/db.c | 16 ++++++---
lib/libalpm/dload.c | 8 ++++-
lib/libalpm/dload.h | 1 +
lib/libalpm/hook.c | 10 +++---
lib/libalpm/server.c | 91 +++++++++++++++++++++++++++++++++++++++++++++++++
lib/libalpm/server.h | 36 +++++++++++++++++++
lib/libalpm/sync.c | 4 ++-
src/pacman/conf.c | 68 ++++++++++++++++++++++++++++--------
12 files changed, 234 insertions(+), 27 deletions(-)
create mode 100644 lib/libalpm/server.c
create mode 100644 lib/libalpm/server.h
diff --git a/lib/libalpm/Makefile.am b/lib/libalpm/Makefile.am
index f4f20e6..197459c 100644
--- a/lib/libalpm/Makefile.am
+++ b/lib/libalpm/Makefile.am
@@ -48,6 +48,7 @@ libalpm_la_SOURCES = \
libarchive-compat.h \
log.h log.c \
package.h package.c \
+ server.h server.c \
pkghash.h pkghash.c \
rawstr.c \
remove.h remove.c \
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 5225e4f..82df39f 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -29,6 +29,7 @@
#include "alpm.h"
#include "alpm_list.h"
#include "handle.h"
+#include "server.h"
#include "log.h"
#include "util.h"
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 2d2491d..53b48e5 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -48,6 +48,7 @@ typedef struct __alpm_handle_t alpm_handle_t;
typedef struct __alpm_db_t alpm_db_t;
typedef struct __alpm_pkg_t alpm_pkg_t;
typedef struct __alpm_trans_t alpm_trans_t;
+typedef struct __alpm_server_t alpm_server_t;
/** @addtogroup alpm_api_errors Error Codes
* @{
@@ -750,11 +751,12 @@ typedef void (*alpm_cb_totaldl)(off_t total);
* @param url the URL of the file to be downloaded
* @param localpath the directory to which the file should be downloaded
* @param force whether to force an update, even if the file is the same
+ * @param pinnedpubkey a pinned public key string
* @return 0 on success, 1 if the file exists and is identical, -1 on
* error.
*/
typedef int (*alpm_cb_fetch)(const char *url, const char *localpath,
- int force);
+ int force, const char *pinnedpubkey);
/** Fetch a remote pkg.
* @param handle the context handle
@@ -998,7 +1000,7 @@ int alpm_db_get_valid(alpm_db_t *db);
*/
alpm_list_t *alpm_db_get_servers(const alpm_db_t *db);
int alpm_db_set_servers(alpm_db_t *db, alpm_list_t *servers);
-int alpm_db_add_server(alpm_db_t *db, const char *url);
+int alpm_db_add_server(alpm_db_t *db, alpm_server_t *url);
int alpm_db_remove_server(alpm_db_t *db, const char *url);
/** @} */
@@ -1061,6 +1063,18 @@ int alpm_db_get_usage(alpm_db_t *db, int *usage);
/** @} */
+alpm_server_t *alpm_server_new(void);
+int alpm_server_free(alpm_server_t *server);
+
+const char *alpm_server_get_url(const alpm_server_t *server);
+const char *alpm_server_get_pinnedpubkey(const alpm_server_t *server);
+int alpm_server_set_url(alpm_server_t *server, const char *url);
+int alpm_server_set_pinnedpubkey(alpm_server_t *server, const char *pinnedpubkey);
+
+char **alpm_wordsplit(char *str);
+int alpm_wordsplit_free(char **ws);
+
+
/** @addtogroup alpm_api_packages Package Functions
* Functions to manipulate libalpm packages
* @{
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index 7774975..79a35d2 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -219,7 +219,8 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
dbext = db->handle->dbext;
for(i = db->servers; i; i = i->next) {
- const char *server = i->data, *final_db_url = NULL;
+ alpm_server_t *server_t = i->data;
+ const char *server = alpm_server_get_url(server_t), *final_db_url = NULL;
struct dload_payload payload;
size_t len;
int sig_ret = 0;
@@ -242,6 +243,8 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
payload.handle = handle;
payload.force = force;
payload.unlink_on_fail = 1;
+
+ payload.pinnedpubkey = alpm_server_get_pinnedpubkey(server_t);
ret = _alpm_download(&payload, syncpath, NULL, &final_db_url);
_alpm_dload_payload_reset(&payload);
@@ -297,6 +300,8 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
/* set hard upper limit of 16KiB */
payload.max_size = 16 * 1024;
+ payload.pinnedpubkey = alpm_server_get_pinnedpubkey(server_t);
+
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;
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 5d78ee5..7c8dd4b 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -150,7 +150,8 @@ alpm_list_t SYMEXPORT *alpm_db_get_servers(const alpm_db_t *db)
int SYMEXPORT alpm_db_set_servers(alpm_db_t *db, alpm_list_t *servers)
{
ASSERT(db != NULL, return -1);
- FREELIST(db->servers);
+ alpm_list_free_inner(db->servers, (alpm_list_fn_free) alpm_server_free);
+ alpm_list_free(db->servers);
db->servers = servers;
return 0;
}
@@ -173,9 +174,10 @@ static char *sanitize_url(const char *url)
* @param url url of the server
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int SYMEXPORT alpm_db_add_server(alpm_db_t *db, const char *url)
+int SYMEXPORT alpm_db_add_server(alpm_db_t *db, alpm_server_t *server)
{
char *newurl;
+ const char *url = alpm_server_get_url(server);
/* Sanity checks */
ASSERT(db != NULL, return -1);
@@ -186,7 +188,12 @@ int SYMEXPORT alpm_db_add_server(alpm_db_t *db, const char *url)
if(!newurl) {
return -1;
}
- db->servers = alpm_list_add(db->servers, newurl);
+
+ alpm_server_t *copy = alpm_server_new();
+ alpm_server_set_url(copy, newurl);
+ alpm_server_set_pinnedpubkey(copy, alpm_server_get_pinnedpubkey(server));
+
+ db->servers = alpm_list_add(db->servers, copy);
_alpm_log(db->handle, ALPM_LOG_DEBUG, "adding new server URL to database '%s': %s\n",
db->treename, newurl);
@@ -348,7 +355,8 @@ void _alpm_db_free(alpm_db_t *db)
/* cleanup pkgcache */
_alpm_db_free_pkgcache(db);
/* cleanup server list */
- FREELIST(db->servers);
+ alpm_list_free_inner(db->servers, (alpm_list_fn_free) alpm_server_free);
+ alpm_list_free(db->servers);
FREE(db->_path);
FREE(db->treename);
FREE(db);
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 9d80358..6d5b371 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -327,6 +327,12 @@ static void curl_set_handle_opts(struct dload_payload *payload,
curl_easy_setopt(curl, CURLOPT_USERAGENT, useragent);
}
+ if(payload->pinnedpubkey != NULL) {
+ _alpm_log(handle, ALPM_LOG_DEBUG,
+ "using curl pinnedpubkey: %s\n", payload->pinnedpubkey);
+ curl_easy_setopt(curl, CURLOPT_PINNEDPUBLICKEY, payload->pinnedpubkey);
+ }
+
if(!payload->allow_resume && !payload->force && payload->destfile_name &&
stat(payload->destfile_name, &st) == 0) {
/* start from scratch, but only download if our local is out of date. */
@@ -646,7 +652,7 @@ int _alpm_download(struct dload_payload *payload, const char *localpath,
RET_ERR(handle, ALPM_ERR_EXTERNAL_DOWNLOAD, -1);
#endif
} else {
- int ret = handle->fetchcb(payload->fileurl, localpath, payload->force);
+ int ret = handle->fetchcb(payload->fileurl, localpath, payload->force, payload->pinnedpubkey);
if(ret == -1 && !payload->errors_ok) {
RET_ERR(handle, ALPM_ERR_EXTERNAL_DOWNLOAD, -1);
}
diff --git a/lib/libalpm/dload.h b/lib/libalpm/dload.h
index 427c486..9b8453a 100644
--- a/lib/libalpm/dload.h
+++ b/lib/libalpm/dload.h
@@ -41,6 +41,7 @@ struct dload_payload {
int errors_ok;
int unlink_on_fail;
int trust_remote_name;
+ const char *pinnedpubkey;
#ifdef HAVE_LIBCURL
CURLcode curlerr; /* last error produced by curl */
#endif
diff --git a/lib/libalpm/hook.c b/lib/libalpm/hook.c
index ccde225..9e84d78 100644
--- a/lib/libalpm/hook.c
+++ b/lib/libalpm/hook.c
@@ -71,7 +71,7 @@ static void _alpm_trigger_free(struct _alpm_trigger_t *trigger)
}
}
-static void _alpm_wordsplit_free(char **ws)
+int SYMEXPORT alpm_wordsplit_free(char **ws)
{
if(ws) {
char **c;
@@ -79,7 +79,9 @@ static void _alpm_wordsplit_free(char **ws)
free(*c);
}
free(ws);
+ return 0;
}
+ return -1;
}
static void _alpm_hook_free(struct _alpm_hook_t *hook)
@@ -87,7 +89,7 @@ static void _alpm_hook_free(struct _alpm_hook_t *hook)
if(hook) {
free(hook->name);
free(hook->desc);
- _alpm_wordsplit_free(hook->cmd);
+ alpm_wordsplit_free(hook->cmd);
alpm_list_free_inner(hook->triggers, (alpm_list_fn_free) _alpm_trigger_free);
alpm_list_free(hook->triggers);
alpm_list_free(hook->matches);
@@ -158,7 +160,7 @@ static int _alpm_hook_validate(alpm_handle_t *handle,
return ret;
}
-static char **_alpm_wordsplit(char *str)
+char SYMEXPORT **alpm_wordsplit(char *str)
{
char *c = str, *end;
char **out = NULL, **outsave;
@@ -330,7 +332,7 @@ static int _alpm_hook_parse_cb(const char *file, int line,
} else if(strcmp(key, "NeedsTargets") == 0) {
hook->needs_targets = 1;
} else if(strcmp(key, "Exec") == 0) {
- if((hook->cmd = _alpm_wordsplit(value)) == NULL) {
+ if((hook->cmd = alpm_wordsplit(value)) == NULL) {
if(errno == EINVAL) {
error(_("hook %s line %d: invalid value %s\n"), file, line, value);
} else {
diff --git a/lib/libalpm/server.c b/lib/libalpm/server.c
new file mode 100644
index 0000000..29aa365
--- /dev/null
+++ b/lib/libalpm/server.c
@@ -0,0 +1,91 @@
+/*
+ * server.c
+ *
+ * Copyright (c) 2006-2016 Pacman Development Team <pacman-dev(a)archlinux.org>
+ * Copyright (c) 2002-2006 by Judd Vinet <jvinet(a)zeroflux.org>
+ * Copyright (c) 2005 by Aurelien Foret <orelien(a)chez.com>
+ * Copyright (c) 2005, 2006 by Christian Hamar <krics(a)linuxforum.hu>
+ * Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos(a)frugalware.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/>.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+/* libalpm */
+#include "server.h"
+#include "alpm_list.h"
+#include "log.h"
+#include "util.h"
+#include "db.h"
+#include "delta.h"
+#include "handle.h"
+#include "deps.h"
+
+/** \addtogroup alpm_packages Server Functions
+ * @brief Functions to manipulate libalpm servers
+ * @{
+ */
+
+alpm_server_t SYMEXPORT *alpm_server_new(void)
+{
+ alpm_server_t *server;
+
+ CALLOC(server, 1, sizeof(alpm_server_t), return NULL);
+
+ return server;
+}
+
+/** Free a package. */
+int SYMEXPORT alpm_server_free(alpm_server_t *server)
+{
+ ASSERT(server != NULL, return -1);
+ FREE(server->url);
+ FREE(server->pinnedpubkey);
+ return 0;
+}
+
+const char SYMEXPORT *alpm_server_get_url(const alpm_server_t *server)
+{
+ ASSERT(server != NULL, return NULL);
+ return server->url;
+}
+
+const char SYMEXPORT *alpm_server_get_pinnedpubkey(const alpm_server_t *server)
+{
+ ASSERT(server != NULL, return NULL);
+ return server->pinnedpubkey;
+}
+
+int SYMEXPORT alpm_server_set_url(alpm_server_t *server, const char *url)
+{
+ ASSERT(server != NULL, return -1);
+ ASSERT(url != NULL, return 0);
+ FREE(server->url);
+ server->url = strdup(url);
+ return 0;
+}
+
+int SYMEXPORT alpm_server_set_pinnedpubkey(alpm_server_t *server, const char *pinnedpubkey)
+{
+ ASSERT(server != NULL, return -1);
+ ASSERT(pinnedpubkey != NULL, return 0);
+ FREE(server->pinnedpubkey);
+ server->pinnedpubkey = strdup(pinnedpubkey);
+ return 0;
+}
+
+/* vim: set noet: */
diff --git a/lib/libalpm/server.h b/lib/libalpm/server.h
new file mode 100644
index 0000000..b88f9ee
--- /dev/null
+++ b/lib/libalpm/server.h
@@ -0,0 +1,36 @@
+/*
+ * server.h
+ *
+ * Copyright (c) 2006-2016 Pacman Development Team <pacman-dev(a)archlinux.org>
+ * Copyright (c) 2002-2006 by Judd Vinet <jvinet(a)zeroflux.org>
+ * Copyright (c) 2005 by Aurelien Foret <orelien(a)chez.com>
+ * Copyright (c) 2006 by David Kimpe <dnaku(a)frugalware.org>
+ * Copyright (c) 2005, 2006 by Christian Hamar <krics(a)linuxforum.hu>
+ * Copyright (c) 2005, 2006 by Miklos Vajna <vmiklos(a)frugalware.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/>.
+ */
+#ifndef ALPM_SERVER_H
+#define ALPM_SERVER_H
+
+#include "alpm.h"
+
+struct __alpm_server_t {
+ char *url;
+ char *pinnedpubkey;
+};
+
+#endif /* ALPM_SERVER_H */
+
+/* vim: set noet: */
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 837639d..c54f951 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -933,7 +933,9 @@ static int download_single_file(alpm_handle_t *handle, struct dload_payload *pay
EVENT(handle, &event);
for(server = payload->servers; server; server = server->next) {
- const char *server_url = server->data;
+ const alpm_server_t *server_t = server->data;
+ payload->pinnedpubkey = alpm_server_get_pinnedpubkey(server_t);
+ const char *server_url = alpm_server_get_url(server_t);
size_t len;
/* print server + filename into a buffer */
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index d8d64fb..4905310 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -164,7 +164,8 @@ void config_repo_free(config_repo_t *repo)
return;
}
free(repo->name);
- FREELIST(repo->servers);
+ alpm_list_free_inner(repo->servers, (alpm_list_fn_free) alpm_server_free);
+ alpm_list_free(repo->servers);
free(repo);
}
@@ -204,7 +205,7 @@ static char *get_tempfile(const char *path, const char *filename)
/** External fetch callback */
static int download_with_xfercommand(const char *url, const char *localpath,
- int force)
+ int force, const char *pinnedpubkey)
{
int ret = 0, retval;
int usepart = 0;
@@ -232,6 +233,16 @@ static int download_with_xfercommand(const char *url, const char *localpath,
}
tempcmd = strdup(config->xfercommand);
+ /* replace all occurrences of %p with pinnedpubkey */
+ if(strstr(tempcmd, "%p")) {
+ if(pinnedpubkey == NULL) {
+ parsedcmd = strreplace(tempcmd, "%p", "");
+ } else {
+ parsedcmd = strreplace(tempcmd, "%p", pinnedpubkey);
+ }
+ free(tempcmd);
+ tempcmd = parsedcmd;
+ }
/* replace all occurrences of %o with fn.part */
if(strstr(tempcmd, "%o")) {
usepart = 1;
@@ -613,16 +624,17 @@ static int _parse_options(const char *key, char *value,
return 0;
}
-static int _add_mirror(alpm_db_t *db, char *value)
+static int _add_mirror(alpm_db_t *db, alpm_server_t *server)
{
+ const char *value = alpm_server_get_url(server);
const char *dbname = alpm_db_get_name(db);
/* let's attempt a replacement for the current repo */
char *temp = strreplace(value, "$repo", dbname);
/* let's attempt a replacement for the arch */
const char *arch = config->arch;
- char *server;
+ char *url;
if(arch) {
- server = strreplace(temp, "$arch", arch);
+ url = strreplace(temp, "$arch", arch);
free(temp);
} else {
if(strstr(temp, "$arch")) {
@@ -632,18 +644,19 @@ static int _add_mirror(alpm_db_t *db, char *value)
value, "$arch", "Architecture");
return 1;
}
- server = temp;
+ url = temp;
}
+ alpm_server_set_url(server, url);
if(alpm_db_add_server(db, server) != 0) {
/* pm_errno is set by alpm_db_setserver */
pm_printf(ALPM_LOG_ERROR, _("could not add server URL to database '%s': %s (%s)\n"),
- dbname, server, alpm_strerror(alpm_errno(config->handle)));
- free(server);
+ dbname, url, alpm_strerror(alpm_errno(config->handle)));
+ free(url);
return 1;
}
- free(server);
+ free(url);
return 0;
}
@@ -669,11 +682,11 @@ static int register_repo(config_repo_t *repo)
alpm_db_set_usage(db, repo->usage == 0 ? ALPM_DB_USAGE_ALL : repo->usage);
for(i = repo->servers; i; i = alpm_list_next(i)) {
- char *value = i->data;
- if(_add_mirror(db, value) != 0) {
+ alpm_server_t *server = i->data;
+ if(_add_mirror(db, server) != 0) {
pm_printf(ALPM_LOG_ERROR,
_("could not add mirror '%s' to database '%s' (%s)\n"),
- value, repo->name, alpm_strerror(alpm_errno(config->handle)));
+ alpm_server_get_url(server), repo->name, alpm_strerror(alpm_errno(config->handle)));
return 1;
}
}
@@ -883,6 +896,7 @@ static int _parse_repo(const char *key, char *value, const char *file,
{
int ret = 0;
config_repo_t *repo = section->repo;
+ char *server_key, *server_value;
if(strcmp(key, "Server") == 0) {
if(!value) {
@@ -890,7 +904,34 @@ static int _parse_repo(const char *key, char *value, const char *file,
file, line, key);
ret = 1;
} else {
- repo->servers = alpm_list_add(repo->servers, strdup(value));
+ alpm_server_t *server = alpm_server_new();
+ char **cmd = alpm_wordsplit(value);
+ alpm_server_set_url(server, cmd[0]);
+ char **c;
+ for(c = cmd + 1; *c; c++) {
+ server_key = *c;
+ server_value = *c;
+ strsep(&server_value, "=");
+ strtrim(server_key);
+ strtrim(server_value);
+
+ if(strcmp(server_key, "PinnedPubKey") == 0) {
+ if(!server_value) {
+ pm_printf(ALPM_LOG_ERROR, _("config file %s, line %d: directive '%s' needs a value\n"),
+ file, line, server_key);
+ } else {
+ alpm_server_set_pinnedpubkey(server, server_value);
+ pm_printf(ALPM_LOG_DEBUG, "server config: server: %s, pinnedpubkey: %s\n", cmd[0], server_value);
+ }
+ } else {
+ pm_printf(ALPM_LOG_WARNING,
+ _("config file %s, line %d: directive '%s' in section '%s', server '%s', key '%s' not recognized.\n"),
+ file, line, key, repo->name, cmd[0], server_key);
+ }
+
+ }
+ alpm_wordsplit_free(cmd);
+ repo->servers = alpm_list_add(repo->servers, server);
}
} else if(strcmp(key, "SigLevel") == 0) {
if(!value) {
@@ -920,7 +961,6 @@ static int _parse_repo(const char *key, char *value, const char *file,
_("config file %s, line %d: directive '%s' in section '%s' not recognized.\n"),
file, line, key, repo->name);
}
-
return ret;
}
--
2.10.2
1
0
>From abb057844eec0e5707c31b643d0f2187b4cf0eb6 Mon Sep 17 00:00:00 2001
From: Travis Burtrum <travis.archlinux(a)burtrum.org>
Date: Mon, 31 Oct 2016 02:12:31 -0400
Subject: [PATCH] Add per-repo PinnedPubKey option
This sets curl's CURLOPT_PINNEDPUBLICKEY option in the built-in
downloader, or replaces %p in XferCommand. This pins public
keys to ensure your TLS connection is not man-in-the-middled
without relying on CAs etc. Probably most useful currently
for very small groups or single servers.
It would obviously be best as a per-mirror option, but such
a thing currently does not exist.
Signed-off-by: Travis Burtrum <travis.archlinux(a)burtrum.org>
---
doc/pacman.conf.5.txt | 12 +++++++++++-
lib/libalpm/alpm.h | 10 +++++++++-
lib/libalpm/be_sync.c | 4 ++++
lib/libalpm/db.c | 12 ++++++++++++
lib/libalpm/db.h | 1 +
lib/libalpm/dload.c | 8 +++++++-
lib/libalpm/dload.h | 1 +
lib/libalpm/sync.c | 7 ++++---
src/pacman/conf.c | 26 ++++++++++++++++++++++++--
src/pacman/conf.h | 1 +
10 files changed, 74 insertions(+), 8 deletions(-)
diff --git a/doc/pacman.conf.5.txt b/doc/pacman.conf.5.txt
index c665870..b1859c7 100644
--- a/doc/pacman.conf.5.txt
+++ b/doc/pacman.conf.5.txt
@@ -126,7 +126,8 @@ Options
All instances of `%u` will be replaced with the download URL. If present,
instances of `%o` will be replaced with the local filename, plus a
``.part'' extension, which allows programs like wget to do file resumes
- properly.
+ properly. If present, instances of `%p` will be replaced with the value of
+ the repo specific PinnedPubKey directive, or `` if that is not set.
+
This option is useful for users who experience problems with built-in
HTTP/FTP support, or need the more advanced proxy support that comes with
@@ -276,6 +277,15 @@ even be used for different architectures.
Note that an enabled repository can be operated on explicitly, regardless of the Usage
level set.
+*PinnedPubKey =* pinnedpubkey::
+ The string can be the file name of your pinned public key. The file format expected
+ is "PEM" or "DER". The string can also be any number of base64 encoded sha256
+ hashes preceded by "sha256//" and separated by ";"
++
+When negotiating a TLS or SSL connection, the server sends a certificate indicating
+its identity. A public key is extracted from this certificate and if it does not
+exactly match the public key provided to this option, pacman will abort the
+connection before sending or receiving any data.
Package and Database Signature Checking[[SC]]
---------------------------------------------
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 2d2491d..e942559 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -750,11 +750,12 @@ typedef void (*alpm_cb_totaldl)(off_t total);
* @param url the URL of the file to be downloaded
* @param localpath the directory to which the file should be downloaded
* @param force whether to force an update, even if the file is the same
+ * @param pinnedpubkey a pinned public key string
* @return 0 on success, 1 if the file exists and is identical, -1 on
* error.
*/
typedef int (*alpm_cb_fetch)(const char *url, const char *localpath,
- int force);
+ int force, const char *pinnedpubkey);
/** Fetch a remote pkg.
* @param handle the context handle
@@ -1037,6 +1038,13 @@ alpm_list_t *alpm_db_get_groupcache(alpm_db_t *db);
*/
alpm_list_t *alpm_db_search(alpm_db_t *db, const alpm_list_t *needles);
+/** Sets the pinned public key of a database.
+ * @param db pointer to the package database to set the status for
+ * @param pinnedpubkey a pinned public key string
+ * @return 0 on success, or -1 on error
+ */
+int alpm_db_set_pinnedpubkey(alpm_db_t *db, char *pinnedpubkey);
+
typedef enum _alpm_db_usage_ {
ALPM_DB_USAGE_SYNC = 1,
ALPM_DB_USAGE_SEARCH = (1 << 1),
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index 7774975..be2cd64 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -242,6 +242,8 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
payload.handle = handle;
payload.force = force;
payload.unlink_on_fail = 1;
+
+ payload.pinnedpubkey = db->pinnedpubkey;
ret = _alpm_download(&payload, syncpath, NULL, &final_db_url);
_alpm_dload_payload_reset(&payload);
@@ -297,6 +299,8 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
/* set hard upper limit of 16KiB */
payload.max_size = 16 * 1024;
+ payload.pinnedpubkey = db->pinnedpubkey;
+
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;
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 5d78ee5..0dab1e7 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -306,6 +306,15 @@ alpm_list_t SYMEXPORT *alpm_db_search(alpm_db_t *db, const alpm_list_t *needles)
return _alpm_db_search(db, needles);
}
+/** Sets the pinned public key for a repo */
+int SYMEXPORT alpm_db_set_pinnedpubkey(alpm_db_t *db, char *pinnedpubkey)
+{
+ ASSERT(db != NULL, return -1);
+ ASSERT(pinnedpubkey != NULL, return 0);
+ db->pinnedpubkey = strdup(pinnedpubkey);
+ return 0;
+}
+
/** Sets the usage bitmask for a repo */
int SYMEXPORT alpm_db_set_usage(alpm_db_t *db, int usage)
{
@@ -351,6 +360,9 @@ void _alpm_db_free(alpm_db_t *db)
FREELIST(db->servers);
FREE(db->_path);
FREE(db->treename);
+ if(db->pinnedpubkey != NULL) {
+ FREE(db->pinnedpubkey);
+ }
FREE(db);
return;
diff --git a/lib/libalpm/db.h b/lib/libalpm/db.h
index 8e50196..4ce98c8 100644
--- a/lib/libalpm/db.h
+++ b/lib/libalpm/db.h
@@ -67,6 +67,7 @@ struct __alpm_db_t {
char *treename;
/* do not access directly, use _alpm_db_path(db) for lazy access */
char *_path;
+ char *pinnedpubkey;
alpm_pkghash_t *pkgcache;
alpm_list_t *grpcache;
alpm_list_t *servers;
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 9d80358..6d5b371 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -327,6 +327,12 @@ static void curl_set_handle_opts(struct dload_payload *payload,
curl_easy_setopt(curl, CURLOPT_USERAGENT, useragent);
}
+ if(payload->pinnedpubkey != NULL) {
+ _alpm_log(handle, ALPM_LOG_DEBUG,
+ "using curl pinnedpubkey: %s\n", payload->pinnedpubkey);
+ curl_easy_setopt(curl, CURLOPT_PINNEDPUBLICKEY, payload->pinnedpubkey);
+ }
+
if(!payload->allow_resume && !payload->force && payload->destfile_name &&
stat(payload->destfile_name, &st) == 0) {
/* start from scratch, but only download if our local is out of date. */
@@ -646,7 +652,7 @@ int _alpm_download(struct dload_payload *payload, const char *localpath,
RET_ERR(handle, ALPM_ERR_EXTERNAL_DOWNLOAD, -1);
#endif
} else {
- int ret = handle->fetchcb(payload->fileurl, localpath, payload->force);
+ int ret = handle->fetchcb(payload->fileurl, localpath, payload->force, payload->pinnedpubkey);
if(ret == -1 && !payload->errors_ok) {
RET_ERR(handle, ALPM_ERR_EXTERNAL_DOWNLOAD, -1);
}
diff --git a/lib/libalpm/dload.h b/lib/libalpm/dload.h
index 427c486..b938fdc 100644
--- a/lib/libalpm/dload.h
+++ b/lib/libalpm/dload.h
@@ -41,6 +41,7 @@ struct dload_payload {
int errors_ok;
int unlink_on_fail;
int trust_remote_name;
+ char *pinnedpubkey;
#ifdef HAVE_LIBCURL
CURLcode curlerr; /* last error produced by curl */
#endif
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 837639d..05e1ffe 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -862,7 +862,7 @@ static int validate_deltas(alpm_handle_t *handle, alpm_list_t *deltas)
}
static struct dload_payload *build_payload(alpm_handle_t *handle,
- const char *filename, size_t size, alpm_list_t *servers)
+ const char *filename, size_t size, alpm_list_t *servers, char *pinnedpubkey)
{
struct dload_payload *payload;
@@ -870,6 +870,7 @@ static struct dload_payload *build_payload(alpm_handle_t *handle,
STRDUP(payload->remote_name, filename, FREE(payload); RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
payload->max_size = size;
payload->servers = servers;
+ payload->pinnedpubkey = pinnedpubkey;
return payload;
}
@@ -898,7 +899,7 @@ static int find_dl_candidates(alpm_db_t *repo, alpm_list_t **files, alpm_list_t
alpm_delta_t *delta = dlts->data;
if(delta->download_size != 0) {
struct dload_payload *payload = build_payload(
- handle, delta->delta, delta->delta_size, repo->servers);
+ handle, delta->delta, delta->delta_size, repo->servers, repo->pinnedpubkey);
ASSERT(payload, return -1);
*files = alpm_list_add(*files, payload);
}
@@ -909,7 +910,7 @@ static int find_dl_candidates(alpm_db_t *repo, alpm_list_t **files, alpm_list_t
} else if(spkg->download_size != 0) {
struct dload_payload *payload;
ASSERT(spkg->filename != NULL, RET_ERR(handle, ALPM_ERR_PKG_INVALID_NAME, -1));
- payload = build_payload(handle, spkg->filename, spkg->size, repo->servers);
+ payload = build_payload(handle, spkg->filename, spkg->size, repo->servers, repo->pinnedpubkey);
ASSERT(payload, return -1);
*files = alpm_list_add(*files, payload);
}
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index d8d64fb..8dd23e5 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -163,6 +163,9 @@ void config_repo_free(config_repo_t *repo)
if(repo == NULL) {
return;
}
+ if(repo->pinnedpubkey != NULL) {
+ free(repo->pinnedpubkey);
+ }
free(repo->name);
FREELIST(repo->servers);
free(repo);
@@ -204,7 +207,7 @@ static char *get_tempfile(const char *path, const char *filename)
/** External fetch callback */
static int download_with_xfercommand(const char *url, const char *localpath,
- int force)
+ int force, const char *pinnedpubkey)
{
int ret = 0, retval;
int usepart = 0;
@@ -232,6 +235,16 @@ static int download_with_xfercommand(const char *url, const char *localpath,
}
tempcmd = strdup(config->xfercommand);
+ /* replace all occurrences of %p with pinnedpubkey */
+ if(strstr(tempcmd, "%p")) {
+ if(pinnedpubkey == NULL) {
+ parsedcmd = strreplace(tempcmd, "%p", "");
+ } else {
+ parsedcmd = strreplace(tempcmd, "%p", pinnedpubkey);
+ }
+ free(tempcmd);
+ tempcmd = parsedcmd;
+ }
/* replace all occurrences of %o with fn.part */
if(strstr(tempcmd, "%o")) {
usepart = 1;
@@ -668,6 +681,8 @@ static int register_repo(config_repo_t *repo)
repo->name);
alpm_db_set_usage(db, repo->usage == 0 ? ALPM_DB_USAGE_ALL : repo->usage);
+ alpm_db_set_pinnedpubkey(db, repo->pinnedpubkey);
+
for(i = repo->servers; i; i = alpm_list_next(i)) {
char *value = i->data;
if(_add_mirror(db, value) != 0) {
@@ -915,12 +930,19 @@ static int _parse_repo(const char *key, char *value, const char *file,
}
FREELIST(values);
}
+ } else if(strcmp(key, "PinnedPubKey") == 0) {
+ if(!value) {
+ pm_printf(ALPM_LOG_ERROR, _("config file %s, line %d: directive '%s' needs a value\n"),
+ file, line, key);
+ } else {
+ repo->pinnedpubkey = strdup(value);
+ pm_printf(ALPM_LOG_DEBUG, "repo config: pinnedpubkey: %s\n", value);
+ }
} else {
pm_printf(ALPM_LOG_WARNING,
_("config file %s, line %d: directive '%s' in section '%s' not recognized.\n"),
file, line, key, repo->name);
}
-
return ret;
}
diff --git a/src/pacman/conf.h b/src/pacman/conf.h
index 945de7c..7c021bf 100644
--- a/src/pacman/conf.h
+++ b/src/pacman/conf.h
@@ -40,6 +40,7 @@ typedef struct __config_repo_t {
int usage;
int siglevel;
int siglevel_mask;
+ char *pinnedpubkey;
} config_repo_t;
typedef struct __config_t {
--
2.10.2
6
11
02 Nov '16
Hey, so following up with discussions that happened yesterday on
#archlinux.
So, for context, I have a project for building Arch Linux repositories
in an automated way: https://github.com/vodik/repose
Some of you guys are aware of the project, but for those that aren't,
its an alternative for the repo-add and repo-remove utilities. It
attempts to intelligently build an optimal repository from a pool of
packages and automatically handles incremental rebuilds in an automated
way. For the most part, its faster than repo-add and fits better with
makepkg and PKGDEST.
As part of the project I've had to write my own utilities for processing
tarballs and parsers and for the pacman database desc/depends/files
entries and .PKGINFO file. I wanted to use reuse the official libalpm
utilities, but I found them too tightly coupled into how libalpm expects
to be used and the layout of the package structure.
I initially copied out the internal parsers and modified them, but
they've since been replaced with ragel-generated standalone parsers.
They have their own test coverage and do run quite a bit faster.
I'm curious if there's any interest in accepting some of this work and
on what kind of terms? As patches to libalpm for my decouple parsers? Is
ragel okay? Or if maybe its something that's best as a standalone
library?
2
1
[pacman-dev] [PATCH] Make sure all proper scripts are installed instead of the wrappers
by Johannes Löthberg 26 Oct '16
by Johannes Löthberg 26 Oct '16
26 Oct '16
After 1f8f0bd9ac4c11cdc1b9506f9f64d8192ecad4ee all scripts that were
changed to using the wrapper for in-tree use have the wrappers installed
to the system instead of the actual script, so change the install
command to support all wrapped scripts instead of just makepkg.
Signed-off-by: Johannes Löthberg <johannes(a)kyriasis.com>
---
scripts/Makefile.am | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 448057d..977aa90 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -247,7 +247,9 @@ install-exec-hook:
cd $(DESTDIR)$(bindir) && \
$(RM) $$wrapper; \
done
- $(INSTALL) .lib/makepkg $(DESTDIR)$(bindir)/makepkg
+ for wrapper in $(WRAPPER); do \
+ $(INSTALL) .lib/$${wrapper%-wrapper} $(DESTDIR)$(bindir)/$${wrapper%-wrapper}; \
+ done
for dir in $(LIBMAKEPKGDIRS); do \
$(MKDIR_P) $(DESTDIR)$(libmakepkgdir)/$$dir; \
done
--
2.10.1
3
2
Building from commit fa06951d90fee028ece95fc7caab39fc7d35d55f generates
the scripts pacman-db-upgrade, pacman-key and pkgdelta in the form
DIR="/path/to/builddir/src/pacman/scripts"
LIBRARY="$DIR"/libmakepkg exec "$DIR"/.lib/pacman-key "$@"
so they hold a reference to the build directory. Building pacman with
makepkg triggers the "reference to $srcdir" warning. However, I haven't
bisected the latest commits yet.
2
3
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%2Fpo%2Fsr(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%2Fscripts%2Fpo%2Fsr(a)latin.po b%2Fscripts%2Fpo%2Fsr(a)latin.po
index 6e70462..d8517cf 100644
--- a%2Fscripts%2Fpo%2Fsr(a)latin.po
+++ b%2Fscripts%2Fpo%2Fsr(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