r31354 - in /branches/upstream/libpar-perl/current: ./ inc/Module/ inc/Module/Install/ lib/ lib/PAR/ t/

antonio-guest at users.alioth.debian.org antonio-guest at users.alioth.debian.org
Tue Mar 3 23:50:05 UTC 2009


Author: antonio-guest
Date: Tue Mar  3 23:50:02 2009
New Revision: 31354

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=31354
Log:
[svn-upgrade] Integrating new upstream version, libpar-perl (0.988)

Added:
    branches/upstream/libpar-perl/current/t/60-cleanup.t
Modified:
    branches/upstream/libpar-perl/current/ChangeLog
    branches/upstream/libpar-perl/current/MANIFEST
    branches/upstream/libpar-perl/current/META.yml
    branches/upstream/libpar-perl/current/inc/Module/Install.pm
    branches/upstream/libpar-perl/current/inc/Module/Install/Base.pm
    branches/upstream/libpar-perl/current/inc/Module/Install/Can.pm
    branches/upstream/libpar-perl/current/inc/Module/Install/Fetch.pm
    branches/upstream/libpar-perl/current/inc/Module/Install/Include.pm
    branches/upstream/libpar-perl/current/inc/Module/Install/Makefile.pm
    branches/upstream/libpar-perl/current/inc/Module/Install/Metadata.pm
    branches/upstream/libpar-perl/current/inc/Module/Install/Win32.pm
    branches/upstream/libpar-perl/current/inc/Module/Install/WriteAll.pm
    branches/upstream/libpar-perl/current/lib/PAR.pm
    branches/upstream/libpar-perl/current/lib/PAR/SetupProgname.pm
    branches/upstream/libpar-perl/current/lib/PAR/SetupTemp.pm
    branches/upstream/libpar-perl/current/t/01-basic.t

Modified: branches/upstream/libpar-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/ChangeLog?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/ChangeLog (original)
+++ branches/upstream/libpar-perl/current/ChangeLog Tue Mar  3 23:50:02 2009
@@ -1,3 +1,16 @@
+
+[Changes for 0.988 - Mar  1, 2009]
+  - Promote previous release to stable release.
+
+[Changes for 0.987_01 - Feb 20, 2009]
+* New features
+  - Better cleanup of the $TMPDIR/par-$USER/temp-$$ directories
+    that are typically used as caches in the "use PAR 'foo.par'" use case.
+
+* Bug fixes, etc.
+  - Very slightly more careful handling of PAR-specific environment
+    variables.
+  - Cleanup of PAR::SetupTemp
 
 [Changes for 0.986 - Feb 19, 2009]
   - Promote to stable release.

Modified: branches/upstream/libpar-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/MANIFEST?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/MANIFEST (original)
+++ branches/upstream/libpar-perl/current/MANIFEST Tue Mar  3 23:50:02 2009
@@ -29,6 +29,7 @@
 t/01-basic.t
 t/40-par-hashref.t
 t/50-autoloaderfix.t
+t/60-cleanup.t
 t/hello.par
 t/Hello.pm
 TODO

Modified: branches/upstream/libpar-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/META.yml?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/META.yml (original)
+++ branches/upstream/libpar-perl/current/META.yml Tue Mar  3 23:50:02 2009
@@ -3,7 +3,7 @@
 author:
   - 'Audrey Tang <cpan at audreyt.org>'
 distribution_type: module
-generated_by: 'Module::Install version 0.78'
+generated_by: 'Module::Install version 0.79'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -16,7 +16,7 @@
 provides:
   PAR:
     file: lib/PAR.pm
-    version: 0.986
+    version: 0.988
   PAR::Heavy:
     file: lib/PAR/Heavy.pm
     version: 0.11
@@ -35,4 +35,4 @@
   perl: 5.6.0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.986
+version: 0.988

