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.07.13.23.14.30;	author ed;	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/ApacheModules.pm
# -----------------------
# The companion to CVSloginfo - ensures the Web directories are properly
# set up.

package Helm::ApacheModules;

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

use strict;
use Helm::TableSync;

use Rcs;

# N.B.: We run as cvs_user, not apache_user, because we are dealing with
# files that will be modified by CVS.
sub user {
    my ($class, $db) = @@_;
    return $db->config('cvs_user');
}

# update Helm::CVSUsers $db;
sub update {
    my ($class, $db) = @@_;
    my $cvsroot = $db->config('cvs_cvsroot');
    my $cvsbin = $db->config('cvs_cvsbin');
    my $htdocs = $db->config('apache_htdocs');

    my $ts = new Helm::TableSync($db, 'module_website',
				   [qw(project module)],
				   "$htdocs/tigris-web-modules",
				   \&_map_web_module);
    $ts->check([$cvsroot, $cvsbin, $htdocs], \&_add_web_module,
	       \&_del_web_module, undef, []);
}

# Map the name of the module to the proper directory under htdocs
# $dir = _map_web_module($cookie, $db, [$project, $module]);
sub _map_web_module {
    my ($cookie, $db, $cols) = @@_;
    my ($project, $module) = @@$cols;

    return "$cookie->[2]/$project/$module";
}

sub _add_web_module {
    my ($cookie, $db, $cols, $dir) = @@_;
    my ($cvsroot, $cvsbin, $htdocs) = @@$cookie;
    my ($project, $module) = @@$cols;

    # Use CVS to export the module if it does not exist
    my $pdir = "$htdocs/$project";
    mkdir $pdir, 0775 unless -e $pdir;
    unless (-e $dir) {
	system("$cvsbin/cvs -d $cvsroot -Q checkout -d $dir $project/$module")
	== 0 or die "CVS did not run successfully: $!\n";
    }
    chmod 0775, "$pdir/$module";
}

sub _del_web_module {
    my ($cookie, $db, $cols, $dir) = @@_;
    my ($cvsroot, $cvsbin, $htdocs) = @@$cookie;
    my ($project, $module) = @@$cols;

    if (-d $dir) {
	# The -Q option, besides quieting CVS, also does not make
	# it prompt for action
	system("$cvsbin/cvs -d $cvsroot -Q release -d $dir") == 0
	    or die "CVS did not run successfully: $!\n";
    } elsif (-e $dir) {
	die "$dir exists, but is not a directory\n";
    }
}

# Nothing special beyond updating
sub add_project {
}

# Remove the entire project directory
sub del_project {
    my ($db, $project) = @@_;
    my $htdocs = $db->config('cvs_cvsroot');

    my $dir = "$htdocs/$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
@make this directory group writable so tigrisq can create the mhonarc
archive directories.
@
text
@@


1.2
log
@Added tigris.org license
PR:
Obtained from:
Submitted by:
Reviewed by:
@
text
@d106 1
@


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.
#

a60 1
    chmod 0775, "$pdir/$module";
@


