r43167 - in /trunk/libsysadm-install-perl: Changes MANIFEST META.yml README debian/README.source debian/changelog debian/control debian/patches/ debian/rules lib/Sysadm/Install.pm t/014utf8.t t/canned/utf8.txt

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Fri Aug 28 16:51:29 UTC 2009


Author: jawnsy-guest
Date: Fri Aug 28 16:51:23 2009
New Revision: 43167

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=43167
Log:
* New upstream release
  + slurp() and blurt() now use utf8 mode by default if available
  + added utf8_available() and is_utf8_data()
* Remove nhandler's fix-manpage patch, applied upstream (& quilt)
* Standards-Version 3.8.3 (drop perl version dependency)
* Added myself to Uploaders and Copyright
* Miscellaneous cleanups in rules

Added:
    trunk/libsysadm-install-perl/t/014utf8.t
      - copied unchanged from r43166, branches/upstream/libsysadm-install-perl/current/t/014utf8.t
    trunk/libsysadm-install-perl/t/canned/utf8.txt
      - copied unchanged from r43166, branches/upstream/libsysadm-install-perl/current/t/canned/utf8.txt
Removed:
    trunk/libsysadm-install-perl/debian/README.source
    trunk/libsysadm-install-perl/debian/patches/
Modified:
    trunk/libsysadm-install-perl/Changes
    trunk/libsysadm-install-perl/MANIFEST
    trunk/libsysadm-install-perl/META.yml
    trunk/libsysadm-install-perl/README
    trunk/libsysadm-install-perl/debian/changelog
    trunk/libsysadm-install-perl/debian/control
    trunk/libsysadm-install-perl/debian/rules
    trunk/libsysadm-install-perl/lib/Sysadm/Install.pm

Modified: trunk/libsysadm-install-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsysadm-install-perl/Changes?rev=43167&op=diff
==============================================================================
--- trunk/libsysadm-install-perl/Changes (original)
+++ trunk/libsysadm-install-perl/Changes Fri Aug 28 16:51:23 2009
@@ -1,6 +1,12 @@
 ########################################
 Revision history for Sysadm::Install
 ########################################
+
+0.30 2009/08/27
+    (ms) nhandler(at)ubuntu.com provided a patch to resolve pod2man errors:
+         https://rt.cpan.org/Public/Bug/Display.html?id=47525
+    (ms) slurp() and blurt() now use utf8 mode by default if available
+    (ms) added utf8_available() and is_utf8_data()
 
 0.29 2009/06/25
     (ms) Greg Olszewski added proper error handling to print and 

Modified: trunk/libsysadm-install-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsysadm-install-perl/MANIFEST?rev=43167&op=diff
==============================================================================
--- trunk/libsysadm-install-perl/MANIFEST (original)
+++ trunk/libsysadm-install-perl/MANIFEST Fri Aug 28 16:51:23 2009
@@ -23,6 +23,8 @@
 t/011defor.t
 t/012tap.t
 t/013download.t
+t/014utf8.t
 t/canned/test.tar
 t/canned/testa.tar
+t/canned/utf8.txt
 META.yml                                 Module meta-data (added by MakeMaker)

Modified: trunk/libsysadm-install-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsysadm-install-perl/META.yml?rev=43167&op=diff
==============================================================================
--- trunk/libsysadm-install-perl/META.yml (original)
+++ trunk/libsysadm-install-perl/META.yml Fri Aug 28 16:51:23 2009
@@ -1,31 +1,18 @@
---- #YAML:1.0
-name:               Sysadm-Install
-version:            0.29
-abstract:           Typical installation tasks for system administrators
-author:
-    - Mike Schilli <m at perlmeister.com>
-license:            unknown
-distribution_type:  module
-configure_requires:
-    ExtUtils::MakeMaker:  0
-build_requires:
-    ExtUtils::MakeMaker:  0
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
+name:         Sysadm-Install
+version:      0.31
+version_from: lib/Sysadm/Install.pm
+installdirs:  site
 requires:
