public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Matt Turner <mattst88@gentoo.org>
To: Zac Medico <zmedico@gentoo.org>
Cc: gentoo-portage-dev@lists.gentoo.org
Subject: Re: [gentoo-portage-dev] [PATCH gentoolkit 2/2] eclean: Add option to delete binpkgs with changed deps
Date: Fri, 6 Mar 2020 22:10:31 -0800	[thread overview]
Message-ID: <CAEdQ38Hg9+wna7RTrC5=wisoCb7Vb0mNtcovAO_Gvqd_rNyiHg@mail.gmail.com> (raw)
In-Reply-To: <b5c7ca65-2b86-42e7-d77d-0245d460e1e2@gentoo.org>

On Mon, Mar 2, 2020 at 9:15 PM Zac Medico <zmedico@gentoo.org> wrote:
>
> On 3/2/20 1:11 PM, Matt Turner wrote:
> > On Sun, Mar 1, 2020 at 10:39 PM Zac Medico <zmedico@gentoo.org> 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.
>
> What I imagine is that you could have some old packages that you
> probably want to delete because they're so old, even though their deps
> have not changed. Meanwhile you have some packages that are
> relatively recent and you'd like to delete them if they have changed deps.
>
> Given the current logic, I guess you'd have to do separate passes, one
> to delete packages based on age and another to delete packages based on
> changed deps. Maybe it's fine to require separate passes for this kind
> of thing. I supposed the alternative would be to add an --or flag that
> would allow you to say that you want to delete packages if they are at
> least a certain age or they have changed deps.

Oh, I think I understand now.

I was confused about this. I expected that --time-limit=2w to mean
that eclean should delete everything older than two weeks, but it's
actually the opposite, more or less. It actually means to *keep*
everything with less than two weeks old. Surprised me...

>  -t, --time-limit=<time>   - don't delete files modified since <time>

So, with that surprising behavior I think my patch is doing the right
thing, but with the wrong comment. I'll fix those and send v2 patches
with the tabs restored, etc.

Thanks a bunch for the review.


  reply	other threads:[~2020-03-07  6:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21  5:29 [gentoo-portage-dev] [PATCH gentoolkit 1/2] eclean: Rewrite findPackages() Matt Turner
2020-02-21  5:29 ` [gentoo-portage-dev] [PATCH gentoolkit 2/2] eclean: Add option to delete binpkgs with changed deps Matt Turner
2020-03-02  6:32   ` Zac Medico
2020-03-02 20:40     ` Matt Turner
2020-03-02 21:02       ` Matt Turner
2020-03-03  3:38         ` Zac Medico
2020-03-02  6:39   ` Zac Medico
2020-03-02 21:11     ` Matt Turner
2020-03-03  5:15       ` Zac Medico
2020-03-07  6:10         ` Matt Turner [this message]
2020-02-21  5:34 ` [gentoo-portage-dev] Re: [PATCH gentoolkit 1/2] eclean: Rewrite findPackages() Matt Turner
2020-02-21  5:36 ` [gentoo-portage-dev] " Michael 'veremitz' Everitt
2020-03-02  6:25   ` Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEdQ38Hg9+wna7RTrC5=wisoCb7Vb0mNtcovAO_Gvqd_rNyiHg@mail.gmail.com' \
    --to=mattst88@gentoo.org \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    --cc=zmedico@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox