i18n/src/messenger/pack.pl
Evgeny Gryaznov c83b6da0e0 beta 2
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@224 c66351dc-e62f-0410-b875-e3a5c0b9693f
2008-12-09 01:44:01 +00:00

46 lines
1.2 KiB
Perl
Executable File

#!/usr/bin/perl
##################################################################
# Arguments
##################################################################
$targetFolder = "deploy";
$suffix = "150b2";
##################################################################
# Copies tree into target folder, preprocess .phps
##################################################################
sub process_dir($$) {
my ($from,$to) = @_;
opendir(DIR, $from) || die "can't opendir $from: $!";
my @content = readdir(DIR);
closedir DIR;
mkdir $to;
for(grep { -f "$from/$_" && ($_ !~ /^\./ || $_ eq ".htaccess" || $_ eq ".keep") } @content) {
my ($source,$target) = ("$from/$_","$to/$_");
open (IN,"$source");
binmode(IN);
open (OUT,">$target");
binmode(OUT);
print OUT $buffer while (read (IN,$buffer,65536));
}
for(grep { -d "$from/$_" && $_ !~ /^\./ } @content) {
process_dir("$from/$_","$to/$_");
}
}
##################################################################
# Main
##################################################################
die "Target folder exists: $targetFolder" if -e $targetFolder;
process_dir("./webim", $targetFolder);
chdir $targetFolder;
`zip -r ../webim$suffix.zip *`;