From bcce6c12953024452abee6a5d19be0ddf2f0266b Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Wed, 8 Mar 2017 13:31:14 +0300 Subject: [PATCH 1/5] v2.04 init --- lib/App/Virtualenv.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/App/Virtualenv.pm b/lib/App/Virtualenv.pm index bc8d574..79c3325 100644 --- a/lib/App/Virtualenv.pm +++ b/lib/App/Virtualenv.pm @@ -5,7 +5,7 @@ App::Virtualenv - Perl virtual environment =head1 VERSION -version 2.03 +version 2.04 =head1 ABSTRACT @@ -37,7 +37,7 @@ use Lazy::Utils; BEGIN { require Exporter; - our $VERSION = '2.03'; + our $VERSION = '2.04'; our @ISA = qw(Exporter); our @EXPORT = qw(main run); our @EXPORT_OK = qw(); From b7ea1f2705ee24ac6a96eca74e77f4d4a8bd590c Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Wed, 8 Mar 2017 13:52:17 +0300 Subject: [PATCH 2/5] Script files bug fix for #! /usr/bin/perl --- Changes | 3 +++ lib/App/Virtualenv.pm | 7 ++++--- lib/App/Virtualenv/perl.pl | 6 +++--- lib/App/Virtualenv/sh.pl | 6 +++--- lib/App/Virtualenv/virtualenv.pl | 6 +++--- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Changes b/Changes index b878860..0f94324 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +2.04 2017-03-08 + - Script files bug fix for #! /usr/bin/perl + 2.03 2017-03-06 - Perl v5.10.1 compatibility diff --git a/lib/App/Virtualenv.pm b/lib/App/Virtualenv.pm index 79c3325..80b7741 100644 --- a/lib/App/Virtualenv.pm +++ b/lib/App/Virtualenv.pm @@ -188,11 +188,12 @@ sub create my $pkgPath = dirname(__FILE__); _system("cp -v $pkgPath/Virtualenv/activate $virtualenvPath/bin/activate && chmod 644 $virtualenvPath/bin/activate"); - _system("cp -v $pkgPath/Virtualenv/sh.pl $virtualenvPath/bin/sh.pl && chmod 755 $virtualenvPath/bin/sh.pl"); - _system("cp -v $pkgPath/Virtualenv/perl.pl $virtualenvPath/bin/perl.pl && chmod 755 $virtualenvPath/bin/perl.pl"); - _system("ln -v -s -f perl.pl $virtualenvPath/bin/perl"); _system("cp -v $pkgPath/Virtualenv/virtualenv.pl $virtualenvPath/bin/virtualenv.pl && chmod 755 $virtualenvPath/bin/virtualenv.pl"); _system("ln -v -s -f virtualenv.pl $virtualenvPath/bin/virtualenv"); + _system("cp -v $pkgPath/Virtualenv/sh.pl $virtualenvPath/bin/sh.pl && chmod 755 $virtualenvPath/bin/sh.pl"); + _system("echo \"#! ".shellmeta($Config{perlpath})."\" > $virtualenvPath/bin/perl.pl"); + _system("cat $pkgPath/Virtualenv/perl.pl >> $virtualenvPath/bin/perl.pl && chmod 755 $virtualenvPath/bin/perl.pl"); + _system("ln -v -s -f perl.pl $virtualenvPath/bin/perl"); return $virtualenvPath; } diff --git a/lib/App/Virtualenv/perl.pl b/lib/App/Virtualenv/perl.pl index e288861..0bd6174 100755 --- a/lib/App/Virtualenv/perl.pl +++ b/lib/App/Virtualenv/perl.pl @@ -1,11 +1,11 @@ -#! /usr/bin/perl +#! /usr/bin/env perl =head1 NAME perl.pl - runs Perl language interpreter in Perl virtual environment =head1 VERSION -version 2.03 +version 2.04 =head1 ABSTRACT @@ -23,7 +23,7 @@ =head1 ABSTRACT BEGIN { - our $VERSION = '2.03'; + our $VERSION = '2.04'; } diff --git a/lib/App/Virtualenv/sh.pl b/lib/App/Virtualenv/sh.pl index 894e1d2..a078df9 100755 --- a/lib/App/Virtualenv/sh.pl +++ b/lib/App/Virtualenv/sh.pl @@ -1,11 +1,11 @@ -#! /usr/bin/perl +#! /usr/bin/env perl =head1 NAME sh.pl - runs Unix shell in Perl virtual environment =head1 VERSION -version 2.03 +version 2.04 =head1 ABSTRACT @@ -23,7 +23,7 @@ =head1 ABSTRACT BEGIN { - our $VERSION = '2.03'; + our $VERSION = '2.04'; } diff --git a/lib/App/Virtualenv/virtualenv.pl b/lib/App/Virtualenv/virtualenv.pl index 3386c72..eccc741 100755 --- a/lib/App/Virtualenv/virtualenv.pl +++ b/lib/App/Virtualenv/virtualenv.pl @@ -1,11 +1,11 @@ -#! /usr/bin/perl +#! /usr/bin/env perl =head1 NAME virtualenv.pl - manages Perl virtual environment =head1 VERSION -version 2.03 +version 2.04 =head1 ABSTRACT @@ -55,7 +55,7 @@ =head2 deactivate BEGIN { - our $VERSION = '2.03'; + our $VERSION = '2.04'; } From 20b98ea4a9ca2b05ede7571a60926b8106ffb948 Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Wed, 8 Mar 2017 14:14:04 +0300 Subject: [PATCH 3/5] Added prompt support for csh like PS1 in bash --- Changes | 1 + README | 2 +- README.md | 2 +- dev/dist.pl | 2 +- dev/test.pl | 2 +- lib/App/Virtualenv.pm | 8 +++++++- lib/App/Virtualenv/perl.pl | 6 +++++- lib/App/Virtualenv/sh.pl | 6 +++++- lib/App/Virtualenv/virtualenv.pl | 26 +++++++++++++++++++++++--- 9 files changed, 45 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index 0f94324..4edfe9b 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ 2.04 2017-03-08 - Script files bug fix for #! /usr/bin/perl + - Added prompt support for csh like PS1 in bash 2.03 2017-03-06 - Perl v5.10.1 compatibility diff --git a/README b/README index fb0ad23..3a23cd1 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME App::Virtualenv - Perl virtual environment VERSION - version 2.03 + version 2.04 ABSTRACT Perl virtual environment diff --git a/README.md b/README.md index 169652c..a1f3b66 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ App::Virtualenv - Perl virtual environment # VERSION -version 2.03 +version 2.04 # ABSTRACT diff --git a/dev/dist.pl b/dev/dist.pl index 5d3e980..5b163ab 100755 --- a/dev/dist.pl +++ b/dev/dist.pl @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#!/usr/bin/env perl =head1 NAME dist.pl - distribution generator diff --git a/dev/test.pl b/dev/test.pl index 4cb2551..26d1a85 100755 --- a/dev/test.pl +++ b/dev/test.pl @@ -1,4 +1,4 @@ -#! /usr/bin/perl +#!/usr/bin/env perl =head1 NAME test.pl - for internal tests diff --git a/lib/App/Virtualenv.pm b/lib/App/Virtualenv.pm index 80b7741..805f581 100644 --- a/lib/App/Virtualenv.pm +++ b/lib/App/Virtualenv.pm @@ -114,6 +114,9 @@ sub activate $ENV{_OLD_PERL_VIRTUAL_PS1} = $ENV{PS1}; $ENV{PS1} = "(".basename($virtualenvPath).") ".((defined $ENV{PS1})? $ENV{PS1}: ""); + $ENV{_OLD_PERL_VIRTUAL_prompt} = $ENV{prompt}; + $ENV{prompt} = "(".basename($virtualenvPath).") ".((defined $ENV{prompt})? $ENV{prompt}: ""); + return $virtualenvPath; } @@ -153,6 +156,9 @@ sub deactivate $ENV{PS1} = $ENV{_OLD_PERL_VIRTUAL_PS1} if defined($ENV{_OLD_PERL_VIRTUAL_PS1}) or not $nondestructive; undef $ENV{_OLD_PERL_VIRTUAL_PS1}; + $ENV{prompt} = $ENV{_OLD_PERL_VIRTUAL_prompt} if defined($ENV{_OLD_PERL_VIRTUAL_prompt}) or not $nondestructive; + undef $ENV{_OLD_PERL_VIRTUAL_prompt}; + return 1; } @@ -191,7 +197,7 @@ sub create _system("cp -v $pkgPath/Virtualenv/virtualenv.pl $virtualenvPath/bin/virtualenv.pl && chmod 755 $virtualenvPath/bin/virtualenv.pl"); _system("ln -v -s -f virtualenv.pl $virtualenvPath/bin/virtualenv"); _system("cp -v $pkgPath/Virtualenv/sh.pl $virtualenvPath/bin/sh.pl && chmod 755 $virtualenvPath/bin/sh.pl"); - _system("echo \"#! ".shellmeta($Config{perlpath})."\" > $virtualenvPath/bin/perl.pl"); + _system("echo \"#!".shellmeta($Config{perlpath})."\" > $virtualenvPath/bin/perl.pl"); _system("cat $pkgPath/Virtualenv/perl.pl >> $virtualenvPath/bin/perl.pl && chmod 755 $virtualenvPath/bin/perl.pl"); _system("ln -v -s -f perl.pl $virtualenvPath/bin/perl"); diff --git a/lib/App/Virtualenv/perl.pl b/lib/App/Virtualenv/perl.pl index 0bd6174..1302718 100755 --- a/lib/App/Virtualenv/perl.pl +++ b/lib/App/Virtualenv/perl.pl @@ -1,4 +1,4 @@ -#! /usr/bin/env perl +#!/usr/bin/env perl =head1 NAME perl.pl - runs Perl language interpreter in Perl virtual environment @@ -11,8 +11,12 @@ =head1 ABSTRACT runs Perl language interpreter in Perl virtual environment +=over + [I/bin/]B [I]... +=back + =cut use strict; use warnings; diff --git a/lib/App/Virtualenv/sh.pl b/lib/App/Virtualenv/sh.pl index a078df9..e5a5f96 100755 --- a/lib/App/Virtualenv/sh.pl +++ b/lib/App/Virtualenv/sh.pl @@ -1,4 +1,4 @@ -#! /usr/bin/env perl +#!/usr/bin/env perl =head1 NAME sh.pl - runs Unix shell in Perl virtual environment @@ -11,8 +11,12 @@ =head1 ABSTRACT runs Unix shell in Perl virtual environment +=over + [I/bin/]B [I]... +=back + =cut use strict; use warnings; diff --git a/lib/App/Virtualenv/virtualenv.pl b/lib/App/Virtualenv/virtualenv.pl index eccc741..c6e0c1c 100755 --- a/lib/App/Virtualenv/virtualenv.pl +++ b/lib/App/Virtualenv/virtualenv.pl @@ -1,4 +1,4 @@ -#! /usr/bin/env perl +#!/usr/bin/env perl =head1 NAME virtualenv.pl - manages Perl virtual environment @@ -25,9 +25,29 @@ =head1 ABSTRACT =back +=head2 sh.pl + +runs Unix shell in Perl virtual environment + +=over + +[I/bin/]B [I]... + +=back + +=head2 perl.pl + +runs Perl language interpreter in Perl virtual environment + +=over + +[I/bin/]B [I]... + +=back + =head2 activate -activates Perl virtual environment +activates Perl virtual environment (Bash only) =over @@ -37,7 +57,7 @@ =head2 activate =head2 deactivate -deactivates activated Perl virtual environment +deactivates activated Perl virtual environment (Bash only) =over From 7d023e14430506587c8d386a5e13d24d201c79dc Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Wed, 8 Mar 2017 14:45:57 +0300 Subject: [PATCH 4/5] removed: Added prompt support for csh like PS1 in bash --- Changes | 1 - lib/App/Virtualenv.pm | 6 ------ lib/App/Virtualenv/virtualenv.pl | 24 ++++++++++++------------ 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/Changes b/Changes index 4edfe9b..0f94324 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,5 @@ 2.04 2017-03-08 - Script files bug fix for #! /usr/bin/perl - - Added prompt support for csh like PS1 in bash 2.03 2017-03-06 - Perl v5.10.1 compatibility diff --git a/lib/App/Virtualenv.pm b/lib/App/Virtualenv.pm index 805f581..6d69b9b 100644 --- a/lib/App/Virtualenv.pm +++ b/lib/App/Virtualenv.pm @@ -114,9 +114,6 @@ sub activate $ENV{_OLD_PERL_VIRTUAL_PS1} = $ENV{PS1}; $ENV{PS1} = "(".basename($virtualenvPath).") ".((defined $ENV{PS1})? $ENV{PS1}: ""); - $ENV{_OLD_PERL_VIRTUAL_prompt} = $ENV{prompt}; - $ENV{prompt} = "(".basename($virtualenvPath).") ".((defined $ENV{prompt})? $ENV{prompt}: ""); - return $virtualenvPath; } @@ -156,9 +153,6 @@ sub deactivate $ENV{PS1} = $ENV{_OLD_PERL_VIRTUAL_PS1} if defined($ENV{_OLD_PERL_VIRTUAL_PS1}) or not $nondestructive; undef $ENV{_OLD_PERL_VIRTUAL_PS1}; - $ENV{prompt} = $ENV{_OLD_PERL_VIRTUAL_prompt} if defined($ENV{_OLD_PERL_VIRTUAL_prompt}) or not $nondestructive; - undef $ENV{_OLD_PERL_VIRTUAL_prompt}; - return 1; } diff --git a/lib/App/Virtualenv/virtualenv.pl b/lib/App/Virtualenv/virtualenv.pl index c6e0c1c..3822a0d 100755 --- a/lib/App/Virtualenv/virtualenv.pl +++ b/lib/App/Virtualenv/virtualenv.pl @@ -25,43 +25,43 @@ =head1 ABSTRACT =back -=head2 sh.pl +=head2 activate -runs Unix shell in Perl virtual environment +activates Perl virtual environment (Bash only) =over -[I/bin/]B [I]... +source I/bin/B =back -=head2 perl.pl +=head2 deactivate -runs Perl language interpreter in Perl virtual environment +deactivates activated Perl virtual environment (Bash only) =over -[I/bin/]B [I]... +B =back -=head2 activate +=head2 sh.pl -activates Perl virtual environment (Bash only) +runs Unix shell in Perl virtual environment =over -source I/bin/B +[I/bin/]B [I]... =back -=head2 deactivate +=head2 perl.pl -deactivates activated Perl virtual environment (Bash only) +runs Perl language interpreter in Perl virtual environment =over -B +[I/bin/]B [I]... =back From aacddcfc9eb8496f63d5f7fc5421c8094725632f Mon Sep 17 00:00:00 2001 From: Orkun Karaduman Date: Wed, 8 Mar 2017 14:47:15 +0300 Subject: [PATCH 5/5] Changes --- Changes | 1 + 1 file changed, 1 insertion(+) diff --git a/Changes b/Changes index 0f94324..526a09e 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ 2.04 2017-03-08 - Script files bug fix for #! /usr/bin/perl + - POD changes 2.03 2017-03-06 - Perl v5.10.1 compatibility