]> git.proxmox.com Git - pmg-api.git/commitdiff
cleanup and install PMG/Unpack.pm
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 14 Feb 2017 11:02:02 +0000 (12:02 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 14 Feb 2017 11:02:48 +0000 (12:02 +0100)
Makefile
PMG/Unpack.pm
bin/pmg-smtp-filter

index 4d7dfe568f6e59ce13e2180bf05f5d4bb188e793..b90dcb4a9cd0bf948262075e281b26119120f8b2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -31,6 +31,7 @@ LIBSOURCES =                          \
        PMG/AccessControl.pm            \
        PMG/AtomicFile.pm               \
        PMG/MailQueue.pm                \
+       PMG/Unpack.pm                   \
        PMG/RuleCache.pm                \
        PMG/LDAPSet.pm                  \
        PMG/LDAPCache.pm                \
index 08c45509f87840f7926c536ca7d5e5329dfb545c..01424f94aa2aa3cd4973de59de13a4a9515d641c 100755 (executable)
@@ -1,22 +1,24 @@
-package Proxmox::Unpack;
+package PMG::Unpack;
 
 use strict;
+use warnings;
 use IO::File;
 use IO::Select;
 use Xdgmime;
-use Compress::Zlib qw (gzopen);
-use Compress::Bzip2 qw (bzopen);
+use Compress::Zlib qw(gzopen);
+use Compress::Bzip2 qw(bzopen);
 use File::Path;
-use File::Temp qw (tempdir);
+use File::Temp qw(tempdir);
 use File::Basename;
 use File::stat;
 use POSIX ":sys_wait_h";
-use Time::HiRes qw (usleep ualarm gettimeofday tv_interval);
+use Time::HiRes qw(usleep ualarm gettimeofday tv_interval);
 use Archive::Zip qw(:CONSTANTS :ERROR_CODES);
 use LibArchive;
-use Proxmox::Utils;
 use MIME::Parser;
 
+use PMG::Utils;
+
 my $unpackers = {
 
     # TAR
@@ -31,7 +33,6 @@ my $unpackers = {
 
     # ZIP
     #'application/zip' =>                   [ 'zip',  \&unpack_tar, 1],
-    #'application/zip' =>                  [ 'zip',  \&unpack_zip, 1],
     'application/zip' =>                  [ '7z',   \&generic_unpack ],
 
     # 7z
@@ -995,8 +996,8 @@ sub __unpack_archive {
     return if !$size; # nothing to do
 
     if (!$ct) {
-       $ct = Proxmox::Utils::magic_mime_type_for_file ($filename);
-       $self->add_glob_mime_type ($filename);
+       $ct = PMG::Utils::magic_mime_type_for_file($filename);
+       $self->add_glob_mime_type($filename);
     }
 
     if ($ct) {
@@ -1094,7 +1095,7 @@ sub unpack_archive {
        return; # do nothing
     }
     
-    $ct = Proxmox::Utils::magic_mime_type_for_file ($filename) if !$ct;
+    $ct = PMG::Utils::magic_mime_type_for_file($filename) if !$ct;
 
     return if (!$ct || !is_archive ($ct)); # not an archive
 
index f7c7ccffe41b02084f970dabe23b5a87e495ae8a..0877ec5bec6218588391bfacc1627e36904c85d4 100755 (executable)
@@ -37,9 +37,9 @@ use PMG::AtomicFile;
 use PMG::LDAPSet;
 use PMG::Config;
 use PMG::MailQueue;
+use PMG::Unpack;
 
 use Proxmox::SMTP;
-use Proxmox::Unpack;
 
 use base qw(Net::Server::PreFork);