Modified: branches/upstream/libpar-perl/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/inc/Module/Install.pm?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/libpar-perl/current/inc/Module/Install.pm Tue Mar  3 23:50:02 2009
@@ -30,7 +30,7 @@
 	# 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 = '0.78';
+	$VERSION = '0.79';
 
 	*inc::Module::Install::VERSION = *VERSION;
 	@inc::Module::Install::ISA     = __PACKAGE__;

Modified: branches/upstream/libpar-perl/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/inc/Module/Install/Base.pm?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/libpar-perl/current/inc/Module/Install/Base.pm Tue Mar  3 23:50:02 2009
@@ -1,7 +1,7 @@
 #line 1
 package Module::Install::Base;
 
-$VERSION = '0.78';
+$VERSION = '0.79';
 
 # Suspend handler for "redefined" warnings
 BEGIN {

Modified: branches/upstream/libpar-perl/current/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/inc/Module/Install/Can.pm?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/inc/Module/Install/Can.pm (original)
+++ branches/upstream/libpar-perl/current/inc/Module/Install/Can.pm Tue Mar  3 23:50:02 2009
@@ -11,7 +11,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libpar-perl/current/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/inc/Module/Install/Fetch.pm?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/inc/Module/Install/Fetch.pm (original)
+++ branches/upstream/libpar-perl/current/inc/Module/Install/Fetch.pm Tue Mar  3 23:50:02 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libpar-perl/current/inc/Module/Install/Include.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/inc/Module/Install/Include.pm?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/inc/Module/Install/Include.pm (original)
+++ branches/upstream/libpar-perl/current/inc/Module/Install/Include.pm Tue Mar  3 23:50:02 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libpar-perl/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/inc/Module/Install/Makefile.pm?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/libpar-perl/current/inc/Module/Install/Makefile.pm Tue Mar  3 23:50:02 2009
@@ -7,7 +7,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }

Modified: branches/upstream/libpar-perl/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/inc/Module/Install/Metadata.pm?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/libpar-perl/current/inc/Module/Install/Metadata.pm Tue Mar  3 23:50:02 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION $ISCORE @ISA};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	$ISCORE  = 1;
 	@ISA     = qw{Module::Install::Base};
 }
@@ -176,19 +176,15 @@
 		"Did not provide a value to perl_version()"
 	);
 
-	# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
-	# numbers (eg, 5.006001 or 5.008009).
-	# Also, convert double-part versions (eg, 5.8)
-
-	$version =~ s/^(\d+)\.(\d+)(?:\.(\d+))?$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
-
-	$version =~ s/_.+$//;
-	$version = $version + 0; # Numify
+	# Normalize the version
+	$version = $self->_perl_version($version);
+
+	# We don't support the reall old versions
 	unless ( $version >= 5.005 ) {
 		die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
 	}
+
 	$self->{values}{perl_version} = $version;
-	return 1;
 }
 
 sub license {
@@ -480,4 +476,70 @@
 	return 1;
 }
 
+# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
+# numbers (eg, 5.006001 or 5.008009).
+# Also, convert double-part versions (eg, 5.8)
+sub _perl_version {
+	my $v = $_[-1];
+	$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;	
+	$v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
+	$v =~ s/(\.\d\d\d)000$/$1/;
+	$v =~ s/_.+$//;
+	if ( ref($v) ) {
+		$v = $v + 0; # Numify
+	}
+	return $v;
+}
+
+
+
+
+
+######################################################################
+# MYMETA.yml Support
+
+sub WriteMyMeta {
+	$_[0]->write_mymeta;
+}
+
+sub write_mymeta {
+	my $self = shift;
+	
+	# If there's no existing META.yml there is nothing we can do
+	return unless -f 'META.yml';
+
+	# Merge the perl version into the dependencies
+	my $val  = $self->Meta->{values};
+	my $perl = delete $val->{perl_version};
+	if ( $perl ) {
+		$val->{requires} ||= [];
+		my $requires = $val->{requires};
+
+		# Canonize to three-dot version after Perl 5.6
+		if ( $perl >= 5.006 ) {
+			$perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e
+		}
+		unshift @$requires, [ perl => $perl ];
+	}
+
+	# Load the advisory META.yml file
+	require YAML::Tiny;
+	my @yaml = YAML::Tiny::LoadFile('META.yml');
+	my $meta = $yaml[0];
+
+	# Overwrite the non-configure dependency hashs
+	delete $meta->{requires};
+	delete $meta->{build_requires};
+	delete $meta->{recommends};
+	if ( exists $val->{requires} ) {
+		$meta->{requires} = { map { @$_ } @{ $val->{requires} } };
+	}
+	if ( exists $val->{build_requires} ) {
+		$meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
+	}
+
+	# Save as the MYMETA.yml file
+	YAML::Tiny::DumpFile('MYMETA.yml', $meta);
+}
+
 1;

