From patchwork Sun Feb 6 18:30:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Gregory X-Patchwork-Id: 2020 Return-Path: Delivered-To: patchwork@archlinux.org Received: from mail.archlinux.org [95.216.189.61] by patchwork.archlinux.org with IMAP (fetchmail-6.4.26) for (single-drop); Sun, 06 Feb 2022 18:31:24 +0000 (UTC) Received: from mail.archlinux.org by mail.archlinux.org with LMTP id mYKPJ/sTAGL5VwQAK+/4rw (envelope-from ) for ; Sun, 06 Feb 2022 18:31:23 +0000 Received: from lists.archlinux.org (lists.archlinux.org [95.217.236.249]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.archlinux.org (Postfix) with ESMTPS id B38AECD670E; Sun, 6 Feb 2022 18:31:22 +0000 (UTC) Received: from lists.archlinux.org (localhost [IPv6:::1]) by lists.archlinux.org (Postfix) with ESMTP id 2D0D3C9E0BE; Sun, 6 Feb 2022 18:31:20 +0000 (UTC) X-Original-To: pacman-dev@lists.archlinux.org Delivered-To: pacman-dev@lists.archlinux.org Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lists.archlinux.org (Postfix) with ESMTPS id 64FE2C9E08C for ; Sun, 6 Feb 2022 18:31:16 +0000 (UTC) Received: by mail-pl1-x62a.google.com with SMTP id k17so9588514plk.0 for ; Sun, 06 Feb 2022 10:31:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8DJx7SjCcjUkfLz1ooYncjdxl8hWY5jC9g/uELgOlII=; b=oR0IYbnoCh0ogX80p0B1/Fn3qqK+85WifcuBCR9btG7fMitFmZmi+7gLMqY0LajfM5 Rh5w7Y9ggUhoP+rOnNNdbn+T7caoSCeSwnUPGStIWTOtEkQfRSeFwow6jllTLKpyDk7v U3aP8gfVIXs4ZZkAduep8k9LJZubjwM487CQykPRDJl4xlKQVZ0Qy9rdUXbjplpUp9B/ q2ANn2rHKNSUVNmVAHXU0WPgf7O2VnALRldt56Rs/GwhFzC4V9Qqu2195gQ9qLszucBt KWxkOGIbNnL45bXCslNaG5Q1seD8yNgKKqI1mMLRXlUABLq3etS+nnhYlxk0fjZMuMOQ Opww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8DJx7SjCcjUkfLz1ooYncjdxl8hWY5jC9g/uELgOlII=; b=NbTqRvgxTK/V01h/a0N1G0lxlHWDjyBq/fU1Hx083rjnl+Z8MTCVOVQgBpnVFw/GK9 JcgY4EM1yZLm3LP23gqqeZJu0EmDzf9WaW/4/vLUpIjfOGnV+wjrdpx93/dl16TW8o4N NY7HNNYF9MvIL13SXkrPZrvsQl5K1IW0nS0O+99u9NeJ0b2SM2ABPi/qBz5YPOsS7msY kyEI5bjltMLDEqq9+FwFGqqO/kore6XlBdQSi3+MzhlVGOd/GL/yXdHu9e1aI2u9KAW8 eSzyz6oFwbYdfEEQQd690pgC5EHeEp8e73s4NUJwBcSop9X7FLPSX3ic2Vl1rdQE8f/v R0mg== X-Gm-Message-State: AOAM533Bvy17yCzB7j/9q26/hEUg7LCITEuloQLazzHfwXsNNrznBTmf tpSky5OMVPrNx3IqfW2Y4efquBxFX+U= X-Google-Smtp-Source: ABdhPJw6a6lsCM9jBnRao6yRxM9W2izid0lcekXIvRjVAuuFMVdJtLJSyOB2xa4qx9XyPdu1eGMImw== X-Received: by 2002:a17:90b:3511:: with SMTP id ls17mr14389622pjb.241.1644172274296; Sun, 06 Feb 2022 10:31:14 -0800 (PST) Received: from localhost.localdomain ([98.47.179.215]) by smtp.gmail.com with ESMTPSA id 14sm4189163pgk.85.2022.02.06.10.31.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 10:31:13 -0800 (PST) From: Andrew Gregory To: pacman-dev@lists.archlinux.org Cc: Andrew Gregory Subject: [PATCH 1/5] query: only strip leading local/ for db packages Date: Sun, 6 Feb 2022 10:30:37 -0800 Message-Id: <20220206183041.104788-2-andrew.gregory.8@gmail.com> X-Mailer: git-send-email 2.35.0 In-Reply-To: <20220206183041.104788-1-andrew.gregory.8@gmail.com> References: <20220206183041.104788-1-andrew.gregory.8@gmail.com> MIME-Version: 1.0 X-BeenThere: pacman-dev@lists.archlinux.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: pacman-dev-bounces@lists.archlinux.org Sender: "pacman-dev" Authentication-Results: mail.archlinux.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=oR0IYbno; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mail.archlinux.org: domain of pacman-dev-bounces@lists.archlinux.org designates 95.217.236.249 as permitted sender) smtp.mailfrom=pacman-dev-bounces@lists.archlinux.org X-Rspamd-Queue-Id: B38AECD670E X-Spamd-Result: default: False [-1.41 / 15.00]; R_MISSING_CHARSET(0.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MAILLIST(-0.20)[mailman]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; RCVD_IN_DNSWL_MED(-0.20)[95.217.236.249:from]; R_SPF_ALLOW(-0.20)[+ip4:95.217.236.249:c]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[]; FROM_NEQ_ENVFROM(0.00)[andrewgregory8@gmail.com,pacman-dev-bounces@lists.archlinux.org]; FROM_HAS_DN(0.00)[]; BLOCKLISTDE_FAIL(0.00)[98.47.179.215:server fail,2607:f8b0:4864:20::62a:server fail]; PREVIOUSLY_DELIVERED(0.00)[pacman-dev@lists.archlinux.org]; NEURAL_HAM(-0.00)[-1.000]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::62a:received]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_VIA_SMTP_AUTH(0.00)[]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[gmail.com]; ASN(0.00)[asn:24940, ipnet:95.217.0.0/16, country:DE]; FORGED_SENDER_MAILLIST(0.00)[] X-Rspamd-Server: mail.archlinux.org Signed-off-by: Andrew Gregory --- src/pacman/query.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pacman/query.c b/src/pacman/query.c index 0208d5b6..afcbbd4f 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -468,11 +468,6 @@ int pacman_query(alpm_list_t *targets) for(i = targets; i; i = alpm_list_next(i)) { const char *strname = i->data; - /* strip leading part of "local/pkgname" */ - if(strncmp(strname, LOCAL_PREFIX, strlen(LOCAL_PREFIX)) == 0) { - strname += strlen(LOCAL_PREFIX); - } - if(config->op_q_isfile) { alpm_pkg_load(config->handle, strname, 1, 0, &pkg); @@ -482,6 +477,11 @@ int pacman_query(alpm_list_t *targets) alpm_strerror(alpm_errno(config->handle))); } } else { + /* strip leading part of "local/pkgname" */ + if(strncmp(strname, LOCAL_PREFIX, strlen(LOCAL_PREFIX)) == 0) { + strname += strlen(LOCAL_PREFIX); + } + pkg = alpm_db_get_pkg(db_local, strname); if(pkg == NULL) { pkg = alpm_find_satisfier(alpm_db_get_pkgcache(db_local), strname);