head	1.4;
access;
symbols
	TIGRIS_1_1_0RC2:1.3
	TIGRIS_1_1_0RC1:1.3
	TIGRIS_1_1:1.3.0.14
	TIGRIS_1_0_8:1.3
	TIGRIS_1_0_8RC3:1.3
	TIGRIS_1_0_8RC2:1.3
	TIGRIS_1_0_8RC1:1.3
	TIGRIS_1_0_7:1.3
	TIGRIS_1_0_7RC3:1.3
	TIGRIS_1_0_7RC2:1.3
	TIGRIS_1_0_7RC1:1.3
	TIGRIS_1_0_6:1.3
	TIGRIS_1_0_6RC5:1.3
	TIGRIS_1_0_6RC4:1.3
	TIGRIS_1_0_6RC3:1.3
	TIGRIS_1_0_6RC2:1.3
	TIGRIS_1_0_6RC1:1.3
	TIGRIS_1_0_5:1.3
	TIGRIS_1_0_5RC6:1.3
	TIGRIS_1_0_5RC5:1.3
	TIGRIS_1_0_5RC4:1.3
	TIGRIS_1_0_5RC3:1.3
	TIGRIS_1_0_5RC2:1.3
	TIGRIS_1_0_5RC1:1.3
	TIGRIS_1_0_4:1.3
	TIGRIS_1_0_3:1.3
	TIGRIS_1_0_2:1.3
	TIGRIS_1_0_1:1.3
	TIGRIS_1_0:1.3.0.16
	TIGRIS_1_0_0:1.3
	TIGRIS_1_0_0_RC1:1.3.0.12
	dlr:1.1.1
	TIGRIS_0_9_2_4:1.3
	TIGRIS_0_9_2_3:1.3
	HELM_PEER_PORT_BRANCH:1.1.1.1
	TURBINE_PEER:1.3
	TIGRIS_0_9_2_1:1.3
	TIGRIS_0_9_2:1.3.0.10
	TIGRIS_0_9_0:1.3.0.8
	TIGRIS_0_8_4:1.3.0.6
	NEWHELM:1.1.1.1
	TIGRIS_NOV_12_2000:1.1.1
	OLDHELM:1.3.0.4
	TIGRIS_NOV_11_2000:1.3
	TIGRIS_SEP_13_2000:1.3.0.2
	TIGRIS_BASELINE:1.3;
locks; strict;
comment	@# @;


1.4
date	2001.08.14.21.57.24;	author edk;	state dead;
branches;
next	1.3;

1.3
date	2000.08.29.01.09.21;	author dlr;	state Exp;
branches;
next	1.2;

1.2
date	2000.02.03.04.21.34;	author jrobbins;	state Exp;
branches;
next	1.1;

1.1
date	2000.01.30.03.22.37;	author jrobbins;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.11.12.21.17.03;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.4
log
@remove obsolete/non-functional scripts
@
text
@# ================================================================
# Copyright (c) 2000 Collab.Net.  All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 
# 3. The end-user documentation included with the redistribution, if
# any, must include the following acknowlegement: "This product includes
# software developed by Collab.Net (http://www.Collab.Net/)."
# Alternately, this acknowlegement may appear in the software itself, if
# and wherever such third-party acknowlegements normally appear.
# 
# 4. The hosted project names must not be used to endorse or promote
# products derived from this software without prior written
# permission. For written permission, please contact info@@collab.net.
# 
# 5. Products derived from this software may not use the "Tigris" name
# nor may "Tigris" appear in their names without prior written
# permission of Collab.Net.
# 
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ====================================================================
# 
# This software consists of voluntary contributions made by many
# individuals on behalf of Collab.Net.
#


# Helm/CVSloginfo.pm
# --------------------
# Ensure that the directories for each module exist. This may seem trivial,
# but it avoids the necessity of a cvs import for each module, and (of
# course) provides for actually deleting the files when the module is
# destroyed.

package Helm::CVSmodules;

use Helm::Updater;
@@ISA = qw(Helm::Updater);

use strict;
use Helm::TableSync;

