From patchwork Fri Jan 18 14:52:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov via arch-projects X-Patchwork-Id: 966 Return-Path: Delivered-To: patchwork@archlinux.org Received: from apollo.archlinux.org (localhost [127.0.0.1]) by apollo.archlinux.org (Postfix) with ESMTP id 992BCAA74877 for ; Fri, 18 Jan 2019 14:53:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on apollo X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00=-1, DKIMWL_WL_HIGH=-1.046,DKIM_SIGNED=0.1,DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_MED=-2.3 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-BL-Results: [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Fri, 18 Jan 2019 14:53:27 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id CE265100A9146F; Fri, 18 Jan 2019 14:53:24 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [IPv6:2a01:4f8:160:3033::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS; Fri, 18 Jan 2019 14:53:24 +0000 (UTC) Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id A28682BEA6; Fri, 18 Jan 2019 14:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=luna2; t=1547823204; bh=95Lk0c9kaCoaNkWUt9VwRplYGcO+nTn/OO8+7D3KVDE=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc; b=pjO/RJVoePZLYA4Y+HZw4uDPXz8ft6ESilw0IDnR0+WnTTljYhqpVQQiV3nmvapcP yX/YgaAlyyavxwvyv82oZY4X4oJoYmEIXLJfw0+LXftPCfMV7bhnMIaOjvyqrYK906 LgH9sqDInqyfD7U+Rf15U/h0ToyjmZzvSVoBPUYvjIrc/10jdOvmpapmWbefymIc4y uNA5PsSRy/XOyKubamF/Ynlwl3rv8Qne2zF8k0Q8uQ+7+T6y8S1JfJ8j5kxy8nu8ZV DQhrOdWiJLUlFNF6Dk4MwiUQkbiMPoL2k3xuQBFWZQhEgg4L9R1jC3SA3JKMOppBD5 sqrPqvNmttzc5sSLeiVTMVWCBm/uEaAztZsHUFG8oUXoRnct2pZK9E/xvqwI4BszGd yP6uP9Tp35Nr4EoCZqkzMEiEknQJK44Q0TeoI4zNCTpEPI9SYYSaZJXdejiDu+tf0o L/WTciE1+1tRHlAlh8g6EvmdUFa7t0Cg2N5atmOW8vZbAnugze+Wn/1smu/TfNf/PO /9CufaH/VjNYsWm+11Rd7e41rgBj1A5GbnUfUYV5PR352dnAKmwyDAXaTilk9z9Tnd OXXlc8oFiyu7Y+09GkY39MhME+1wGqN4OKo05HMibMZnntBcnu85D4R1ceyJo8aEwc M2EowUAsruxcTbXnyoaZtxxA= Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 7B7092BE4F for ; Fri, 18 Jan 2019 14:53:22 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [IPv6:2a01:4f8:160:6087::1]) by luna.archlinux.org (Postfix) with ESMTPS for ; Fri, 18 Jan 2019 14:53:22 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id CDE99100A9146C; Fri, 18 Jan 2019 14:53:16 +0000 (UTC) Received: from didactylos.attlocal.net (unknown [IPv6:2600:1700:57f0:ca20:763a:c795:fcf6:91ea]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: eschwartz) by orion.archlinux.org (Postfix) with ESMTPSA id 431E5100A9146B; Fri, 18 Jan 2019 14:53:16 +0000 (UTC) To: arch-projects@archlinux.org Date: Fri, 18 Jan 2019 09:52:57 -0500 Message-Id: <20190118145257.26900-1-eschwartz@archlinux.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [arch-projects] [pyalpm] [PATCH] Rename function to match renamed name in pacman master X-BeenThere: arch-projects@archlinux.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Arch Linux projects development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eli Schwartz via arch-projects Reply-To: Arch Linux projects development discussion Cc: Eli Schwartz Errors-To: arch-projects-bounces@archlinux.org Sender: "arch-projects" alpm_sync_newversion becomes alpm_sync_get_new_version and changes behavior slightly. See for details: https://git.archlinux.org/pacman.git/commit/?id=e9d91a688d1a2ebe58e8a895853debf745a529cf --- DO NOT MERGE THIS until after pacman 5.2 or 6 is released. pacman does not have any good preprocessor check for this -- the only way to handle both methods would be to implement some sort of test in setup.py and create a DEFINE based on that. Posted here in order to be prepared, though I wouldn't mind having it exist in the pyalpm repo in a "pacman-git" branch. ;) src/db.c | 4 ++-- src/db.h | 2 +- src/pyalpm.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/db.c b/src/db.c index 3015d61..f6c5da4 100644 --- a/src/db.c +++ b/src/db.c @@ -304,7 +304,7 @@ PyObject* pyalpm_find_grp_pkgs(PyObject* self, PyObject *args) { } /** Finds an available upgrade for a package in a list of databases */ -PyObject* pyalpm_sync_newversion(PyObject *self, PyObject* args) { +PyObject* pyalpm_sync_get_new_version(PyObject *self, PyObject* args) { PyObject *pkg; PyObject *dbs; alpm_list_t *db_list; @@ -320,7 +320,7 @@ PyObject* pyalpm_sync_newversion(PyObject *self, PyObject* args) { { alpm_pkg_t *rawpkg = pmpkg_from_pyalpm_pkg(pkg); if (rawpkg) { - result = alpm_sync_newversion(rawpkg, db_list); + result = alpm_sync_get_new_version(rawpkg, db_list); } alpm_list_free(db_list); } diff --git a/src/db.h b/src/db.h index 4ed02e6..be35b78 100644 --- a/src/db.h +++ b/src/db.h @@ -29,6 +29,6 @@ PyObject *pyalpm_db_from_pmdb(void* data); int pylist_db_to_alpmlist(PyObject *list, alpm_list_t **result); PyObject* pyalpm_find_grp_pkgs(PyObject* self, PyObject* args); -PyObject* pyalpm_sync_newversion(PyObject *self, PyObject* args); +PyObject* pyalpm_sync_get_new_version(PyObject *self, PyObject* args); #endif diff --git a/src/pyalpm.c b/src/pyalpm.c index 56c9639..7391191 100644 --- a/src/pyalpm.c +++ b/src/pyalpm.c @@ -87,7 +87,7 @@ static PyMethodDef methods[] = { "args: a list of packages, a dependency string\n" "returns: a Package object or None" }, - {"sync_newversion", pyalpm_sync_newversion, METH_VARARGS, + {"sync_newversion", pyalpm_sync_get_new_version, METH_VARARGS, "finds an available upgrade for a package in a list of databases\n" "args: a package, a list of databases\n" "returns: an upgrade candidate or None" },