[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[lintian] 01/01: L::Util: Eager load YAML::XS



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit dd15e599b54d2511b71c903e1e7c9d83829fbea8
Author: Niels Thykier <niels@thykier.net>
Date:   Wed Apr 26 08:38:12 2017 +0000

    L::Util: Eager load YAML::XS
    
    Originally, lintian would lazy load YAML::XS as it was not a hard
    dependency and only used by the reporting framework.  However, these
    days we use YAML::XS from some of the checks, so we win very little
    from lazy loading YAML::XS now.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 lib/Lintian/Util.pm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/Lintian/Util.pm b/lib/Lintian/Util.pm
index df17472..167c0e0 100644
--- a/lib/Lintian/Util.pm
+++ b/lib/Lintian/Util.pm
@@ -29,6 +29,7 @@ use Cwd qw(abs_path);
 use Errno qw(ENOENT);
 use Exporter qw(import);
 use POSIX qw(sigprocmask SIG_BLOCK SIG_UNBLOCK SIG_SETMASK);
+use YAML::XS ();
 
 use constant {
     DCTRL_DEBCONF_TEMPLATE => 1,
@@ -1628,7 +1629,6 @@ sub load_state_cache {
     my $state_file = "$state_dir/state-cache";
     my $state = {};
     my $fd;
-    require YAML::XS;
     eval {open($fd, '<:raw', $state_file);};
     if (my $err = $@) {
         if ($err->errno != ENOENT) {
@@ -1665,7 +1665,6 @@ sub save_state_cache {
     my ($state_dir, $state) = @_;
     my $state_file = "$state_dir/state-cache";
     my ($tmp_fd, $tmp_path);
-    require YAML::XS;
 
     ($tmp_fd, $tmp_path) = tempfile('state-cache-XXXXXX', DIR => $state_dir);
     ## TODO: Should tmp_fd be binmode'd as we use YAML::XS?

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: