Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

berrybrew, the perlbrew for Windows, updated to v1.18

by stevieb (Abbot)
on Feb 16, 2018 at 20:31 UTC ( #1209331=perlnews: print w/replies, xml ) Need Help??

I finally got around to doing a decent update to berrybrew.

Notable enhancements:

  • Perls listed with berrybrew available are now listed in numerical, descending version order (again... this was a regression)
  • Added new all subcommand to berrybrew fetch. This allows you to fetch the list of *all* available Strawberry Perls (there's over 100!). Previously, we would only fetch and list the most recent minor version number within each major version. (The standard and existing berrybrew fetch without the new arg doesn't change its previous behaviour)

Important bug fixes:

  • Fixed issue where when using berrybrew fetch and there were orphaned Perls, we weren't auto-registering them as "custom"
  • Fixed issue when a user attempted to register a single custom Perl more than once, it was throwing an exception

As always, if you decide to try it and/or upgrade, please let me know of any issues, or simply open a ticket.

Official Changes log.

c:\repos\berrybrew>berrybrew berrybrew <command> [subcommand] [option] available List available Strawberry Perl versions and which are +installed clean * Remove all temporary berrybrew files clone Make a complete copy of a Perl installation config Add berrybrew to your PATH exec * Run a command for every installed Strawberry Perl fetch * Update the list of Strawberry Perl instances available install Download, extract and install a Strawberry Perl off Disable berrybrew perls (use 'switch' to re-enable) register Manually register a custom installation directory remove Uninstall a Strawberry Perl switch Switch to use a different Strawberry Perl unconfig Remove berrybrew from PATH upgrade Performs a safe upgrade. Requires Git installed use * Use a specific Strawberry Perl version temporarily help Display this help screen license Show berrybrew license version Displays the version * - view subcommand details with 'berrybrew <command> help'

Enjoy!

-stevieb

ps. Thanks again to pryrt for his previous work along side myself, and for reporting both bugs and feature requests!

Update: I even had to break rank and ask for help elsewhere, because berrybrew is written in C#. Needed quick help on how to sort order lets just say an array of hashes, where hashes are keys with values of objects. In Perl, meh, two lines of code. In C#, it's nowhere near as fun.

I put up an SO post for the basics, but even still, that was simple. I still had to muck around and figure out how to sort by value of a key of a List of Dictionaries, where the list is List<Dictionary<string, object>>.

I hacked at that and got it to do what is needed, but I'm certain it isn't ideal by any strech. C, Perl, Python, C++ I can do, but this .Net and C# stuff I need some guidance. Needless to say, if there are any C# people here, the berrybrew project could seriously use your help for some code review, at minimum :D.

Replies are listed 'Best First'.
Re: berrybrew, the perlbrew for Windows, updated to v1.18
by Jenda (Abbot) on Feb 17, 2018 at 01:58 UTC

    So I looked at the C# code and I have a few comments.

     .Select(x => x.Split(new char[] {'.'})) is better written as  .Select(x => x.Split('.')). No need to explicitly construct the array unless you have to pass the count or split options.

    There's no point in splitting the version and then joining it back. Just keep it. Same way as if you used the Schwartzian transform in Perl. The code has to be somewhat more talkative, in part because the IEnumerable (aka list) transformations (.Select() aka map{}, .Where() aka grep{} and so forth) are kinda lazy and sometimes you have to make sure they are applied and the result remembered. And you have to choose the data structure used to remember them.

    This is how I would write the code:

    var sortedPerlVersions = perlVersions .Select(x => new { full = x, parts = x.Split('.').Select(n => Conv +ert.ToInt32(n)).ToArray() }) .OrderBy(x => x.parts[0]).ThenBy(x => x.parts[1]).ThenBy(x => x.pa +rts[2]) .Select(x => x.full) .ToList();

    You do not have to specify all those types. List<int> nameLengths = new List<int>(); is equivalent to var nameLengths = new List<int>(); and it's shorter and easier to modify.

    Same with things like foreach (string perlName in Perls.Keys)

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlnews [id://1209331]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2018-06-24 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?