[Bps-public-commit] rt-extension-resetpassword branch, new-user-create-password, updated. 1.04-11-g3cc4a9e

Jim Brandt jbrandt at bestpractical.com
Wed Mar 4 16:55:05 EST 2020


The branch, new-user-create-password has been updated
       via  3cc4a9e7c063524a6217d357e9abd7adc7490a6e (commit)
       via  8db934a29a189f7d2a703a90394530ed461823b5 (commit)
       via  f697a13a6585467797dbe6335b99df15f65c3fa7 (commit)
       via  1df51d0a863f9bb726c71f38e4e508ead83a0338 (commit)
       via  fb4c7df007c08527c089beaa3b0c5ac43ecb4858 (commit)
       via  f7e0bd34c08279265ef22a09595746a96ba86d2f (commit)
      from  35488a2932f8f9b9c629168ff6feb31915bb77ed (commit)

Summary of changes:
 META.yml                                           |  4 +-
 README                                             | 45 +++++++++--------
 .../Admin/Users/Modify.html/BeforeUpdate           |  9 ++++
 .../Elements/Login/Default                         | 10 ++--
 html/NoAuth/ResetPassword/Request.html             | 11 +++++
 inc/Module/Install.pm                              | 35 +++-----------
 inc/Module/Install/Base.pm                         |  2 +-
 inc/Module/Install/Can.pm                          | 13 ++++-
 inc/Module/Install/Fetch.pm                        |  2 +-
 inc/Module/Install/Include.pm                      |  2 +-
 inc/Module/Install/Makefile.pm                     |  2 +-
 inc/Module/Install/Metadata.pm                     |  2 +-
 inc/Module/Install/RTx.pm                          | 22 ++++++++-
 inc/Module/Install/RTx/Runtime.pm                  |  1 +
 inc/Module/Install/ReadmeFromPod.pm                |  2 +-
 inc/Module/Install/Win32.pm                        |  2 +-
 inc/Module/Install/WriteAll.pm                     |  2 +-
 inc/YAML/Tiny.pm                                   | 14 +++---
 lib/RT/Extension/ResetPassword.pm                  | 56 +++++++++++++---------
 19 files changed, 139 insertions(+), 97 deletions(-)

- Log -----------------------------------------------------------------
commit f7e0bd34c08279265ef22a09595746a96ba86d2f
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Mar 4 15:51:59 2020 -0500

    Move New Account inside the disable check
    
    Users who disable the reset feature likely want to have only
    the admin password option, so hide all self service links
    when disabled.

diff --git a/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default b/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
index cb192b7..fcfacc7 100644
--- a/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
+++ b/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
@@ -1,8 +1,8 @@
 % unless ( RT::Config->Get('DisableResetPasswordOnLogin') ) {
 <div id="lostpassword" class="input-row" style="text-align:right;clear:both;">
   <a href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html?Title=<&|/l&>Reset your password</&>"><&|/l&>Forgot your password</&></a>
-% }
-% if ( RT::Config->Get('CreateNewUserAndSetPassword') ) {
+%   if ( RT::Config->Get('CreateNewUserAndSetPassword') ) {
   | <a href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html?Title=<&|/l&>Create your password</&>"><&|/l&>New account</&></a>
+%   }
 % }
 </div>

commit fb4c7df007c08527c089beaa3b0c5ac43ecb4858
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Mar 4 16:22:38 2020 -0500

    Avoid sending reset email with incorrect token
    
    If the user password is reset by the admin in the same update
    that sends the reset token, the token will be incorrect.