Modified: branches/upstream/libpar-perl/current/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/inc/Module/Install/Win32.pm?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/inc/Module/Install/Win32.pm (original)
+++ branches/upstream/libpar-perl/current/inc/Module/Install/Win32.pm Tue Mar  3 23:50:02 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libpar-perl/current/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/inc/Module/Install/WriteAll.pm?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/inc/Module/Install/WriteAll.pm (original)
+++ branches/upstream/libpar-perl/current/inc/Module/Install/WriteAll.pm Tue Mar  3 23:50:02 2009
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.78';
+	$VERSION = '0.79';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libpar-perl/current/lib/PAR.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/lib/PAR.pm?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/lib/PAR.pm (original)
+++ branches/upstream/libpar-perl/current/lib/PAR.pm Tue Mar  3 23:50:02 2009
@@ -1,5 +1,5 @@
 package PAR;
-$PAR::VERSION = '0.986';
+$PAR::VERSION = '0.988';
 
 use 5.006;
 use strict;
@@ -35,7 +35,7 @@
 
 =head1 VERSION
 
-This document describes release 0.986 of PAR, released February 19, 2008.
+This document describes release 0.988 of PAR, released March 1, 2009.
 
 =head1 SYNOPSIS
 
@@ -1074,7 +1074,19 @@
 }
 
 
-
+# Attempt to clean up the temporary directory if
+# --> We're running in clean mode
+# --> It's defined
+# --> It's an existing directory
+# --> It's empty
+END {
+  if (exists $ENV{PAR_CLEAN} and $ENV{PAR_CLEAN}
+      and exists $ENV{PAR_TEMP} and defined $ENV{PAR_TEMP} and -d $ENV{PAR_TEMP}
+  ) {
+    local($!); # paranoid: ignore potential errors without clobbering a global variable!
+    rmdir($ENV{PAR_TEMP});
+  }
+}
 
 1;
 

