From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B0B53138334 for ; Thu, 2 Jan 2020 09:47:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E5BA4E0AD4; Thu, 2 Jan 2020 09:47:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C8C24E0AD4 for ; Thu, 2 Jan 2020 09:47:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BAF4334DDC8 for ; Thu, 2 Jan 2020 09:47:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A054074 for ; Thu, 2 Jan 2020 09:47:02 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1577958273.56a4f36cf6325323068397b0b510b8e8340c25d9.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: TODO.md qpkg.c X-VCS-Directories: / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 56a4f36cf6325323068397b0b510b8e8340c25d9 X-VCS-Branch: master Date: Thu, 2 Jan 2020 09:47:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 31617287-a2ad-4c18-8210-f9769d2c2ede X-Archives-Hash: 3e689a695ad3601f405dd14ad0c00817 commit: 56a4f36cf6325323068397b0b510b8e8340c25d9 Author: Fabian Groffen gentoo org> AuthorDate: Thu Jan 2 09:44:33 2020 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Thu Jan 2 09:44:33 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=56a4f36c qlop: improve description for -c, fix -E -c could use a bit better explanation -E included installed packages for no good reason Signed-off-by: Fabian Groffen gentoo.org> TODO.md | 5 +++++ qpkg.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/TODO.md b/TODO.md index 602d17a..d89dda1 100644 --- a/TODO.md +++ b/TODO.md @@ -18,6 +18,10 @@ so we can - parse package.accept\_keywords such that we can provide the latest "available" version like Portage +- check timestamps in libq/tree for choosing which method to take: + - ignore Packages when it is older than the last directory change + - ignore metadata when ebuild is modified + - add some method to skip these checks and assume everything is right # qmerge - dep resolver needs spanktastic love. @@ -65,6 +69,7 @@ # qmanifest - use openat in most places - parse timestamps and print in local timezone +- implement python module for gemato interface (to use with Portage) # qlop - guestimate runtime based on best-matching pkg (e.g. with gcc) diff --git a/qpkg.c b/qpkg.c index 9d2d82a..771241c 100644 --- a/qpkg.c +++ b/qpkg.c @@ -41,8 +41,8 @@ static struct option const qpkg_long_opts[] = { COMMON_LONG_OPTS }; static const char * const qpkg_opts_help[] = { - "clean pkgdir of unused binary files", - "clean pkgdir of files not in the tree anymore (slow)", + "clean pkgdir of files that are not installed", + "clean pkgdir of files that are not in the tree anymore", "pretend only", "alternate package directory", COMMON_OPTS_HELP @@ -134,12 +134,6 @@ qpkg_clean(char *dirp) if ((count = scandir(".", &dnames, filter_hidden, alphasort)) < 0) return 1; - t = tree_open_vdb(portroot, portvdb); - if (t != NULL) { - vdb = tree_get_atoms(t, true, vdb); - tree_close(t); - } - if (eclean) { size_t n; const char *overlay; @@ -151,6 +145,12 @@ qpkg_clean(char *dirp) tree_close(t); } } + } else { + t = tree_open_vdb(portroot, portvdb); + if (t != NULL) { + vdb = tree_get_atoms(t, true, vdb); + tree_close(t); + } } num_all_bytes = qpkg_clean_dir(dirp, vdb);