[vhffs-dev] [1971] vhffs core object can be fetch from object instance, simplified archive_targz prototype |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1971
Author: gradator
Date: 2012-01-29 14:42:01 +0100 (Sun, 29 Jan 2012)
Log Message:
-----------
vhffs core object can be fetch from object instance, simplified archive_targz prototype
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Robots/Bazaar.pm
trunk/vhffs-api/src/Vhffs/Robots/Cvs.pm
trunk/vhffs-api/src/Vhffs/Robots/Git.pm
trunk/vhffs-api/src/Vhffs/Robots/Mercurial.pm
trunk/vhffs-api/src/Vhffs/Robots/Repository.pm
trunk/vhffs-api/src/Vhffs/Robots/Svn.pm
trunk/vhffs-api/src/Vhffs/Robots/Web.pm
trunk/vhffs-api/src/Vhffs/Robots.pm
trunk/vhffs-robots/src/mail_deleteboxes.pl
Modified: trunk/vhffs-api/src/Vhffs/Robots/Bazaar.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Bazaar.pm 2012-01-29 02:42:40 UTC (rev 1970)
+++ trunk/vhffs-api/src/Vhffs/Robots/Bazaar.pm 2012-01-29 13:42:01 UTC (rev 1971)
@@ -99,7 +99,7 @@
# Remove Bazaar dir and group dir if empty
my $dir = $bazaar->get_dir;
- Vhffs::Robots::archive_targz( $bazaar->{main}, $bazaar, $dir );
+ Vhffs::Robots::archive_targz( $bazaar, $dir );
File::Path::rmtree($dir) if(-d $dir);
my $groupdir = dirname($dir);
Modified: trunk/vhffs-api/src/Vhffs/Robots/Cvs.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Cvs.pm 2012-01-29 02:42:40 UTC (rev 1970)
+++ trunk/vhffs-api/src/Vhffs/Robots/Cvs.pm 2012-01-29 13:42:01 UTC (rev 1971)
@@ -86,7 +86,7 @@
return -1 unless defined $cvs;
my $dir = $cvs->get_dir;
- Vhffs::Robots::archive_targz( $cvs->{main}, $cvs, $dir );
+ Vhffs::Robots::archive_targz( $cvs, $dir );
File::Path::rmtree($dir) if(-d $dir);
# Remove parent dir if empty (i.e. this group has no move CVSes).
Modified: trunk/vhffs-api/src/Vhffs/Robots/Git.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Git.pm 2012-01-29 02:42:40 UTC (rev 1970)
+++ trunk/vhffs-api/src/Vhffs/Robots/Git.pm 2012-01-29 13:42:01 UTC (rev 1971)
@@ -115,7 +115,7 @@
# Remove GIT dir and group dir if empty
my $dir = $git->get_dir;
- Vhffs::Robots::archive_targz( $git->{main}, $git, $dir );
+ Vhffs::Robots::archive_targz( $git, $dir );
File::Path::rmtree($dir) if(-d $dir);
my $groupdir = dirname($dir);
Modified: trunk/vhffs-api/src/Vhffs/Robots/Mercurial.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Mercurial.pm 2012-01-29 02:42:40 UTC (rev 1970)
+++ trunk/vhffs-api/src/Vhffs/Robots/Mercurial.pm 2012-01-29 13:42:01 UTC (rev 1971)
@@ -141,7 +141,7 @@
# Remove Mercurial dir and group dir if empty
my $dir = $mercurial->get_dir;
- Vhffs::Robots::archive_targz( $mercurial->{main}, $mercurial, $dir );
+ Vhffs::Robots::archive_targz( $mercurial, $dir );
File::Path::rmtree($dir) if(-d $dir);
my $groupdir = dirname($dir);
Modified: trunk/vhffs-api/src/Vhffs/Robots/Repository.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Repository.pm 2012-01-29 02:42:40 UTC (rev 1970)
+++ trunk/vhffs-api/src/Vhffs/Robots/Repository.pm 2012-01-29 13:42:01 UTC (rev 1971)
@@ -68,7 +68,7 @@
my $vhffs = $repo->{'main'};
my $dir = $repo->get_dir;
- Vhffs::Robots::archive_targz( $vhffs, $repo, $dir );
+ Vhffs::Robots::archive_targz( $repo, $dir );
# erase all files
my $cmd = "rm -rf $dir";
Modified: trunk/vhffs-api/src/Vhffs/Robots/Svn.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Svn.pm 2012-01-29 02:42:40 UTC (rev 1970)
+++ trunk/vhffs-api/src/Vhffs/Robots/Svn.pm 2012-01-29 13:42:01 UTC (rev 1971)
@@ -170,7 +170,7 @@
return -1 unless defined $svn;
my $dir = $svn->get_dir;
- Vhffs::Robots::archive_targz( $svn->{main}, $svn, $dir );
+ Vhffs::Robots::archive_targz( $svn, $dir );
File::Path::rmtree($dir);
my $group_dir = dirname($dir);
Modified: trunk/vhffs-api/src/Vhffs/Robots/Web.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots/Web.pm 2012-01-29 02:42:40 UTC (rev 1970)
+++ trunk/vhffs-api/src/Vhffs/Robots/Web.pm 2012-01-29 13:42:01 UTC (rev 1971)
@@ -107,7 +107,7 @@
$web->add_history( "Webdir is now unlinked from the group directory");
}
- Vhffs::Robots::archive_targz( $main, $web, $webdir );
+ Vhffs::Robots::archive_targz( $web, $webdir );
File::Path::rmtree( $webdir );
my $parent = dirname($webdir);
Modified: trunk/vhffs-api/src/Vhffs/Robots.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Robots.pm 2012-01-29 02:42:40 UTC (rev 1970)
+++ trunk/vhffs-api/src/Vhffs/Robots.pm 2012-01-29 13:42:01 UTC (rev 1971)
@@ -143,15 +143,14 @@
}
sub archive_targz {
- my $vhffs = shift;
my $object = shift;
my $dir = shift;
my $namepart = shift;
my $ret;
- return undef unless defined $dir and -d $dir;
+ return undef unless defined $object and defined $dir and -d $dir;
- my $robotconf = $vhffs->get_config->get_robots;
+ my $robotconf = $object->{main}->get_config->get_robots;
return undef unless defined $robotconf and Vhffs::Functions::strtobool( $robotconf->{'archive_deleted'} ) and defined $robotconf->{'archive_deleted_path'} and -d $robotconf->{'archive_deleted_path'};
my $oldcwd = getcwd();
Modified: trunk/vhffs-robots/src/mail_deleteboxes.pl
===================================================================
--- trunk/vhffs-robots/src/mail_deleteboxes.pl 2012-01-29 02:42:40 UTC (rev 1970)
+++ trunk/vhffs-robots/src/mail_deleteboxes.pl 2012-01-29 13:42:01 UTC (rev 1971)
@@ -55,7 +55,7 @@
next unless defined $mail;
my $dir = $mail->get_box_dir( $b->{local_part} );
- Vhffs::Robots::archive_targz( $vhffs, $mail, $dir, [ $b->{local_part} ] );
+ Vhffs::Robots::archive_targz( $mail, $dir, [ $b->{local_part} ] );
if( -d $dir ) {
File::Path::rmtree($dir);