logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

RoPkg::Simba - the main class of simba

Author

       Subredu Manuel <diablo@iasi.roedu.net>

Bugs And Limitations

       No bugs known. For now, Simba can work only with rsync.

Configuration And Environment

       This  class  use  a configuration file. No environment variables are used.  The configuration file format
       and the complete list of options (with detailed explanations) can be  found  on  the  community  website:
       http://simba.packages.ro

Dependencies

Description

       This class encapsulates all the necesary code required to run Simba.

Diagnostics

       This module has his own tests in the t directory. To run the tests, unpack the source and use 'make test'
       command.

Incompatibilities

       Please check the Makefile.PL for a detalied list of dependencies and their versions.

Name

       RoPkg::Simba - the main class of simba

Perl Critic

       This module is perl critic level 2 compliant (with one exception)

See Also

       RoPkg::Simba::Mirror       RoPkg::Simba::Command       RoPkg::Simba::Exclude        RoPkg::Simba::Mirrors
       RoPkg::Simba::Commands RoPkg::Simba::Excludes

Subroutines/Methods

new()new() expects a hash ref as a parameter. The hash can contain (for the moment) only the cfgFile (the
       configuration file). All other hash keys are ignored.

   SimbaURL
       Returns the url with simba website

   VERSION
       Returns a string with simba version

   MirrorsNo($fields)
       returns the number of the mirrors from the database. The mirrors can be filtered using the $fields
       parameter (as documented in SQL::Abstract - where)

   Mirrors($fields)
       returns a array of RoPkg::Simba::Mirror initialized objects.  The mirrors can be filtered using the
       $fields parameter (as documented in SQL::Abstract - where)

   CommandsNo($fields)
       returns the number of commands from the database.  The commands can be filtered using the $fields
       parameter (as documented in SQL::Abstract - where)

   Commands
       returns a array of RoPkg::Simba::Command initialized objects.  The commands can be filtered using the
       $fields parameter (as documented in SQL::Abstract - where)

   ExcludeNo
       returns the number of excludes from the database.  The excludes can be filtered using the $fields
       parameter (as documented in SQL::Abstract - where)

   Excludes
       returns a array of RoPkg::Simba::Excludes initialized objects.  The excludes can be filtered using the
       $fields parameter (as documented in SQL::Abstract - where)

   LoadMirror($fields)
       load a mirror (and the related objects: command and exclude list) from the database and return a list of
       3 objects:

       the mirror object (RoPkg::Simba::Mirror)
       the command object (RoPkg::Simba::Command)
       the excludes object (RoPkg::Simba::Excludes)

       Ex:
        my ($mirror, $command, $excludes);

        ($mirror, $command, $excludes) = $simba->LoadMirror({ Name => 'debian'});

       The  mirrors  can be filtered using the $fields parameter (as documented in SQL::Abstract - where).  This
       method also checks if all necesary values are defined and well formed; for example checks if the  command
       file name really exists.

   Run($fields)
       The  most  used  method  by  simba.  This  method loads the mirror from the database, the command and the
       exclude list, builds the command line (with respect to username and password if necesary), signals mirror
       in progress, executes the command, parses the sync raw log and updates the database. Also, the  afterSync
       handler  callback  is registered to this method.  The mirrors can be filtered using the $fields parameter
       (as documented in SQL::Abstract - where).

   RunCallbacks($cbName,@mirrors)
       call the plugin methods for $cbName callback name.

   CheckDB()
       Checks if database has at least one mirror and one command defined.

   dbh()
       returns the database handler used by Simba

   dbo()
       returns the instance of RoPkg::DB object, used by Simba

   dbo_method()
       returns the method used by Simba's dbo() object to access the mirrors database.

Synopsis

        !#/usr/bin/perl

        use RoPkg::DB;
        use RoPkg::Simba;

        sub main {
          my $simba = new RoPkg::Simba(cfgFile => '/etc/simba.cfg');

          $simba->Run({ Name => 'debian'});
        }

        main();

Version

       0.8.4

See Also