The Windows Strawberry Perl version manager - written in C#
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
data
dev
doc
download
inc
src
t
.gitignore
CONTRIBUTING.md
Changes
LICENSE
README.md

README.md

berrybrew

The perlbrew for Windows Strawberry Perl!

For a quick-start, jump to the Installation and Configuration 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 runing 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

Installation

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

berrybrew.zip SHA1: 62c12e4c9429df1e22405d39ae565dadbac15218

You can also Compile your own installation.

Configuration

See Configure Root Directory if you wish to change the default location that your Perl installations will reside.

cd berrybrew
bin\berrybrew.exe config

Commands

berrybrew <command> [subcommand] [option]

    available   List available Strawberry Perl versions and which are installed
    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
    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'

Synopsis

List all available versions of Perl that are available:

> berrybrew available

The following Strawberry Perls are available:

    5.26.0_64
    5.26.0_64_PDL
    5.26.0_32
    5.24.2_64
    5.24.2_64_PDL
    5.24.2_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_32
    5.10.1_32       [installed]
    5.8.9_32
    5.24.1_64       [custom] [installed] *

* Currently using

Install a specific version:

> berrybrew install 5.26.0_64

Switch to a different version (permanently):

> berrybrew switch 5.26.0_64

Switched to 5.26.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 26, subversion 0 (v5.26.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.26.0_64 template

Uninstall a version of perl:

> berrybrew remove 5.26.0_64

Successfully removed Strawberry Perl 5.26.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.26.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.26.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.26.0_64,5.10.1_32 perl "die()"

Perl-5.26.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.

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

Compile Your Own

git clone https://github.com/stevieb9/berrybrew
cd berrybrew

# compile the API library

mcs \
    -lib:bin \
    -t:library \
    -r:Newtonsoft.Json.dll,ICSharpCode.SharpZipLib.dll \ 
    -out:bin/bbapi.dll \
    src/berrybrew.cs

# compile the berrybrew.exe binary

mcs \
    src/bbconsole.cs
    -lib:bin -r:bbapi.dll \
    -out:bin/berrybrew.exe \
    -win32icon:inc/berrybrew.ico

bin\berrybrew.exe config

Create a Release

If you've modified the information of the configuration files for the new build, you must copy them to the dev\data directory before performing the below steps.

Use the included dev/release.pl script, which:

  • compiles the berrybrew.exe binary and the bbapi.dll API library

  • collects default configuration files

  • builds the bundled zip archive, and puts it into download/

  • performs SHA1 checksum tasks

  • updates the README.md file with the zip archive's new SHA1 sum

If you had any custom configuration files in place, run dev\post_release.pl to restore them.

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.

License

2 Clause FreeBSD - see LICENSE

Version

1.15

Original Author

David Farrell [http://perltricks.com]

This Fork Maintained By

Steve Bertrand steveb<>cpan.org

Updating dnmfarrell berrybrew

git clone https://stevieb9@github.com/dnmfarrell/berrybrew bb-dnm
cd bb-dnm
git remote add stevieb9 https://github.com/stevieb9/berrybrew
git pull stevieb9 master
git push

See Also

  • StrawberryPerl - Strawberry Perl for Windows

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