Skip to content

kiwiroy/berrybrew

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

berrybrew

The perlbrew for Windows Strawberry Perl!

For a quick-start, jump to the Install and Commands sections.

berrybrew can download, install, remove and manage multiple concurrent versions of Strawberry Perl for Windows. There is no requirement to have Strawberry Perl installed before using berrybrew.

Updating the list of Strawberry Perls available is as simple as running a single command: berrybrew fetch, and works at runtime.

There is extensive documentation available for the berrybrew application, as well as the Berrybrew API. See SEE ALSO for the full list of documentation.

Table of Contents

Install

Git clone
git clone https://github.com/stevieb9/berrybrew
Pre-built zip archive

berrybrew.zip SHA1: 4ac8fcab1ff940395879e8963f7fe62a426ef2e1

You can also Compile your own installation.

See Configure Root Directory if you wish to change the default location that your Perl installations will reside, before running the actual installation commands below.

cd berrybrew
bin\berrybrew.exe config

Uninstall

First run the berrybrew unconfig command which removes the PATH environment variables for any in-use Perl installation, and then removes berrybrew from the PATH as well.

If you wish to delete the actual installation:

  • remove the C:\berrybrew directory which contains the installation, perl installations and all configuration and temporary data
  • remove the original download directory

Commands

berrybrew <command> [subcommand] [option]

    available      List available Strawberry Perl versions and which are installed
    list           List the version numbers of all installed Perls
    config         Add berrybrew to your PATH
    clean *        Remove all temporary berrybrew files
    clone          Clones an installed version to a custom-named one
    fetch *        Upgrade the list of Strawberry Perl instances available
    install        Download, extract and install a Strawberry Perl
    modules *      Export and import a module list from one Perl to install on another
    register       Manually register a custom installation directory
    remove         Uninstall a Strawberry Perl
    switch         Switch to use a different Strawberry Perl
    off            Disable berrybrew perls (use 'switch' to re-enable)
    exec *         Run a command for every installed Strawberry Perl
    unconfig       Remove berrybrew from PATH
    upgrade        Backs up config, does a `git pull`, and restores config
    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'

Examples

List all versions of Perl that are available, installed, and currently used:

> berrybrew available

The following Strawberry Perls are available:

    5.28.0_64
    5.28.0_64_PDL
    5.28.0_32
    5.26.2_64
    5.26.2_64_PDL
    5.26.2_32
    5.24.4_64
    5.24.4_64_PDL
    5.24.4_32
    5.22.3_64
    5.22.3_64_PDL
    5.22.3_32
    5.20.3_64
    5.20.3_64_PDL
    5.20.3_32
    5.18.4_64
    5.18.4_32
    5.16.3_64
    5.16.3_32
    5.14.4_64
    5.14.4_32
    5.12.3_64
    5.12.3_32
    5.10.1_32       [installed]
    5.8.9_32
    5.24.1_64       [custom] [installed] *

* Currently using

List all currently installed versions of Perl:

> berrybrew list

    5.28.0_64
    5.26.2_64
    5.10.1_32

Install a specific version:

> berrybrew install 5.28.0_64

Switch to a different version (permanently):

> berrybrew switch 5.28.0_64

Switched to 5.28.0_64, start a new terminal to use it.

Start a new cmd.exe to use the new version:

> perl -v

This is perl 5, version 28, subversion 0 (v5.28.0) built for MSWin32-x64-multi-thread

...       

Clone an installed instance (very useful for setting up a main instance, and cloning it into an instance named "template")

> berrybrew clone 5.28.0_64 template

Uninstall a version of perl:

> berrybrew remove 5.28.0_64

Successfully removed Strawberry Perl 5.28.0_64

Manually register a custom directory within the Perl installation directory

> berrybrew register my_custom_install

Disable berrybrew entirely, and return to system Perl (Strawberry or ActiveState), if available (re-enable with 'switch'):

> berrybrew off

Temporarily use a selected version:

> berrybrew use 5.10.1_32

Temporarily use a Perl version, but spawn in a new command window:

> berrybrew use --win 5.10.1_32

Temporarily spawn several versions, all in new windows:

> berrybrew use --win 5.10.1_32,5.24.2_64,5.28.0_64

Execute something across all perls (we do not execute on Perls that has 'tmpl' or 'template' in the name):

> berrybrew exec prove -l

Perl-5.28.0_64
==============
t\DidYouMean.t .. ok
All tests successful.
Files=1, Tests=5,  0 wallclock secs ( 0.06 usr +  0.00 sys =  0.06 CPU)
Result: PASS

Perl-5.22.3_32
==============
t\DidYouMean.t .. ok
All tests successful.
Files=1, Tests=5,  0 wallclock secs ( 0.03 usr +  0.03 sys =  0.06 CPU)
Result: PASS

Perl-5.18.4_64
==============
t\DidYouMean.t ..
Dubious, test returned 5 (wstat 1280, 0x500)
Failed 5/5 subtests

Test Summary Report
-------------------
t\DidYouMean.t (Wstat: 1280 Tests: 5 Failed: 5)
  Failed tests:  1-5
  Non-zero exit status: 5
Files=1, Tests=5,  0 wallclock secs ( 0.02 usr +  0.05 sys =  0.06 CPU)
Result: FAIL

Execute on only a selection of installed versions:

> berrybrew exec --with 5.28.0_64,5.10.1_32 perl -e die()

Perl-5.28.0_64
==============
Died at -e line 1.

Perl-5.10.1_32
==============
Died at -e line 1.

Upgrade:

> berrybrew upgrade

Remove berrybrew from PATH (useful for switching between versions of berrybrew):

> berrybrew unconfig

Upgrading

Easiest way is to use berrybrew upgrade. This requires Git to be installed and in your PATH. It will create a backup_timestamp directory and copy your configuration files into it.

After completion, it'll copy your perls_custom.json file back into the data/ directory. The rest of the configuration JSON files will be replaced. If you had any customizations within any of the other configuration files, you'll need to manually merge those changes back into the updated config file in data/.

Doing a straight git pull will overwrite your configuration files, so back them up first (see Caveats).

Update Perls Available

Use berrybrew fetch to retrieve the most recent availability list from Strawberry Perl. If any new or changed versions are found, we'll update the local perls.json file with them.

If you supply the all subcommand to berrybrew fetch, we will load all available Perls that Strawberry has to offer.

Cloning Modules

Currently, this is a two-phase operation, and is in beta. Here's the procedure. first, berrybrew switch to the Perl instance you want to export the module list for, and:

> berrybrew modules export

Then, berrybrew switch to the Perl instance you want to import the exported modules into. You'll need to close and reopen a new command window, as always.

Then, the following command will display a list of all exported module files from any/all Perl instances you've done an export from:

> berrybrew modules import

re-run the command with one of the following options:

5.16.3_64    

In my case here, I've only got one export, from a 5.16.3_64 Perl instance. Use it (I'm currently on 5.20.3_64):

> berrybrew modules import 5.16.3_64

NOTE: It is best to export from an older Perl and install on a newer one, as it can take a significant amount of time to re-install ALL exported modules.

NOTE: You can edit the module export file (by default in C:\berrybrew\modules\). Each export file has the name of the Perl it was exported from. Just add and/or remove any entries you'd like. You can even create the files manually by hand so you have a custom, ready made template for all new Perl installs. There is no limit on naming convention, so you can literally manually create a file called base_modules_template for example.

Configure Root Directory

By default, we manage Perls out of the C:\berrybrew directory. To change this, modify the root_dir value in the data\config.json file. Use double-backslashes (\\) as the path separators.

WARNING: At this time, it is highly advised not to change this after you've already installed any instances of Perl. This feature is incomplete, and PATH and other things don't get properly reset yet. If you choose to ignore this, follow this procedure:

  • run berrybrew off, to flush the PATH environment variables

  • edit the configuration file to reflect the new directory

  • move all Perl installations from the old path to the new one

  • remove the old directory

  • run berrybrew switch $version to set things back up

Requirements

  • .Net Framework 2.0 or higher

  • Windows only!

  • Mono or Visual Studio (only if compiling your own version)

Troubleshooting

If you run into trouble installing a Perl, try clearing the berrybrew cached downloads by running berrybrew clean.

You can also enable debugging to get more verbose output on the command line:

berrybrew debug <command> [options] 

SEE ALSO

CAVEATS

  • When using git pull to do an upgrade, your configuration files will be overwritten with the defaults. If you have any customizations, make a backup of the data directory before upgrade, then copy the files back to their original location. Note that you may have to manually add any new config directives into the original config files. The perls_custom.json file used for custom Perl installations (clones) will never be overwritten, and this warning does not apply for it.

  • At this time, berrybrew requires Administrative privileges to operate correctly. This is due to the way Windows forces the System PATH to take precedence over User PATH.

Developed Using

Software Description Notes
Jetbrains Rider .Net IDE Thanks to their Open Source Licensing
Jetbrains intelliJ IDEA IDE for Perl coding Freely available, also comes with the open source license
Camelcade Perl5 Plugin Perl5 Plugin for intelliJ IDEA
Devel::Camelcadedb Adds Perl5 debug support for intelliJ IDEA
Mono Open Source .Net Framework
Mono C# Compiler C# Open Source C# Compiler

License

2 Clause FreeBSD - see LICENSE

Version

1.23

Undocumented Features

There are certain features that should only be used by developers and maintainers of this software. There's only one currently, so if I create more and/or make them more complex, I'll create a separate document for them.

test

This feature should only be used by developers of berrybrew.

Like the debug feature, I've added a new test argument. It must follow berrybrew and preceed all further operations. To include the debug argument as well, specify it first, then include test, then your command and any options:

Examples:

  • Test feature only:

    berrybrew test clean ...

  • Test and Debug:

    berrybrew debug test clean ...

Currently, it's only used in the t/99_clean.t test to strip off unneeded path elements for a couple of specific tests.

currentperl

This feature simply fetches the Perl instance that's currently in use, prints out its name, and exits.

Used primarily for certain unit tests.

Original Author

David Farrell [http://perltricks.com]

This Fork Maintained By

Steve Bertrand steveb<>cpan.org

See Also

  • StrawberryPerl - Strawberry Perl for Windows

  • Perlbrew - the original Perl version manager for Unix based systems.

About

Perlbrew for Windows!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 68.2%
  • Perl 28.7%
  • Batchfile 3.1%