Skip to content

Commit

Permalink
Merge branch 'release/0.85'
Browse files Browse the repository at this point in the history
  • Loading branch information
gugod committed Dec 15, 2018
2 parents a401990 + d826118 commit 8b70370
Show file tree
Hide file tree
Showing 54 changed files with 4,742 additions and 869 deletions.
22 changes: 22 additions & 0 deletions .circleci/config.yml
@@ -0,0 +1,22 @@
version: 2
jobs:
criticism:
docker:
- image: gugod/perlcritic:latest
steps:
- checkout
- run: perlcritic --profile .perlcriticrc t lib script
test:
docker:
- image: perl:5.28
steps:
- checkout
- run: perl -V
- run: cpanm --notest Test2::Harness; cpanm --notest --installdeps .
- run: yath
workflows:
version: 2
test_and_critic:
jobs:
- criticism
- test
5 changes: 5 additions & 0 deletions .perlcriticrc
@@ -0,0 +1,5 @@
color = 0
verbose = %f:%l:%c:[%p] %m => %r\n

only = 1
include = RequireUseStrict ProhibitUnused
1 change: 0 additions & 1 deletion .shipit

This file was deleted.

1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -2,6 +2,7 @@ sudo: false
language: perl
perl:
- "blead" # allow failure on blead but this could help detect regression from p5p
- "5.28"
- "5.26"
- "5.24"
- "5.22"
Expand Down
13 changes: 6 additions & 7 deletions README.hacking.md → CONTRIBUTING.md
Expand Up @@ -4,16 +4,15 @@ perlbrew is open for anyone who are willing to contribute. Here's what you do to
get your work released:

- Fork the repository on github
- Modify lib/App/perlbrew.pm or bin/perlbrew, if necessary,
- Modify `lib/App/perlbrew.pm` or `script/perlbrew` if necessary.
- Add tests so others do not break your feature.
- Send a pull request to @gugod and make an offer that he cannot reject (optional :-)

Notice that the "master" branch is a stable branch, while the "develop" branch
is the target for pull requests. The master branch should only be forwarded on
every CPAN release and a there should also be a git tag for that, which is the
part only @gugod has to worry about. It is suggested, but not required, that you
create your own topic branch first and work on the feature, this way it makes it
a little bit easier when there are conflicts.
Notice that the "master" branch is a stable branch, while the "develop" branch is the default target
for pull requests. The master branch should only be moved forward on CPAN releasees and a there
should also be a corresponding git tag for each release, which is the part only @gugod has to worry
about. It is suggested, but not required, that you create your own topic branch first and work on
the feature, this way it makes it a little bit easier when there are conflicts.

Last, DO NOT edit the `./perlbrew` file directly, it is a standalone executable
built with `dev-bin/build.sh`.
Expand Down
10 changes: 8 additions & 2 deletions Changes
@@ -1,8 +1,14 @@
0.85
- Released at 2018-12-15T23:24:15+0900
- Thanks to our contributors: Branislav Zahradník, Guido Flohr, Joelle Maslak, Luca Ferrari, rage311
- Fix the behaviour of 'clone-modules'
- Various internal refactoring

0.84
- Released at 2018-06-24T08:26:14+0900
- Thanks to our contributors: Joelle Maslak
- Unbreak 'available' command after some updates from cpan.org web site.
- Unbreak the installation -- which missed "perlbrew" command due to a mistake when using mbtiny.
- Unbreak 'available' command after some updates from cpan.org web site.
- Unbreak the installation -- which missed "perlbrew" command due to a mistake when using mbtiny.

0.83
- Released at 2018-05-30T08:04:43+0900
Expand Down
2 changes: 1 addition & 1 deletion README
Expand Up @@ -142,7 +142,7 @@ AUTHOR

COPYRIGHT

Copyright (c) 2010-2017 Kang-min Liu <gugod@gugod.org>.
Copyright (c) 2010- Kang-min Liu <gugod@gugod.org>.

LICENCE