sub user {
    my ($class, $db) = @@_;
    return $db->config('cvs_user');
}

# update Helm::CVSUsers $db;
# We just process the list of modules and add them. Trivial, really.
sub update {
    my ($class, $db) = @@_;
    my $cvsroot = $db->config('cvs_cvsroot');

    my $ts = new Helm::TableSync($db, 'project_modules',
				   [qw(project module)],
				   "$cvsroot/tigris-modules",
				   \&_map_module);
    $ts->check($cvsroot, \&_add_module, \&_del_module, undef, []);
}

# Map the name of the module to the directory name
# $dir = _map_module($cvsroot, $db, [$project $module]);
sub _map_module {
    my ($cvsroot, $db, $cols) = @@_;
    my ($project, $module) = @@$cols;

    return "$cvsroot/$project/$module";
}

# Add a module by adding the project and module directories
# _add_module($cvsroot, $db, $cols, $dir);
sub _add_module {
    my ($cvsroot, $db, $cols, $dir) = @@_;
    my ($project, $module) = @@$cols;

    if (-e $dir) {
	die "$dir exists, but is not a directory\n" unless -d $dir;
    } else {
	my $pdir = "$cvsroot/$project";
	if (-e $pdir) {
	    die "$pdir exists, but is not a directory\n" unless -d $pdir;
	} else {
	    mkdir $pdir, 0775;
	}
	mkdir $dir, 0775;
    }
}

# Delete a module by removing its directory
# _del_module($cvsroot, $db, $cols, $dir)
sub _del_module {
    my ($cvsroot, $db, $cols, $dir) = @@_;

    if (-d $dir) {
	# See comment in QmailLists.pm - this is the easiest way
	system("rm -rf $dir");
    } elsif (-e $dir) {
	die "$dir exists, but is not a directory\n";
    }
}

# When adding a project, nothing need be done - the directories will
# be created by update()
sub add_project {
    # Calling print() in a CGI script results in invalid HTTP headers.
    #print "CVSmodules add_project called, does nothing\n";
}

# However, when deleting a project, we need to remove the CVS files
# for that project. All of them. The GUI had darn well better have an
# "are-you-sure" button. And keep backups.
sub del_project {
    my ($db, $project) = @@_;
    my $cvsroot = $db->config('cvs_cvsroot');

    my $dir = "$cvsroot/$project";
    if (-d $dir) {
	system("/bin/rm -rf $dir");
    } elsif (-e $dir) {
	die "$dir exists, but is not a directory\n";
    }

    return undef;
}
@


1.3
log
@Trouble adding project.
@
text
@@


1.2
log
@Added tigris.org license
PR:
Obtained from:
Submitted by:
Reviewed by:
@
text
@d125 2
a126 1
    print "CVSmodules add_project called, does nothing\n";
@


1.1
log
@initial checkin
@
text
@d1 46
a46 1
# Copyright (c) 2000 Collab.Net, Inc.
@


1.1.1.1
log
@Merging newhelm tree into helm, as per IZ issue #557.  Previous major version of helm is tagged TIGRIS_NOV_11_2000.
@
text
@d1 1
a1 46
# ================================================================
# Copyright (c) 2000 Collab.Net.  All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 
# 3. The end-user documentation included with the redistribution, if
# any, must include the following acknowlegement: "This product includes
# software developed by Collab.Net (http://www.Collab.Net/)."
# Alternately, this acknowlegement may appear in the software itself, if
# and wherever such third-party acknowlegements normally appear.
# 
# 4. The hosted project names must not be used to endorse or promote
# products derived from this software without prior written
# permission. For written permission, please contact info@@collab.net.
# 
# 5. Products derived from this software may not use the "Tigris" name
# nor may "Tigris" appear in their names without prior written
# permission of Collab.Net.
# 
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL COLLAB.NET OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ====================================================================
# 
# This software consists of voluntary contributions made by many
# individuals on behalf of Collab.Net.
#

d80 1
a80 2
    # Calling print() in a CGI script results in invalid HTTP headers.
    #print "CVSmodules add_project called, does nothing\n";
@


