Coder Social home page Coder Social logo

Comments (7)

kentfredric avatar kentfredric commented on July 17, 2024

( Obviously neither number is perfect on its own, but having a high-water and a low-water mark can greatly accelerate working out the bulk of the most important values )

from gentoo-scripts.

mm1ke avatar mm1ke commented on July 17, 2024

This shouldn't be to difficult to implement. You're are right, i'm using git log to calculate the age and thanks to git it's really easy to add that information.
Is it ok for you to add another 2 columns, something like that:

5|01826|00356|7|00121|00013|-|dev-perl/CPAN-Changes|CPAN-Changes-0.400.2(2015-09-07)|CPAN-Changes-0.400.2-r1(2020-05-08)|[email protected]

The third column would represent the days since last modification for the old ebuild.
The sixt column would represent the days since last modification for the new ebuild.

from gentoo-scripts.

kentfredric avatar kentfredric commented on July 17, 2024

Is it ok for you to add another 2 columns, something like that:

Yeah, my internal "map columns to fields" is flexible, designed in mind with the assumption keys may change or key orders might change.

    for my $line (@lines) {
        my %rec;
        @rec{
            qw(old_eapi old_age new_eapi new_age has_bugs cat_pn old_ebuild new_ebuild maintainers junk)
        } = split /\|/, $line;
        @rec{qw(cat pn)} = split q[/], $rec{cat_pn};
        $rec{maintainers} = [ split /:/, $rec{maintainers} ];

        for (qw( old new )) {
            my $ebuild = delete $rec{ $_ . '_ebuild' };
            $ebuild =~ /\A(.*?)\(([^)]+)\)\z/;
            $rec{$_} = {
                eapi   => delete $rec{ $_ . '_eapi' },
                age    => delete $rec{ $_ . '_age' },
                ebuild => "$1",
                date   => "$2",
            };

            if ( $rec{$_}->{ebuild} =~ /\A\Q$rec{pn}\E-(.*?)\z/ ) {
                $rec{$_}->{version} = "$1";
            }
        }
        $rec{age_gap} = $rec{old}->{age} - $rec{new}->{age};
        push @recs, \%rec;
    }

from gentoo-scripts.

mm1ke avatar mm1ke commented on July 17, 2024

Well, after toying around a bit I realized it's not so easy to update the script after all.

The problem is not to get the value, but it's more like a performance issue. I already cheat a bit with the current script to calculate the age of the ebuilds (this is why i include the date in brackets - it's easier to calculate the age with that date instead of calculating it each day with git log, which is unfortunately quite slow...

There are now a few possibilities how to improve that. But before working around to get a solution i'll prefer to improve the script as a whole. I already have something in my mind, but i need a bit more time to work out the changes.

Also, since i was mentioned the date in the brackets - do you actually need this? As i said this is rather a hack to improve the calculations and if possible i would get rid of it. However in case you need them i could keep them.

I'll keep you updated.

from gentoo-scripts.

kentfredric avatar kentfredric commented on July 17, 2024

I don't need them as such, just the formatting as-is enticed me into parsing it out and putting it in its own field :)

Having the actual dates is helpful, because sometimes the relative dates aren't so obvious, but logically, if you can calculate the age, then you can calculate the date from that, as long as you know what "now" is. ( Though obviously, "now" is not "now", but "when the data was last calculated" )

from gentoo-scripts.

mm1ke avatar mm1ke commented on July 17, 2024

Ok, i finally could update my script. The output now look something like this:

5|01549|00160|7|00004|-----|-|dev-perl/File-Tempdir|File-Tempdir-0.20.0-r1|File-Tempdir-0.20.0-r2|[email protected]
5|01549|00160|7|00003|-----|-|dev-perl/File-Type|File-Type-0.220.0-r1|File-Type-0.220.0-r2|[email protected]
5|01549|01290|7|00330|00275|+|dev-perl/Fuse|Fuse-0.16.1|Fuse-0.16.1-r1|[email protected]
5|01549|00275|7|00013|-----|-|dev-perl/PerlIO-Layers|PerlIO-Layers-0.11.0|PerlIO-Layers-0.11.0-r1|[email protected]:[email protected]
5|01549|00213|6|00974|00504|+|dev-perl/Sys-CPU|Sys-CPU-0.610.0|Sys-CPU-0.610.0-r1|[email protected]
5|01549|00160|6|00422|-----|-|dev-perl/Tk-CursorControl|Tk-CursorControl-0.400.0-r1|Tk-CursorControl-0.400.0-r3|[email protected]
5|01549|00160|6|00906|00169|+|dev-perl/Unicode-Map8|Unicode-Map8-0.130.0|Unicode-Map8-0.130.0-r1|[email protected]
5|01549|00160|6|00898|00169|+|dev-perl/X11-Protocol|X11-Protocol-0.560.0-r1|X11-Protocol-0.560.0-r2|[email protected]

This should be live tomorrow. Also, ----- means that this ebuild wasn't modified yet. If there some changes you would like to have, please let me know. Also, as mentioned, i removed the date in the brackets but could be added again anytime.
I hope this helps you.

from gentoo-scripts.

mm1ke avatar mm1ke commented on July 17, 2024

I'm going to close this, please open another issue if you need some other changes.

from gentoo-scripts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.