From patchwork Sat Apr 4 11:30:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Stadler X-Patchwork-Id: 1266370 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=student.uibk.ac.at Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20170209 header.b=m4dK/kJX; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 ozlabs.org (Postfix) with ESMTPS id 48vZNy652Qz9sPF for ; Sat, 4 Apr 2020 22:30:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=M2Ksa6xRXEWpoh4QJi+R9BusFzbCWhjt4Qw8caGebMw=; b=m4dK/kJXK/ZF/q sRvF8+9JlA79qnwD/GQTQgjP2/DkoVJQ8+t5VZa/EKNqawQslabqVFnPT7nO8H9Zc6WoTxGXMMl6m BECxb77GkHXSSAitzhQq8A6fkqpMJeWQJB3GCynbgmIPV4Y3nD29/sP8/fmKxC+DvXIDC+Z5jKfsW c02AxC97lpGBGjW4v6FxKm8G4sn7o/ZW37zGffRhu1kR9IWiWoi04oTzeF2l6BdTaBEXU4DseB2bE JOEcOIXwhFi1KpHJvbfQW7cBS5HOdd8yteD2kneUQkUAap/X63G+6BWQBEQt+FVihMNQk+loRYbx6 lkpJJmDH/TfybII3WtaQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jKh0Z-0000va-P0; Sat, 04 Apr 2020 11:30:39 +0000 Received: from lmr1.uibk.ac.at ([138.232.1.142] helo=smtp.uibk.ac.at) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jKh0V-0000ut-Dh for openwrt-devel@lists.openwrt.org; Sat, 04 Apr 2020 11:30:37 +0000 Received: from localhost.localdomain (ip5f5ac5e8.dynamic.kabel-deutschland.de [95.90.197.232]) (authenticated bits=0) by smtp.uibk.ac.at (8.14.4/8.14.4/F1) with ESMTP id 034BUHwX027684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 4 Apr 2020 13:30:23 +0200 From: Peter Stadler To: openwrt-devel@lists.openwrt.org Date: Sat, 4 Apr 2020 13:30:15 +0200 Message-Id: <20200404113015.17863-1-peter.stadler@student.uibk.ac.at> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-Spam-Score: () -15.0 ALL_TRUSTED,RCV_SMTP_AUTH,RCV_SMTP_UIBK X-Scanned-By: MIMEDefang 2.84 at uibk.ac.at X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200404_043035_779229_4738348D X-CRM114-Status: UNSURE ( 8.18 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [138.232.1.142 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [138.232.1.142 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Subject: [OpenWrt-Devel] [PATCH] opkg: remove inexistent files from list only X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Stadler Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This avoids misleading messages for files that are deleted already (by the user or by remove_obsolesced_files), e.g. for conffiles: * file_sha256sum_alloc: Failed to open file … Not deleting modified conffile … (This statement is false for obsolete files as opkg deleted them.) Signed-off-by: Peter Stadler --- libopkg/opkg_remove.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c index 96ca558..a9c7d5a 100644 --- a/libopkg/opkg_remove.c +++ b/libopkg/opkg_remove.c @@ -355,6 +355,12 @@ void remove_data_files_and_list(pkg_t * pkg) iter = str_list_next(installed_files, iter)) { file_name = (char *)iter->data; + if (!file_exists(file_name)) { + /* File deleted by user or remove_obsolesced_files(). */ + file_hash_remove(file_name); + continue; + } + owner = file_hash_get_file_owner(file_name); if (owner != pkg) /* File may have been claimed by another package. */