-    Cwd:             0
-    File::Basename:  0
-    File::Copy:      0
-    File::Path:      0
-    File::Temp:      0.16
-    Log::Log4perl:   1
-    LWP::Simple:     0
-    Term::ReadKey:   0
-resources:
-    repository:  http://github.com/mschilli/sysadm-install-perl
-no_index:
-    directory:
-        - t
-        - inc
-generated_by:       ExtUtils::MakeMaker version 6.50
-meta-spec:
-    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
-    version:  1.4
+    Cwd:                           0
+    File::Basename:                0
+    File::Copy:                    0
+    File::Path:                    0
+    File::Temp:                    0.16
+    Log::Log4perl:                 1
+    LWP::Simple:                   0
+    Term::ReadKey:                 0
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.30_01

Modified: trunk/libsysadm-install-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsysadm-install-perl/README?rev=43167&op=diff
==============================================================================
--- trunk/libsysadm-install-perl/README (original)
+++ trunk/libsysadm-install-perl/README Fri Aug 28 16:51:23 2009
@@ -1,5 +1,5 @@
 ######################################################################
-    Sysadm::Install 0.29
+    Sysadm::Install 0.31
 ######################################################################
 
 NAME
@@ -447,6 +447,16 @@
         apparently passed in by value? Modifying $_[0] within the subroutine
         is an old Perl trick to do exactly that.
 
+    "is_utf8_data($data)"
+        Check if the given string has the utf8 flag turned on. Works just
+        like Encode.pm's is_utf8() function, except that it silently returns
+        a false if Encode isn't available, for example when an ancient perl
+        without proper utf8 support is used.
+
+    "utf8_check($data)"
+        Check if we're using a perl with proper utf8 support, by verifying
+        the Encode.pm module is available for loading.
+
 AUTHOR
     Mike Schilli, <m at perlmeister.com>
 

Modified: trunk/libsysadm-install-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsysadm-install-perl/debian/changelog?rev=43167&op=diff
==============================================================================
--- trunk/libsysadm-install-perl/debian/changelog (original)
+++ trunk/libsysadm-install-perl/debian/changelog Fri Aug 28 16:51:23 2009
@@ -1,3 +1,15 @@
+libsysadm-install-perl (0.31-1) UNRELEASED; urgency=low
+
+  * New upstream release
+    + slurp() and blurt() now use utf8 mode by default if available
+    + added utf8_available() and is_utf8_data()
+  * Remove nhandler's fix-manpage patch, applied upstream (& quilt)
+  * Standards-Version 3.8.3 (drop perl version dependency)
+  * Added myself to Uploaders and Copyright
+  * Miscellaneous cleanups in rules
+
+ -- Jonathan Yu <frequency at cpan.org>  Fri, 28 Aug 2009 08:46:15 -0400
+
 libsysadm-install-perl (0.29-1) unstable; urgency=low
 
   [ Nathan Handler ]

Modified: trunk/libsysadm-install-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsysadm-install-perl/debian/control?rev=43167&op=diff
==============================================================================
--- trunk/libsysadm-install-perl/debian/control (original)
+++ trunk/libsysadm-install-perl/debian/control Fri Aug 28 16:51:23 2009
@@ -1,13 +1,14 @@
 Source: libsysadm-install-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 7.0.50), quilt (>= 0.46-7)
-Build-Depends-Indep: perl-modules (>= 5.10) | libarchive-tar-perl, liblog-log4perl-perl,
- libterm-readkey-perl, libwww-perl, perl (>= 5.8.0-7)
+Build-Depends: debhelper (>= 7.0.50)
+Build-Depends-Indep: perl, perl-modules (>= 5.10) | libarchive-tar-perl,
+ liblog-log4perl-perl, libterm-readkey-perl, libwww-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: gregor herrmann <gregoa at debian.org>,
- Ryan Niebur <ryanryan52 at gmail.com>, Nathan Handler <nhandler at ubuntu.com>
-Standards-Version: 3.8.2
+ Ryan Niebur <ryanryan52 at gmail.com>, Nathan Handler <nhandler at ubuntu.com>,
+ Jonathan Yu <frequency at cpan.org>
+Standards-Version: 3.8.3
 Homepage: http://search.cpan.org/dist/Sysadm-Install/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libsysadm-install-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libsysadm-install-perl/