Modified: branches/upstream/libpar-perl/current/lib/PAR/SetupProgname.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/lib/PAR/SetupProgname.pm?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/lib/PAR/SetupProgname.pm (original)
+++ branches/upstream/libpar-perl/current/lib/PAR/SetupProgname.pm Tue Mar  3 23:50:02 2009
@@ -31,7 +31,7 @@
 sub set_progname {
     require File::Spec;
 
-    if ($ENV{PAR_PROGNAME} and $ENV{PAR_PROGNAME} =~ /(.+)/) {
+    if (defined $ENV{PAR_PROGNAME} and $ENV{PAR_PROGNAME} =~ /(.+)/) {
         $Progname = $1;
     }
     $Progname = $0 if not defined $Progname;

Modified: branches/upstream/libpar-perl/current/lib/PAR/SetupTemp.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/lib/PAR/SetupTemp.pm?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/lib/PAR/SetupTemp.pm (original)
+++ branches/upstream/libpar-perl/current/lib/PAR/SetupTemp.pm Tue Mar  3 23:50:02 2009
@@ -36,73 +36,94 @@
     PAR::SetupProgname::set_progname()
       unless defined $PAR::SetupProgname::Progname;
 
-    if ($ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/) {
+    if (defined $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/) {
         $PARTemp = $1;
         return;
     }
 
-    return if $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/;
+    my $stmpdir = _get_par_user_tempdir();
+    require File::Spec;
+    if (defined $stmpdir) { # it'd be quite bad if this was not the case
+      if (!$ENV{PAR_CLEAN} and my $mtime = (stat($PAR::SetupProgname::Progname))[9]) {
+          my $ctx = _get_digester();
 
-    require File::Spec;
+          # Workaround for bug in Digest::SHA 5.38 and 5.39
+          my $sha_version = eval { $Digest::SHA::VERSION } || 0;
+          if ($sha_version eq '5.38' or $sha_version eq '5.39') {
+              $ctx->addfile($PAR::SetupProgname::Progname, "b") if ($ctx);
+          }
+          else {
+              if ($ctx and open(my $fh, "<$PAR::SetupProgname::Progname")) {
+                  binmode($fh);
+                  $ctx->addfile($fh);
+                  close($fh);
+              }
+          }
 
-    foreach my $path (
-        (map $ENV{$_}, qw( PAR_TMPDIR TMPDIR TEMPDIR TEMP TMP )),
-        qw( C:\\TEMP /tmp . )
-    ) {
-        next unless $path and -d $path and -w $path;
-        my $username;
-        my $pwuid;
-        # does not work everywhere:
-        eval {($pwuid) = getpwuid($>) if defined $>;};
+          $stmpdir = File::Spec->catdir(
+              $stmpdir,
+              "cache-" . ( $ctx ? $ctx->hexdigest : $mtime )
+          );
+      }
+      else {
+          $ENV{PAR_CLEAN} = 1;
+          $stmpdir = File::Spec->catdir($stmpdir, "temp-$$");
+      }
 
-        if ( defined(&Win32::LoginName) ) {
-            $username = &Win32::LoginName;
-        }
-        elsif (defined $pwuid) {
-            $username = $pwuid;
-        }
-        else {
-            $username = $ENV{USERNAME} || $ENV{USER} || 'SYSTEM';
-        }
-        $username =~ s/\W/_/g;
+      $ENV{PAR_TEMP} = $stmpdir;
+      mkdir $stmpdir, 0755;
+    } # end if found a temp dir
 
-        my $stmpdir = File::Spec->catdir($path, "par-$username");
-        ($stmpdir) = $stmpdir =~ /^(.*)$/s;
-        mkdir $stmpdir, 0755;
-        if (!$ENV{PAR_CLEAN} and my $mtime = (stat($PAR::SetupProgname::Progname))[9]) {
-            my $ctx = eval { require Digest::SHA; Digest::SHA->new(1) }
-                   || eval { require Digest::SHA1; Digest::SHA1->new }
-                   || eval { require Digest::MD5; Digest::MD5->new };
+    $PARTemp = $1 if defined $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/;
+}
 
-            # Workaround for bug in Digest::SHA 5.38 and 5.39
-            my $sha_version = eval { $Digest::SHA::VERSION } || 0;
-            if ($sha_version eq '5.38' or $sha_version eq '5.39') {
-                $ctx->addfile($PAR::SetupProgname::Progname, "b") if ($ctx);
-            }
-            else {
-                if ($ctx and open(my $fh, "<$PAR::SetupProgname::Progname")) {
-                    binmode($fh);
-                    $ctx->addfile($fh);
-                    close($fh);
-                }
-            }
+# Find any digester
+# Used in PAR::Repository::Client!
+sub _get_digester {
+  my $ctx = eval { require Digest::SHA; Digest::SHA->new(1) }
+         || eval { require Digest::SHA1; Digest::SHA1->new }
+         || eval { require Digest::MD5; Digest::MD5->new };
+  return $ctx;
+}
 
-            $stmpdir = File::Spec->catdir(
-                $stmpdir,
-                "cache-" . ( $ctx ? $ctx->hexdigest : $mtime )
-            );
-        }
-        else {
-            $ENV{PAR_CLEAN} = 1;
-            $stmpdir = File::Spec->catdir($stmpdir, "temp-$$");
-        }
+# find the per-user temporary directory (eg /tmp/par-$USER)
+# Used in PAR::Repository::Client!
+sub _get_par_user_tempdir {
+  my $username = _find_username();
+  my $temp_path;
+  foreach my $path (
+    (map $ENV{$_}, qw( PAR_TMPDIR TMPDIR TEMPDIR TEMP TMP )),
+      qw( C:\\TEMP /tmp . )
+  ) {
+    next unless defined $path and -d $path and -w $path;
+    $temp_path = File::Spec->catdir($path, "par-$username");
+    ($temp_path) = $temp_path =~ /^(.*)$/s;
+    mkdir $temp_path, 0755;
 
-        $ENV{PAR_TEMP} = $stmpdir;
-        mkdir $stmpdir, 0755;
-        last;
-    }
+    last;
+  }
+  return $temp_path;
+}
 
-    $PARTemp = $1 if $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/;
+# tries hard to find out the name of the current user
+sub _find_username {
+  my $username;
+  my $pwuid;
+  # does not work everywhere:
+  eval {($pwuid) = getpwuid($>) if defined $>;};
+
+  if ( defined(&Win32::LoginName) ) {
+    $username = &Win32::LoginName;
+  }
+  elsif (defined $pwuid) {
+    $username = $pwuid;
+  }
+  else {
+    $username = $ENV{USERNAME} || $ENV{USER} || 'SYSTEM';
+  }
+  $username =~ s/\W/_/g;
+
+  return $username;
 }
 
 1;

Modified: branches/upstream/libpar-perl/current/t/01-basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/t/01-basic.t?rev=31354&op=diff
==============================================================================
--- branches/upstream/libpar-perl/current/t/01-basic.t (original)
+++ branches/upstream/libpar-perl/current/t/01-basic.t Tue Mar  3 23:50:02 2009
@@ -1,9 +1,13 @@
 #!/usr/bin/perl
+use strict;
+use warnings;
+use Test::More tests => 8;
+use File::Spec;
+use File::Path;
 
-use Test;
-BEGIN { plan tests => 8 }
-
-$ENV{PAR_CLEAN} = 1;
+BEGIN {
+  $ENV{PAR_CLEAN} = 1;
+}
 
 ok(
     `"$^X" -Mblib -MPAR -It/hello -MHello -e Hello::hello`,

Added: branches/upstream/libpar-perl/current/t/60-cleanup.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-perl/current/t/60-cleanup.t?rev=31354&op=file
==============================================================================
--- branches/upstream/libpar-perl/current/t/60-cleanup.t (added)
+++ branches/upstream/libpar-perl/current/t/60-cleanup.t Tue Mar  3 23:50:02 2009
@@ -1,0 +1,34 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+# This test is supposed to make sure that
+# the /tmp/par-$USER/temp-$$ directories get cleaned up when
+# in CLEAN mode.
+
+use Test::More tests => 5;
+
+BEGIN {
+  $ENV{PAR_CLEAN} = 1;
+  delete $ENV{PAR_TEMP};
+}
+
+ok(!defined $ENV{PAR_TEMP}, "No PAR_TEMP to start with");
+
+require PAR;
+PAR->import();
+
+ok(1, "Loaded PAR");
+
+ok(defined $ENV{PAR_TEMP}, "Loading PAR defined PAR_TEMP");
+ok(-d $ENV{PAR_TEMP}, "Loading PAR created the PAR_TEMP directory");
+
+my $partemp = $ENV{PAR_TEMP};
+
+END {
+  ok(not -d $partemp);
+}
+
+
+__END__
+




More information about the Pkg-perl-cvs-commits mailing list