r40212 - in /branches/upstream/libguard-perl/current: Changes Guard.pm Guard.xs META.yml README

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sun Jul 19 23:50:59 UTC 2009


Author: jawnsy-guest
Date: Sun Jul 19 23:50:54 2009
New Revision: 40212

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

Modified:
    branches/upstream/libguard-perl/current/Changes
    branches/upstream/libguard-perl/current/Guard.pm
    branches/upstream/libguard-perl/current/Guard.xs
    branches/upstream/libguard-perl/current/META.yml
    branches/upstream/libguard-perl/current/README

Modified: branches/upstream/libguard-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libguard-perl/current/Changes?rev=40212&op=diff
==============================================================================
--- branches/upstream/libguard-perl/current/Changes (original)
+++ branches/upstream/libguard-perl/current/Changes Sun Jul 19 23:50:54 2009
@@ -1,4 +1,6 @@
 Revision history for Perl extension Guard
+
+	- try to provide compatibility to pre-5.8.8.
 
 1.02 Sat Apr 11 06:42:06 CEST 2009
 	- set NODEBUG on scope_guard, to work around -d: modules

Modified: branches/upstream/libguard-perl/current/Guard.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libguard-perl/current/Guard.pm?rev=40212&op=diff
==============================================================================
--- branches/upstream/libguard-perl/current/Guard.pm (original)
+++ branches/upstream/libguard-perl/current/Guard.pm Sun Jul 19 23:50:54 2009
@@ -15,6 +15,11 @@
       code_that_might_die_or_does_other_fun_stuff;
    }
 
+   # create an object that, when the last reference to it is gone,
+   # invokes the given codeblock:
+   my $guard = guard { print "destroyed!\n" };
+   undef $guard; # probably destroyed here
+
 =head1 DESCRIPTION
 
 This module implements so-called "guards". A guard is something (usually
@@ -39,7 +44,7 @@
 no warnings;
 
 BEGIN {
-   $VERSION = '1.02';
+   $VERSION = '1.021';
    @ISA = qw(Exporter);
    @EXPORT = qw(guard scope_guard);
 

Modified: branches/upstream/libguard-perl/current/Guard.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libguard-perl/current/Guard.xs?rev=40212&op=diff
==============================================================================
--- branches/upstream/libguard-perl/current/Guard.xs (original)
+++ branches/upstream/libguard-perl/current/Guard.xs Sun Jul 19 23:50:54 2009
@@ -3,6 +3,15 @@
 #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"
+
+/* apparently < 5.8.8 */
+#ifndef SvSTASH_set
+# define SvSTASH_set(x,a) SvSTASH(x) = (a)
+#endif
+
+#ifndef PERL_MAGIC_ext
+# define PERL_MAGIC_ext '~'
+#endif
 
 static HV *guard_stash;
 

Modified: branches/upstream/libguard-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libguard-perl/current/META.yml?rev=40212&op=diff
==============================================================================
--- branches/upstream/libguard-perl/current/META.yml (original)
+++ branches/upstream/libguard-perl/current/META.yml Sun Jul 19 23:50:54 2009
@@ -1,18 +1,26 @@
---- #YAML:1.0
-name:               Guard
-version:            1.02
-abstract:           ~
-author:  []
-license:            unknown
-distribution_type:  module
-configure_requires:
-    ExtUtils::MakeMaker:  0
-requires:  {}
-no_index:
-    directory:
-        - t
-        - inc
-generated_by:       ExtUtils::MakeMaker version 6.48
-meta-spec:
-    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
-    version:  1.4
+{
+   "no_index" : {
+      "directory" : [
+         "t",
+         "inc"
+      ]
+   },
+   "meta-spec" : {
+      "version" : 1.4,
+      "url" : "http://module-build.sourceforge.net/META-spec-v1.4.html"
+   },
+   "generated_by" : "ExtUtils::MakeMaker version 6.50",
+   "distribution_type" : "module",
+   "version" : "1.021",
+   "name" : "Guard",
+   "author" : [],
+   "license" : "unknown",
+   "build_requires" : {
+      "ExtUtils::MakeMaker" : 0
+   },
+   "requires" : {},
+   "abstract" : null,
+   "configure_requires" : {
+      "ExtUtils::MakeMaker" : 0
+   }
+}

Modified: branches/upstream/libguard-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libguard-perl/current/README?rev=40212&op=diff
==============================================================================
--- branches/upstream/libguard-perl/current/README (original)
+++ branches/upstream/libguard-perl/current/README Sun Jul 19 23:50:54 2009
@@ -3,15 +3,20 @@
 
 SYNOPSIS
        use Guard;
-       
-   # temporarily chdir to "/etc" directory, but make sure
+   
+       # temporarily chdir to "/etc" directory, but make sure
        # to go back to "/" no matter how myfun exits:
        sub myfun {
           scope_guard { chdir "/" };
           chdir "/etc";
-       
-      code_that_might_die_or_does_other_fun_stuff;
+   
+          code_that_might_die_or_does_other_fun_stuff;
        }
+
+       # create an object that, when the last reference to it is gone,
+       # invokes the given codeblock:
+       my $guard = guard { print "destroyed!\n" };
+       undef $guard; # probably destroyed here
 
 DESCRIPTION
     This module implements so-called "guards". A guard is something (usually




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