Modified: trunk/libsysadm-install-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsysadm-install-perl/debian/rules?rev=43167&op=diff
==============================================================================
--- trunk/libsysadm-install-perl/debian/rules (original)
+++ trunk/libsysadm-install-perl/debian/rules Fri Aug 28 16:51:23 2009
@@ -1,10 +1,11 @@
 #!/usr/bin/make -f
 
+PACKAGE = $(shell dh_listpackages)
+TMP     = $(CURDIR)/debian/$(PACKAGE)
+
 %:
-	dh --with quilt $@
-
-CMD=$(shell echo $@ | sed 's/^override_//')
+	dh $@
 
 override_dh_auto_install:
-	$(CMD)
-	rm -rf debian/$(shell dh_listpackages)/usr/bin/
+	dh_auto_install
+	rm -rf $(TMP)/usr/bin/

Modified: trunk/libsysadm-install-perl/lib/Sysadm/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libsysadm-install-perl/lib/Sysadm/Install.pm?rev=43167&op=diff
==============================================================================
--- trunk/libsysadm-install-perl/lib/Sysadm/Install.pm (original)
+++ trunk/libsysadm-install-perl/lib/Sysadm/Install.pm Fri Aug 28 16:51:23 2009
@@ -6,7 +6,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '0.29';
+our $VERSION = '0.31';
 
 use File::Copy;
 use File::Path;
@@ -84,6 +84,7 @@
 fs_read_open fs_write_open pipe_copy
 snip password_read nice_time
 def_or blurt_atomic
+is_utf8_data utf8_available
 );
 
 our %EXPORTABLE = map { $_ => 1 } @EXPORTABLE;
@@ -174,10 +175,6 @@
 =head2 FUNCTIONS
 
 =over 4
-
-=cut
-
-=pod
 
 =item C<cp($source, $target)>
 
@@ -671,6 +668,11 @@
 
         open FILE, "<$file" or 
             LOGCROAK("Cannot open $file ($!)");
+
+        if( utf8_available() ) {
+            binmode FILE, ":utf8";
+        }
+
         while(<FILE>) {
             $out .= $coderef->($_);
         }
@@ -711,6 +713,11 @@
 
         open FILE, "<$file" or 
             LOGCROAK("Cannot open $file ($!)");
+
+        if( utf8_available() ) {
+            binmode FILE, ":utf8";
+        }
+
         while(<FILE>) {
             $coderef->($_);
         }
@@ -745,6 +752,9 @@
         INFO "Slurping data from $file";
         open FILE, "<$file" or 
             LOGCROAK("Cannot open $file ($!)");
+        if( utf8_available() ) {
+            binmode FILE, ":utf8";
+        }
         $data = <FILE>;
         close FILE;
         DEBUG "Read ", snip($data, $DATA_SNIPPED_LEN), " from $file";
@@ -782,6 +792,11 @@
     open FILE, ">" . ($append ? ">" : "") . $file 
         or 
         LOGCROAK("Cannot open $file for writing ($!)");
+
+    if( is_utf8_data( $data ) ) {
+        binmode FILE, ":utf8";
+    }
+
     print FILE $data
         or 
         LOGCROAK("Cannot write to $file ($!)");        
@@ -1545,6 +1560,50 @@
     }
 }
 
+=item C<is_utf8_data($data)>
+
+Check if the given string has the utf8 flag turned on. Works just like 
+Encode.pm's is_utf8() function, except that it silently returns a 
+false if Encode isn't available, for example when an ancient perl 
+without proper utf8 support is used.
+
+=cut
+
+###############################################
+sub is_utf8_data {
+###############################################
+    my($data) = @_;
+
+    if( !utf8_available() ) {
+        return 0;
+    }
+
+    return Encode::is_utf8( $data );
+}
+
+=item C<utf8_check($data)>
+
+Check if we're using a perl with proper utf8 support, by verifying the
+Encode.pm module is available for loading.
+
+=cut
+
+###############################################
+sub utf8_available {
+###############################################
+
+    eval {
+        use Encode;
+    };
+
+    if($@) {
+        return 0;
+    }
+
+    return 1;
+}
+
+
 =pod
 
 =back




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