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 E404D138350 for ; Mon, 2 Mar 2020 21:11:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E95F5E08AD; Mon, 2 Mar 2020 21:11:14 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 D3CB6E08AD for ; Mon, 2 Mar 2020 21:11:14 +0000 (UTC) Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mattst88) by smtp.gentoo.org (Postfix) with ESMTPSA id CD75134F44D for ; Mon, 2 Mar 2020 21:11:13 +0000 (UTC) Received: by mail-il1-f169.google.com with SMTP id b15so806880iln.3 for ; Mon, 02 Mar 2020 13:11:13 -0800 (PST) X-Gm-Message-State: ANhLgQ2gxp4SGUnXsfvhg2uhCcdb9BvUSv9bZAm6fhttF0vyx/aKCjt0 F5WxO/ZsfdgOsNFmkAAVfmOT2EDbKLhtYZxSam0= X-Google-Smtp-Source: ADFU+vske96K1VZwuVlCAHLIQJ8bmuT2AEdWOdYYrtX/6E6O9o3w/yFbWUYNuSyeiBdIapVwo8AAKLL/m7koRGVmvtY= X-Received: by 2002:a92:d8cb:: with SMTP id l11mr1447038ilo.278.1583183471957; Mon, 02 Mar 2020 13:11:11 -0800 (PST) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 References: <20200221052945.972092-1-mattst88@gentoo.org> <20200221052945.972092-2-mattst88@gentoo.org> <35e8635f-2ed1-91e7-2eb8-04ffc04040c3@gentoo.org> In-Reply-To: <35e8635f-2ed1-91e7-2eb8-04ffc04040c3@gentoo.org> From: Matt Turner Date: Mon, 2 Mar 2020 13:11:00 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-portage-dev] [PATCH gentoolkit 2/2] eclean: Add option to delete binpkgs with changed deps To: Zac Medico Cc: gentoo-portage-dev@lists.gentoo.org Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: 59305c95-39e7-4833-8084-8047fb53cb96 X-Archives-Hash: 66c3bdf9a6ff82f3b30d9dc3259fce79 On Sun, Mar 1, 2020 at 10:39 PM Zac Medico wrote: > > On 2/20/20 9:29 PM, Matt Turner wrote: > > @@ -564,7 +577,22 @@ def findPackages( > > > > # Exclude if binpkg exists in the porttree and not --deep > > if not destructive and port_dbapi.cpv_exists(cpv): > > - continue > > + if not options['changed-deps']: > > + continue > > + > > + uselist = bin_dbapi.aux_get(cpv, ['USE'])[0].split() > > + all_equal = True > > + > > + for k in ('RDEPEND', 'PDEPEND'): > > + binpkg_deps = bin_dbapi.aux_get(cpv, [k]) > > + ebuild_deps = port_dbapi.aux_get(cpv, [k]) > > + > > + if not _deps_equal(binpkg_deps, ebuild_deps, cpv.eapi, uselist): > > + all_equal = False > > + break > > + > > + if all_equal: > > + continue > > If all_equal is True, then none of the other filters have an opportunity > to add this package to the dead_binpkgs set. That's not good is it? There are four cases we skip including packages: 1) exclude list, 2) time limit, 3) non-destructive and package still exists (and now optionally runtime deps haven't changed), 4) destructive and package is installed. Cases (3) and (4) are non-overlapping. If none of those cases are true, then we add the package to the dead_binpkgs set. The logic looks right to me. Maybe I'm not understanding. With your other suggestion in place, the code looks like this, which is hopefully clearer. # Exclude if binpkg exists in the porttree and not --deep if not destructive and port_dbapi.cpv_exists(cpv): if not options['changed-deps']: continue keys = ('RDEPEND', 'PDEPEND') binpkg_deps = bin_dbapi.aux_get(cpv, keys) ebuild_deps = port_dbapi.aux_get(cpv, keys) uselist = bin_dbapi.aux_get(cpv, ['USE'])[0].split() if _deps_equal(binpkg_deps, ebuild_deps, cpv.eapi, uselist): continue Unfortunately I don't have any packages with changed-deps at the moment for testing :(