diff --git a/html/Callbacks/RT-Extension-ResetPassword/Admin/Users/Modify.html/BeforeUpdate b/html/Callbacks/RT-Extension-ResetPassword/Admin/Users/Modify.html/BeforeUpdate
index 0ae9094..b1ff0b2 100644
--- a/html/Callbacks/RT-Extension-ResetPassword/Admin/Users/Modify.html/BeforeUpdate
+++ b/html/Callbacks/RT-Extension-ResetPassword/Admin/Users/Modify.html/BeforeUpdate
@@ -1,5 +1,14 @@
 <%INIT>
 if ( ( $ARGS{'SendPasswordResetEmail'} || $session{'SendPasswordResetEmail'} ) && $User && $User->Id ) {
+
+    if ( $ARGS{'Pass1'} or $ARGS{'Pass2'} ) {
+        # If the password is reset and the new password link is sent, the token
+        # won't match, so don't send the email.
+
+        push @{$Results}, 'Password reset email not sent: cannot send password reset email and then reset user password. Resubmit with password fields blank to send password reset email.';
+        return;
+    }
+
     my ($ret, $msg) = RT::Extension::ResetPassword::CreateTokenAndResetPassword($User);
     if ( $ret ) {
         push @{$Results}, 'Password reset email passed to new user';

commit 1df51d0a863f9bb726c71f38e4e508ead83a0338
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Mar 4 16:48:35 2020 -0500

    Show different message on create

diff --git a/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default b/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
index fcfacc7..e208dd9 100644
--- a/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
+++ b/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
@@ -2,7 +2,7 @@
 <div id="lostpassword" class="input-row" style="text-align:right;clear:both;">
   <a href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html?Title=<&|/l&>Reset your password</&>"><&|/l&>Forgot your password</&></a>
 %   if ( RT::Config->Get('CreateNewUserAndSetPassword') ) {
-  | <a href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html?Title=<&|/l&>Create your password</&>"><&|/l&>New account</&></a>
+  | <a href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html?Mode=create"><&|/l&>New account</&></a>
 %   }
 % }
 </div>
diff --git a/html/NoAuth/ResetPassword/Request.html b/html/NoAuth/ResetPassword/Request.html
index 384c6a2..11c90ab 100644
--- a/html/NoAuth/ResetPassword/Request.html
+++ b/html/NoAuth/ResetPassword/Request.html
@@ -49,7 +49,11 @@
 <h1><%$title%></h1>
 <& /Elements/ListActions, actions => \@actions  &>
 <p>
+% if ( $Mode eq 'create' ) {
+<&|/l&>Enter your email address to create a new account.</&>
+% } else {
 <&|/l&>RT can send you an email message with a link that will allow you to reset your password.</&>
+% }
 <form method="post" action="Request.html">
     <&|/l&>Email address</&>:<input name="Email" value="" />
     <input type="submit" class="button" value="<%loc('Send it!')%>" />
@@ -62,6 +66,10 @@ my @actions;
 
 my $title = loc("Reset your password");
 
+if ( $Mode eq 'create' ) {
+    $title = loc("Create account");
+}
+
 if ($ARGS{'Email'}) {
     my $u = RT::User->new($RT::SystemUser);
     $u->LoadByCols(EmailAddress => $ARGS{'Email'});
@@ -136,3 +144,6 @@ if ($ARGS{'Email'}) {
     }
 }
 </%INIT>
+<%ARGS>
+$Mode => 'reset'
+</%ARGS>

commit f697a13a6585467797dbe6335b99df15f65c3fa7
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Mar 4 16:53:39 2020 -0500

    Remove unused Title argument and center content

diff --git a/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default b/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
index e208dd9..58c1c00 100644
--- a/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
+++ b/html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
@@ -1,6 +1,6 @@
 % unless ( RT::Config->Get('DisableResetPasswordOnLogin') ) {
-<div id="lostpassword" class="input-row" style="text-align:right;clear:both;">
-  <a href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html?Title=<&|/l&>Reset your password</&>"><&|/l&>Forgot your password</&></a>
+<div id="lostpassword" class="input-row" style="text-align:center;clear:both;">
+  <a href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html"><&|/l&>Forgot your password</&></a>
 %   if ( RT::Config->Get('CreateNewUserAndSetPassword') ) {
   | <a href="<%$RT::WebPath%>/NoAuth/ResetPassword/Request.html?Mode=create"><&|/l&>New account</&></a>
 %   }

commit 8db934a29a189f7d2a703a90394530ed461823b5
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Mar 4 16:54:29 2020 -0500

    Update documentation

diff --git a/README b/README
index b897e01..5848eed 100644
--- a/README
+++ b/README
@@ -6,10 +6,12 @@ DESCRIPTION
     This extension for RT adds a new "Forgot your password?" link to the
     front of your RT instance. Any user can request that RT send them a
     password reset token by email. RT will send the user a one-time URL
-    which he or she can use to reset her password. This extension allows
-    only users that already have passwords reset their passwords by email.
-    There isn't yet an option to only allow privileged or unpriviliged users
-    to reset their passwords.
+    which he or she can use to reset her password.
+
+    It also adds a new option to the user admin page in RT for the RT admin
+    to send a password reset email for new users or users who have forgotten
+    their passwords. See below for options to enable this admin feature only
+    and disable self-service features.
 
 RT VERSION
     Works with RT 4.0, 4.2, 4.4
@@ -59,15 +61,16 @@ UPGRADING
         { $ENV{'REMOTE_ADDR'} }
 
 CONFIGURATION
-    ** IMPORTANT ** Do not use this extension if you use any form of
-    external auth such as SAML, federated or OAUTH as RT does not have
-    access to reset a password.
+    This extension resets passwords managed by RT. It cannot reset passwords
+    for RTs that use any configured external auth such as SAML, OAuth, LDAP,
+    or Active Directory as RT does not have password reset connections in
+    those external systems.
 
     The contents of the email sent to users can be found in the global
     PasswordReset template (do not confuse this with the core PasswordChange
     template).
 
-    If you want to prevent unauthorised visitors from determining what user
+    If you want to prevent unauthorized visitors from determining what user
     accounts exist and whether they are disabled, set
     HidePasswordResetErrors to 1 in your RT configuration; then any password
     reset request will appear to the requestor to have resulted in an email
@@ -87,10 +90,9 @@ CONFIGURATION
     not set-up correctly as users could see data they should not be able to.
 
     The $CreateNewUserAndSetPassword and $CreateNewUserAsPrivileged config
-    options should only be used when access to the RT web UI is limited to
-    trusted individuals. This usually means access to the web UI is
-    restricted by a company firewall so that only users on the company
-    network can access the UI and create new user records.
+    options should only be used when access to the RT web UI is limited.
+    This usually means access to the web UI is restricted so that only users
+    on the company network can access the UI and create new user records.
 
     $AllowUsersWithoutPassword
         Setting this config option to true will allow existing users who do
@@ -99,21 +101,26 @@ CONFIGURATION
 
     $CreateNewUserAsPrivileged
         Set this config value to true if users creating a new account should
-        default to privileged users. WARNING Setting this to true can be
-        dangerous as it allows anyone to create a new priviledged user,
-        usually privlidged users are given rights to edit and see
-        information not desired to be public.
+        default to privileged users.
+
+        WARNING Setting this to true can be dangerous as it allows anyone to
+        create a new priviledged user. Usually privlidged users are given
+        rights to edit and see information not desired to be public.
 
     $CreateNewUserAndSetPassword
         This configuration option determines if a nonexistant user can
-        create an new user record. WARNING see the note about the danger of
-        setting this to true and setting $CreateNewUserAsPrivileged to true
-        as well.
+        create an new user record.
+
+        WARNING See the note about the danger of setting this to true and
+        setting $CreateNewUserAsPrivileged to true as well.
 
     $DisableResetPasswordOnLogin
         Set this config value to true if you do not want the "forgot
         password" option to display on the login page.
 
+        This is useful if you want only the password reset email option on
+        the RT user admin page, but no self-service options.
+
 AUTHOR
     Best Practical Solutions, LLC <modules at bestpractical.com>
 
diff --git a/lib/RT/Extension/ResetPassword.pm b/lib/RT/Extension/ResetPassword.pm
index aea432e..7d1be60 100644
--- a/lib/RT/Extension/ResetPassword.pm
+++ b/lib/RT/Extension/ResetPassword.pm
@@ -41,10 +41,12 @@ RT::Extension::ResetPassword - add "forgot your password?" link to RT instance
 This extension for RT adds a new "Forgot your password?" link to the front
 of your RT instance. Any user can request that RT send them a password
 reset token by email.  RT will send the user a one-time URL which he or
-she can use to reset her password. This extension allows only users that
-already have passwords reset their passwords by email.
-There isn't yet an option to only allow privileged or unpriviliged users
-to reset their passwords.
+she can use to reset her password.
+
+It also adds a new option to the user admin page in RT for the RT admin
+to send a password reset email for new users or users who have forgotten
+their passwords. See below for options to enable this admin feature only
+and disable self-service features.
 
 =head1 RT VERSION
 
@@ -108,15 +110,16 @@ with this:
 
 =head1 CONFIGURATION
 
-** IMPORTANT **
-Do not use this extension if you use any form of external auth such as
-SAML, federated or OAUTH as RT does not have access to reset a password.
+This extension resets passwords managed by RT. It cannot reset
+passwords for RTs that use any configured external auth such as
+SAML, OAuth, LDAP, or Active Directory as RT does not have
+password reset connections in those external systems.
 
 The contents of the email sent to users can be found in the global
 PasswordReset template (do not confuse this with the core PasswordChange
 template).
 
-If you want to prevent unauthorised visitors from determining what user
+If you want to prevent unauthorized visitors from determining what user
 accounts exist and whether they are disabled, set HidePasswordResetErrors
 to 1 in your RT configuration; then any password reset request will
 appear to the requestor to have resulted in an email being sent, thus
@@ -134,37 +137,46 @@ a password for themselves by setting $AllowUsersWithoutPassword to 1. This can a
 any user to access the RT self service pages. This can be dangerous if the RT rights are
 not set-up correctly as users could see data they should not be able to.
 
-The $CreateNewUserAndSetPassword and $CreateNewUserAsPrivileged config options should only
-be used when access to the RT web UI is limited to trusted individuals. This usually means
-access to the web UI is restricted by a company firewall so that only users on the company
-network can access the UI and create new user records.
+The $CreateNewUserAndSetPassword and $CreateNewUserAsPrivileged config
+options should only be used when access to the RT web UI is limited.
+This usually means access to the web UI is restricted so that only users
+on the company network can access the UI and create new user records.
 
 =over 4
 
 =item C<$AllowUsersWithoutPassword>
 
-Setting this config option to true will allow existing users who do not have a password
-value to send themselves a reset password email and set a password.
+Setting this config option to true will allow existing users who do
+not have a password value to send themselves a reset password email
+and set a password.
 
 =item C<$CreateNewUserAsPrivileged>
 
-Set this config value to true if users creating a new account should default to privileged users.
-WARNING Setting this to true can be dangerous as it allows anyone to create a new priviledged user,
-usually privlidged users are given rights to edit and see information not desired to be public.
+Set this config value to true if users creating a new account should
+default to privileged users.
 
+B<WARNING> Setting this to true can be dangerous as it allows anyone to
+create a new priviledged user. Usually privlidged users are given rights
+to edit and see information not desired to be public.
 
 =item C<$CreateNewUserAndSetPassword>
 
-This configuration option determines if a nonexistant user can create an new user record.
-WARNING see the note about the danger of setting this to true and setting C<$CreateNewUserAsPrivileged>
-to true as well.
+This configuration option determines if a nonexistant user can create an
+new user record.
+
+B<WARNING> See the note about the danger of setting this to true and
+setting C<$CreateNewUserAsPrivileged> to true as well.
 
 =item C<$DisableResetPasswordOnLogin>
 
-Set this config value to true if you do not want the "forgot password" option to display on the login
-page.
+Set this config value to true if you do not want the "forgot password" option
+to display on the login page.
+
+This is useful if you want only the password reset email option on the RT
+user admin page, but no self-service options.
 
 =back
+
 =cut
 
 =head1 AUTHOR

commit 3cc4a9e7c063524a6217d357e9abd7adc7490a6e
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Mar 4 16:54:57 2020 -0500

    Update Module::Install

diff --git a/META.yml b/META.yml
index bfe3c9a..fe0b0c7 100644
--- a/META.yml
+++ b/META.yml
@@ -8,7 +8,7 @@ configure_requires:
   ExtUtils::MakeMaker: 6.59
 distribution_type: module
 dynamic_config: 1
-generated_by: 'Module::Install version 1.16'
+generated_by: 'Module::Install version 1.19'
 license: gpl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -24,5 +24,5 @@ requires:
 resources:
   license: http://opensource.org/licenses/gpl-license.php
 version: '1.04'
-x_module_install_rtx_version: '0.38'
+x_module_install_rtx_version: '0.40'
 x_requires_rt: 4.0.0
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index f44ab4d..7ba98c2 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -31,7 +31,7 @@ BEGIN {
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -244,6 +244,8 @@ sub new {
 	}
 	return $args{_self} if $args{_self};
 
+	$base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS';
+
 	$args{dispatch} ||= 'Admin';
 	$args{prefix}   ||= 'inc';
 	$args{author}   ||= ($^O eq 'VMS' ? '_author' : '.author');
@@ -322,7 +324,7 @@ sub find_extensions {
 	my ($self, $path) = @_;
 
 	my @found;
-	File::Find::find( sub {
+	File::Find::find( {no_chdir => 1, wanted => sub {
 		my $file = $File::Find::name;
 		return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
 		my $subpath = $1;
@@ -336,7 +338,7 @@ sub find_extensions {
 		# correctly.  Otherwise, root through the file to locate the case-preserved
 		# version of the package name.
 		if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
-			my $content = Module::Install::_read($subpath . '.pm');
+			my $content = Module::Install::_read($File::Find::name);
 			my $in_pod  = 0;
 			foreach ( split /\n/, $content ) {
 				$in_pod = 1 if /^=\w/;
@@ -351,7 +353,7 @@ sub find_extensions {
 		}
 
 		push @found, [ $file, $pkg ];
-	}, $path ) if -d $path;
+	}}, $path ) if -d $path;
 
 	@found;
 }
@@ -373,8 +375,6 @@ sub _caller {
 	return $call;
 }
 
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _read {
 	local *FH;
 	open( FH, '<', $_[0] ) or die "open($_[0]): $!";
@@ -383,16 +383,6 @@ sub _read {
 	close FH or die "close($_[0]): $!";
 	return $string;
 }
-END_NEW
-sub _read {
-	local *FH;
-	open( FH, "< $_[0]"  ) or die "open($_[0]): $!";
-	binmode FH;
-	my $string = do { local $/; <FH> };
-	close FH or die "close($_[0]): $!";
-	return $string;
-}
-END_OLD
 
 sub _readperl {
 	my $string = Module::Install::_read($_[0]);
@@ -413,8 +403,6 @@ sub _readpod {
 	return $string;
 }
 
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
 sub _write {
 	local *FH;
 	open( FH, '>', $_[0] ) or die "open($_[0]): $!";
@@ -424,17 +412,6 @@ sub _write {
 	}
 	close FH or die "close($_[0]): $!";
 }
-END_NEW
-sub _write {
-	local *FH;
-	open( FH, "> $_[0]"  ) or die "open($_[0]): $!";
-	binmode FH;
-	foreach ( 1 .. $#_ ) {
-		print FH $_[$_] or die "print($_[0]): $!";
-	}
-	close FH or die "close($_[0]): $!";
-}
-END_OLD
 
 # _version is for processing module versions (eg, 1.03_05) not
 # Perl versions (eg, 5.8.1).
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 5762a74..9fa42c2 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 }
 
 # Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index d859276..d65c753 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -8,7 +8,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -121,6 +121,15 @@ END_C
 # Can we locate a (the) C compiler
 sub can_cc {
 	my $self   = shift;
+
+	if ($^O eq 'VMS') {
+		require ExtUtils::CBuilder;
+		my $builder = ExtUtils::CBuilder->new(
+		quiet => 1,
+		);
+		return $builder->have_compiler;
+	}
+
 	my @chunks = split(/ /, $Config::Config{cc}) or return;
 
 	# $Config{cc} may contain args; try to find out the program part
@@ -151,4 +160,4 @@ if ( $^O eq 'cygwin' ) {
 
 __END__
 
-#line 236
+#line 245
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index 41d3517..3072b08 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Include.pm b/inc/Module/Install/Include.pm
index 2eb1d1f..13fdcd0 100644
--- a/inc/Module/Install/Include.pm
+++ b/inc/Module/Install/Include.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index e9918d2..13a4464 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 9792685..11bf971 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 80538d3..7cad529 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,7 +8,7 @@ no warnings 'once';
 
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.38';
+our $VERSION = '0.40';
 
 use FindBin;
 use File::Glob     ();
@@ -113,11 +113,29 @@ lexicons ::
 .
     }
 
+    my $remove_files;
+    if( $extra_args->{'remove_files'} ){
+        $self->include('Module::Install::RTx::Remove');
+        our @remove_files;
+        eval { require "etc/upgrade/remove_files" }
+          or print "No remove file located, no files to remove\n";
+        $remove_files = join ",", map {"q(\$(DESTDIR)$plugin_path/$name/$_)"} @remove_files;
+    }
+
     $self->include('Module::Install::RTx::Runtime') if $self->admin;
     $self->include_deps( 'YAML::Tiny', 0 ) if $self->admin;
     my $postamble = << ".";
 install ::
 \t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxPlugin()"
+.
+
+    if( $remove_files ){
+        $postamble .= << ".";
+\t\$(NOECHO) \$(PERL) -MModule::Install::RTx::Remove -e \"RTxRemove([$remove_files])\"
+.
+    }
+
+    $postamble .= << ".";
 \t\$(NOECHO) \$(PERL) -MExtUtils::Install -e \"install({$args})\"
 .
 
@@ -279,4 +297,4 @@ sub _load_rt_handle {
 
 __END__
 
-#line 428
+#line 468
diff --git a/inc/Module/Install/RTx/Runtime.pm b/inc/Module/Install/RTx/Runtime.pm
index 937949f..ae07502 100644
--- a/inc/Module/Install/RTx/Runtime.pm
+++ b/inc/Module/Install/RTx/Runtime.pm
@@ -33,6 +33,7 @@ sub RTxDatabase {
 
     my $lib_path = File::Basename::dirname($INC{'RT.pm'});
     my @args = (
+        "-I.",
         "-Ilib",
         "-I$RT::LocalLibPath",
         "-I$lib_path",
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
index 3634ee0..3738232 100644
--- a/inc/Module/Install/ReadmeFromPod.pm
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -7,7 +7,7 @@ use warnings;
 use base qw(Module::Install::Base);
 use vars qw($VERSION);
 
-$VERSION = '0.26';
+$VERSION = '0.30';
 
 {
 
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index 218a66b..f7aa615 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 530749b..2db861a 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.16';
+	$VERSION = '1.19';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }
diff --git a/inc/YAML/Tiny.pm b/inc/YAML/Tiny.pm
index aa539f7..fb157a6 100644
--- a/inc/YAML/Tiny.pm
+++ b/inc/YAML/Tiny.pm
@@ -2,12 +2,12 @@
 use 5.008001; # sane UTF-8 support
 use strict;
 use warnings;
-package YAML::Tiny; # git description: v1.68-2-gcc5324e
+package YAML::Tiny; # git description: v1.72-7-g8682f63
 # XXX-INGY is 5.8.1 too old/broken for utf8?
 # XXX-XDG Lancaster consensus was that it was sufficient until
 # proven otherwise
 
-our $VERSION = '1.69';
+our $VERSION = '1.73';
 
 #####################################################################
 # The YAML::Tiny API.
@@ -374,7 +374,7 @@ sub _load_scalar {
     while ( @$lines ) {
         $lines->[0] =~ /^(\s*)/;
         last unless length($1) >= $indent->[-1];
-        push @multiline, substr(shift(@$lines), length($1));
+        push @multiline, substr(shift(@$lines), $indent->[-1]);
     }
 
     my $j = (substr($string, 0, 1) eq '>') ? ' ' : "\n";
@@ -570,10 +570,8 @@ sub _dump_file {
     if ( _can_flock() ) {
         # Open without truncation (truncate comes after lock)
         my $flags = Fcntl::O_WRONLY()|Fcntl::O_CREAT();
-        sysopen( $fh, $file, $flags );
-        unless ( $fh ) {
-            $self->_error("Failed to open file '$file' for writing: $!");
-        }
+        sysopen( $fh, $file, $flags )
+            or $self->_error("Failed to open file '$file' for writing: $!");
 
         # Use no translation and strict UTF-8
         binmode( $fh, ":raw:encoding(UTF-8)");
@@ -871,4 +869,4 @@ delete $YAML::Tiny::{refaddr};
 
 __END__
 
-#line 1489
+#line 1487

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list