From patchwork Wed Jun 17 00:05:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Victor X-Patchwork-Id: 1693 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 C5795196926E9 for ; Wed, 17 Jun 2020 00:11:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on apollo.archlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIM_ADSP_CUSTOM_MED=0.001, DKIM_INVALID=1,DKIM_SIGNED=0.1,FREEMAIL_FROM=0.5,MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3,RCVD_IN_MSPIKE_H4=0.001,RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,T_DMARC_POLICY_NONE=0.01,T_DMARC_SIMPLE_DKIM=0.01 autolearn=ham autolearn_force=no version=3.4.4 X-Spam-BL-Results: [127.0.0.19] [127.0.9.2] Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by apollo.archlinux.org (Postfix) with ESMTPS for ; Wed, 17 Jun 2020 00:11:15 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 589D81CEB7E8D7; Wed, 17 Jun 2020 00:06:07 +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) server-digest SHA256) (No client certificate requested) (Authenticated sender: luna) by orion.archlinux.org (Postfix) with ESMTPSA id 90A1C1CEB7E8D0; Wed, 17 Jun 2020 00:06:06 +0000 (UTC) Authentication-Results: orion.archlinux.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nD8MmUve Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 3374920F5B; Wed, 17 Jun 2020 00:06:06 +0000 (UTC) Authentication-Results: luna.archlinux.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nD8MmUve Received: from luna.archlinux.org (luna.archlinux.org [127.0.0.1]) by luna.archlinux.org (Postfix) with ESMTP id 5D7AD20F45 for ; Wed, 17 Jun 2020 00:06:01 +0000 (UTC) Received: from orion.archlinux.org (orion.archlinux.org [88.198.91.70]) by luna.archlinux.org (Postfix) with ESMTPS for ; Wed, 17 Jun 2020 00:06:01 +0000 (UTC) Received: from orion.archlinux.org (localhost [127.0.0.1]) by orion.archlinux.org (Postfix) with ESMTP id 1FC031CEB7E8CA for ; Wed, 17 Jun 2020 00:06:00 +0000 (UTC) Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by orion.archlinux.org (Postfix) with ESMTPS for ; Wed, 17 Jun 2020 00:06:00 +0000 (UTC) Received: by mail-qt1-x844.google.com with SMTP id i16so214356qtr.7 for ; Tue, 16 Jun 2020 17:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NboQ4UJUU1PXfE5zrDatb7F5ixBrG7nP4+1EMgC7/Bc=; b=nD8MmUvemd2baNpOkhIHeUa21SC3Lxf6f9u0rmMaM57ICz+FEXTj799Djowpzmr5hR uy8UfdzDHNCahjXiAuq7rmRhRpf6rqrXsjKkdnMK6tDgoKI2z/WqBjjeLJeVP/EYeTfx vtW7lbVZ2XDROa/u3inq8ON2vJTdC/K8dOKxWARW4oufHmy/BShMw4+5loyr4ZmxQs4h pQNXfNlVnFFIQZ0TBFvLv8jYh69o2r4SNYf+Kmlt/B1V4Nr4UG2EIYbo+YVp8bGRO5SI Z7E/z1WCKAfeWq2ZMX3xr0QwNg5IvY0E+EAAk+6pG+SZZXcRYPfgtNC4Mz/SDY6oRrf8 Q8aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NboQ4UJUU1PXfE5zrDatb7F5ixBrG7nP4+1EMgC7/Bc=; b=Y/DA0F40VvwC4TSVkLA6PInpeLEuKui6y5jF4sq2Yr2YJqpGtdhXoPxrV+ILEo9K89 4xm5QgrrXjwly1vnZ1GJj6GEypWOqiroQU/TRSMKN2x4VD9ssg1h3Kd9ErLfpyTdD/io +zUn8QRp6+u6tgCU/40FHldBa3FLPJNNSEoGpAUlkOCKQZ1OqU5GhhvYLtZbHG9mRPSt gCX1/HZ6xeIFXRwBVK0OkFp1P86TKsWRACZYNPHDUrciQryDQ9DA/h28i/evxF5Bkq9r ynOKaa8Q/c5ziRl0jBRx5gmf1iuJJnRkx/sCJfA855VfqvMIs6BPOfqyBSPAWZDQsqid b/+A== X-Gm-Message-State: AOAM533jwIi1Hoto28ysSkfwcFCShEf0nUEJCANxcyLwjBeJSQXXkB6h mjDwsgdd4xR1g/t5CXj4Iwx4X1O1V3bCPg== X-Google-Smtp-Source: ABdhPJyHxw64g78FQCGt3vYMKKosnGyNE8es6aslEyWMVTx6giCjhlzDB35DRgPuoV6/Yqv/ZNQjDg== X-Received: by 2002:aed:2252:: with SMTP id o18mr24724690qtc.258.1592352358457; Tue, 16 Jun 2020 17:05:58 -0700 (PDT) Received: from localhost.localdomain ([2804:7f7:dd87:7af8:7aed:cb54:882a:9fd2]) by smtp.googlemail.com with ESMTPSA id e53sm17392508qtk.50.2020.06.16.17.05.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 17:05:57 -0700 (PDT) From: Pedro Victor To: pacman-dev@archlinux.org Cc: Pedro Victor Date: Tue, 16 Jun 2020 21:05:49 -0300 Message-Id: <20200617000549.9017-1-pedrocga1.opensource@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [pacman-dev] [PATCH] Adds a check to -Qo, so that pacman warns the user if the file does not exits X-BeenThere: pacman-dev@archlinux.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Discussion list for pacman development Errors-To: pacman-dev-bounces@archlinux.org Sender: "pacman-dev" From: Pedro Victor --- src/pacman/query.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pacman/query.c b/src/pacman/query.c index 513ddb7a..784936b9 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -209,6 +209,11 @@ static int query_fileowner(alpm_list_t *targets) strcat(rpath + rlen, "/"); } + if (access(rel_path, F_OK) == -1) { + pm_printf(ALPM_LOG_ERROR, _("File does not exist: %s\n"), rel_path); + goto targcleanup; + } + for(i = packages; i && (!found || is_dir); i = alpm_list_next(i)) { if(alpm_filelist_contains(alpm_pkg_get_files(i->data), rel_path)) { print_query_fileowner(rpath, i->data);