Expand Down
59 changes: 27 additions & 32 deletions README.md
@@ -1,55 +1,50 @@
# NAME

[App::perlbrew](https://metacpan.org/pod/App::perlbrew) - Manage perl installations in your `$HOME`
App::perlbrew - Manage perl installations in your `$HOME`

## SYNOPSIS

```bash
# Installation
curl -L https://install.perlbrew.pl | bash

# Initialize
perlbrew init
# Installation
curl -L https://install.perlbrew.pl | bash

# See what is available
perlbrew available
# Initialize
perlbrew init

# Install some Perls
perlbrew install 5.18.2
perlbrew install perl-5.8.1
perlbrew install perl-5.19.9
# See what is available
perlbrew available

# Install with thread support
perlbrew install -v perl-5.18.2 -Dusethreads
# Install some Perls
perlbrew install 5.18.2
perlbrew install perl-5.8.1
perlbrew install perl-5.19.9

# See what were installed
perlbrew list
# See what were installed
perlbrew list

# Switch to an installation and set it as default
perlbrew switch perl-5.18.2
# Swith to an installation and set it as default
perlbrew switch perl-5.18.2

# Temporarily use another version only in current shell.
perlbrew use perl-5.8.1
perl -v
# Temporarily use another version only in current shell.
perlbrew use perl-5.8.1
perl -v

# Or turn it off completely. Useful when you messed up too deep.
# Or want to go back to the system Perl.
perlbrew off
# Or turn it off completely. Useful when you messed up too deep.
# Or want to go back to the system Perl.
perlbrew off

# Use 'switch' command to turn it back on.
perlbrew switch perl-5.12.2
# Use 'switch' command to turn it back on.
perlbrew switch perl-5.12.2

# Exec something with all perlbrew-ed perls
perlbrew exec -- perl -E 'say $]'
```
# Exec something with all perlbrew-ed perls
perlbrew exec -- perl -E 'say $]'

## DESCRIPTION

[perlbrew](https://metacpan.org/pod/perlbrew) is a program to automate the building and installation of perl in an
easy way. It provides multiple isolated perl environments, and a mechanism
for you to switch between them.

Everything is installed under `~/perl5/perlbrew`. You then need to include a
Everything are installed unter `~/perl5/perlbrew`. You then need to include a
bashrc/cshrc provided by perlbrew to tweak the PATH for you. You then can
benefit from not having to run `sudo` commands to install
cpan modules because those are installed inside your `HOME` too.
Expand Down Expand Up @@ -146,7 +141,7 @@ Kang-min Liu `<gugod@gugod.org>`

# COPYRIGHT

Copyright (c) 2010-2016 Kang-min Liu `<gugod@gugod.org>`.
Copyright (c) 2010- Kang-min Liu `<gugod@gugod.org>`.

### LICENCE

Expand Down
5 changes: 2 additions & 3 deletions README.releasing.md
Expand Up @@ -4,10 +4,9 @@
2. change version number in App/perlbrew.pm
3. update "Changes" file
4. Run `./dev-bin/build.sh` to build new standalone `perlbrew` executable
5. Run `shipit -n` to make sure no test failures. Fix test failures if any.
5. Run `mbtiny test` to make sure no test failures. Fix test failures if any.
6. Run `git flow release finish <version>`
7. Run `git checkout master`
8. Run `git push; git push --tags`
9. Run `shipit`
9. Run `mbtiny dist` and upload the tarball.
10. Update webpages of release note etc

6 changes: 2 additions & 4 deletions cpanfile
Expand Up @@ -6,14 +6,13 @@ requires 'Pod::Usage' => '1.68';
requires 'File::Temp' => '0.2304';
requires 'JSON::PP' => '0';
requires 'local::lib' => '2.000014';

requires 'ExtUtils::MakeMaker' => '6.86';

on test => sub {
requires 'ExtUtils::MakeMaker' => '6.86';
requires 'File::Temp' => '0.2304';
requires 'File::Which' => '1.21';
requires 'IO::All' => '0.51';
requires 'Path::Class' => '0.33';
requires 'Pod::Markdown' => '2.002';
requires 'Test::Exception' => '0.32';
requires 'Test::More' => '1.001002';
requires 'Test::NoWarnings' => '1.04';
Expand All @@ -26,4 +25,3 @@ on test => sub {
on develop => sub {
requires 'Pod::Markdown' => '2.002';
};

2 changes: 2 additions & 0 deletions dev-bin/build.sh
Expand Up @@ -38,12 +38,14 @@ mkdir -p lib/App
./update-fatlib.pl

cp ../lib/App/perlbrew.pm lib/App/perlbrew.pm
cp -r ../lib/App/Perlbrew lib/App/

export PERL5LIB="lib":$PERL5LIB

cat - <<"EOF" > perlbrew
#!/usr/bin/perl
use strict;
use Config;
BEGIN {
my @oldinc = @INC;
Expand Down
121 changes: 121 additions & 0 deletions lib/App/Perlbrew/Path.pm
@@ -0,0 +1,121 @@

use strict;
use warnings;

package App::Perlbrew::Path;

require File::Basename;
require File::Glob;
require File::Path;

use overload (
'""' => \& stringify,
fallback => 1,
);

sub _joinpath {
for my $entry(@_) {
no warnings 'uninitialized';
die 'Received an undefined entry as a parameter (all parameters are: '. join(', ', @_). ')' unless (defined($entry));
}
return join "/", @_;
}

sub _child {
my ($self, $package, @path) = @_;

$package->new ($self->{path}, @path);
}

sub _children {
my ($self, $package) = @_;

return map $package->new ($_),
File::Glob::bsd_glob ($self->child ("*"))
;
}

sub new {
my ($class, @path) = @_;

bless { path => _joinpath (@path) }, $class;
}

sub basename {
my ($self, $suffix) = @_;

return scalar File::Basename::fileparse ($self, ($suffix) x!! defined $suffix);
}

sub child {
my ($self, @path) = @_;

return $self->_child (__PACKAGE__, @path);
}

sub children {
my ($self) = @_;

return $self->_children (__PACKAGE__);
}

sub dirname {
my ($self) = @_;

return App::Perlbrew::Path->new (File::Basename::dirname ($self));
}

sub mkpath {
my ($self) = @_;
File::Path::mkpath ([$self->stringify], 0, 0777);
return $self;
}

sub readlink {
my ($self) = @_;

my $link = readlink $self->stringify;
$link = __PACKAGE__->new ($link) if defined $link;

return $link;
}

sub rmpath {
my ($self) = @_;
File::Path::rmtree([$self->stringify], 0, 0);
return $self;
}

sub stringify {
my ($self) = @_;

return $self->{path};
}

sub stringify_with_tilde {
my ($self) = @_;
my $path = $self->stringify;
my $home = $ENV{HOME};
$path =~ s!\Q$home/\E!~/! if $home;
return $path;
}

sub symlink {
my ($self, $destination, $force) = @_;
$destination = App::Perlbrew::Path->new ($destination)
unless ref $destination;

CORE::unlink $destination
if $force && (-e $destination || -l $destination);

$destination if CORE::symlink $self, $destination;
}

sub unlink {
my ($self) = @_;

CORE::unlink ($self);
}

1;

32 changes: 32 additions & 0 deletions lib/App/Perlbrew/Path/Installation.pm
@@ -0,0 +1,32 @@

use strict;
use warnings;

package App::Perlbrew::Path::Installation;

require App::Perlbrew::Path;

our @ISA = qw( App::Perlbrew::Path );

sub name {
$_[0]->basename;
}

sub bin {
shift->child (bin => @_);
}

sub man {
shift->child (man => @_);
}

sub perl {
shift->bin ('perl');
}

sub version_file {
shift->child ('.version');
}

1;

0 comments on commit 8b70370

Please sign in to comment.