SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from Other perl-ProjectBuilder-0.16.1-1.sles10.noarch.rpm

ProjectBuilder::VCS

Section: User Contributed Perl Documentation (3)
Updated: 2020-04-03
Index 

NAME

ProjectBuilder::VCS, part of project-builder.org 

DESCRIPTION

This modules provides version control system functions. 

USAGE

pb_vcs_init
This function setup the environment for the VCS system related to the URL given by the pbprojurl configuration parameter.The potential parameter indicates whether we should inititate the context or not.It sets up environement variables (PBPROJDIR, PBDIR, PBREVISION, PBCMSLOGFILE)
pb_vcs_export
This function exports a VCS content to a directory.The first parameter is the URL of the VCS content.The second parameter is the directory in which it is locally exposed (result of a checkout). If undef, then use the original VCS content.The third parameter is the directory where we want to deliver it (result of export).It returns the original tar file if we need to preserve it and undef if we use the produced one.
pb_vcs_get_uri
This function is only called with a real VCS system and gives the URL stored in the checked out directory.The first parameter is the schema of the VCS systems (svn, cvs, svn+ssh, ...)The second parameter is the directory in which it is locally exposed (result of a checkout).
pb_vcs_copy
This function copies a VCS content to another.The first parameter is the schema of the VCS systems (svn, cvs, svn+ssh, ...)The second parameter is the URL of the original VCS content.The third parameter is the URL of the destination VCS content.

Only coded for SVN now as used for pbconf itself not the project

pb_vcs_checkout
This function checks a VCS content out to a directory.The first parameter is the schema of the VCS systems (svn, cvs, svn+ssh, ...)The second parameter is the URL of the VCS content.The third parameter is the directory where we want to deliver it (result of export).
pb_vcs_up
This function updates a local directory with the VCS content.The first parameter is the schema of the VCS systems (svn, cvs, svn+ssh, ...)The second parameter is the list of directory to update.
pb_vcs_checkin
This function updates a VCS content from a local directory.The first parameter is the schema of the VCS systems (svn, cvs, svn+ssh, ...)The second parameter is the directory to update from.The third parameter is the comment to pass during the commit
pb_vcs_add_if_not_in
This function adds to a VCS content from a local directory if the content wasn't already managed under the VCS.The first parameter is the schema of the VCS systems (svn, cvs, svn+ssh, ...)The second parameter is a list of directory/file to add.
pb_vcs_add
This function adds to a VCS content from a local directory.The first parameter is the schema of the VCS systems (svn, cvs, svn+ssh, ...)The second parameter is a list of directory/file to add.
pb_vcs_isdiff
This function returns a integer indicating the number of differences between the VCS content and the local directory where it's checked out.The first parameter is the schema of the VCS systems (svn, cvs, svn+ssh, ...)The second parameter is the directory to consider.
pb_vcs_mkdir
This function makes a VCS directoryThe first parameter is the schema of the VCS systems (svn, cvs, svn+ssh, ...)The second parameter is the directory to create.The third parameter is the comment to pass during the commit
pb_vcs_compliant
This function checks the compliance of the project and the pbconf directory.The first parameter is the key name of the value that needs to be read in the configuration file.The second parameter is the environment variable this key will populate.The third parameter is the location of the pbconf dir.The fourth parameter is the URI of the VCS content related to the pbconf dir.The fifth parameter indicates whether we should inititate the context or not.

Only called for PBCONFDIR and PBDIR=cut

sub pb_vcs_compliant {

my $param = shift;my $envar = shift;my $defdir = shift;my $uri = shift;my $pbinit = shift;my %pdir;

pb_log(1,``pb_vcs_compliant: envar: $envar - defdir: $defdir - uri: $uri\n'');my ($pdir) = pb_conf_get_if($param) if (defined $param);if (defined $pdir) {        %pdir = %$pdir;
}

if ((defined $pdir) && (%pdir) && (defined $pdir{$ENV{'PBPROJ'}})) {        # That's always the environment variable that will be used
        $ENV{$envar} = $pdir{$ENV{'PBPROJ'}};
} else {        if (defined $param) {
                pb_log(1,``WARNING: no $param defined, using $defdir\n'');
                pb_log(1,`` Please create a $param reference for project $ENV{'PBPROJ'} in $ENV{'PBETC'}\n'');
                pb_log(1,`` if you want to use another directory\n'');
        }
        $ENV{$envar} = ``$defdir'';
}

# Expand potential env variable in iteval { $ENV{$envar} =~ s/(\$ENV.+\})/$1/eeg };pb_log(2,``$envar: $ENV{$envar}\n'');my $exportdir = $ENV{$envar};

my ($scheme, $account, $host, $port, $path) = pb_get_uri($uri);

if (($scheme !~ /^cvs/) && ($scheme !~ /^svn/) && ($scheme !~ /^svk/) && ($scheme !~ /^hg/) && ($scheme !~ /^git/)) {        # Do not compare if it's not a real cms
        pb_log(1,``pb_vcs_compliant useless\n'');
        return;
} elsif ((defined $pbinit) && (! -d ``$exportdir'')) {        # Either we have a version in the uri, and it should be the same
        # as the one in the envar. Or we should add the version to the uri
        # But not if it's git as it manages version branches internally
        if ((basename($uri) ne basename($exportdir)) && ($scheme !~ /git/)) {
                $uri .= ``/''.basename($exportdir);
        }

        pb_mkdir_p("$exportdir");        # Should only have pbconf        if ((pb_path_nbfiles(dirname($exportdir)) > 1) && ($envar eq 'PBCONFDIR')) {                confess("Directory ".dirname($exportdir)." has content.\nPlease remove it if you want to use that directory\n");        }        if (pb_path_nbfiles("$exportdir") > 0) {                confess("Directory $exportdir has content.\nPlease remove it if you want to use that directory\n");        }        if ($envar eq 'PBCONFDIR') {                # Remove the potential pbconf part if we treat pbconfdir                $exportdir =~ s|/pbconf[/]*||;                $uri =~ s|/pbconf[/]*||;        }        # Don't add content here as it may conflict later on with PBROOT addition        # Done in Env.pm         pb_log(0,"Trying to check out (may fail) ".$uri."\n");        pb_vcs_checkout($scheme,$uri,$exportdir);        if (($envar eq 'PBCONFDIR') && (pb_path_nbfiles("$exportdir/pbconf") == 0)) {                # Export failed, because there is nothing yet in the repo                # we now need to clean stuff before doing mkdir to avoid conflicts                pb_rm_rf($exportdir);                pb_log(0,"Pushing first $uri\n");                pb_vcs_mkdir($scheme,$uri,"Creating structure directory");                pb_vcs_mkdir($scheme,"$uri/pbconf","Creating structure sub directory");                pb_log(0,"Re-Trying to check out again $uri\n");                pb_vcs_up($scheme,$exportdir);        }        pb_log(0,"Done\n");} else {        pb_log(1,"$uri found locally, checking content\n");        my $cmsurl = pb_vcs_get_uri($scheme,$ENV{$envar});        my ($scheme2, $account2, $host2, $port2, $path2) = pb_get_uri($cmsurl);        # For svk, scheme doesn't appear in svk info so remove it here in uri coming from conf file         # which needs it to trigger correct behaviour        $uri =~ s/^svk://;        if ($scheme2 =~ /^git/) {                # remove schema from `git+file:` and `git+dir:` urls                # TODO: handle query-parameters                $uri =~ s/^git\+(file|dir):[\/]*//;                # Expand potential env variable in it -- this is required due to the consistency check                $uri =~ s/(\$ENV.+\})/$1/eeg;        } elsif ($scheme2 =~ /^hg/) {                # This VCS manages branches internally not with different tree structures                # Assuming it's correct for now.                return;        }        # Remove git+ part if only in scheme        $uri =~ s/^git\+// if (($scheme =~ /^git\+/) && ($scheme2 !~ /^git\+/));

        if ($cmsurl ne $uri) {                # The local content doesn't correpond to the repository                pb_log(0,"ERROR: Inconsistency detected:\n");                pb_log(0,"       * $ENV{$envar} ($envar) refers to $cmsurl but\n");                pb_log(0,"       * $ENV{'PBETC'} refers to $uri\n");                die "Project $ENV{'PBPROJ'} is not Project-Builder compliant.";        } else {                pb_log(1,"Content correct - doing nothing - you may want to update your repository however\n");                # they match - do nothing - there may be local changes        }}pb_log(2,"pb_vcs_compliant end\n");}
pb_vcs_conf_update_v0
This function transform the old configuration v0 file as first param into a new v1 one as second param by calling a COnf.pm function and then adds the resulting file into VCS
 

WEB SITES

The main Web site of the project is available at <http://www.project-builder.org/>. Bug reports should be filled using the trac instance of the project at <http://trac.project-builder.org/>. 

USER MAILING LIST

None exists for the moment. 

AUTHORS

The Project-Builder.org team <http://trac.project-builder.org/> lead by Bruno Cornec <mailto:brunoAATTproject-builder.org>. 

COPYRIGHT

Project-Builder.org is distributed under the GPL v2.0 licensedescribed in the file "COPYING" included with the distribution.


 

Index

NAME
DESCRIPTION
USAGE
WEB SITES
USER MAILING LIST
AUTHORS
COPYRIGHT

This document was created byman2html,using the manual pages.