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;	state Exp;
branches;
next	1.5;

1.5
date	2001.01.05.23.31.11;	author kmaples;	state Exp;
branches;
next	1.4;

1.4
date	2000.11.12.22.57.33;	author dlr;	state Exp;
branches;
next	1.3;

1.3
date	2000.09.13.22.33.46;	author kmaples;	state Exp;
branches;
next	1.2;

1.2
date	2000.09.13.21.55.36;	author kmaples;	state Exp;
branches;
next	1.1;

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

1.1.1.1
date	2000.11.12.21.17.29;	author dlr;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2001.02.21.00.35.55;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.7
log
@Undoing yesterday's commit - my hastiness to implement some sort of logging
level notion into these scripts caused me great pain.
@
text
@#!/usr/bin/perl -w

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


# apache-project-edit
# $Id: apache-project-edit,v 1.5 2001/01/05 23:31:11 kmaples Exp $
# ----------------------
# Provides functions to update apache configuration files

use strict;

# For the sake of -T:
$ENV{'PATH'} = "/bin:/usr/bin:/usr/local/bin";
# Detaint the args by brute force:
@@ARGV = detaint_array(@@ARGV);

# Process arguments
my $htdoc_root       = $ARGV[0] || '';
my $project_name     = $ARGV[1] || '';
my $new_project_name = $ARGV[2] || '';

# Grab just the filename portion of this script to use as a
# log identifier:
my $script_name = $0;
$script_name =~ s/^.*\/([^\/]+)$/  $1/;

#---------------------------------------------------------------
# MAIN
#---------------------------------------------------------------

print "$script_name: beginning for project $project_name\n";

chdir($htdoc_root) || die "$script_name: couldn't chdir to $htdoc_root: $!\n";
print "$script_name: changed dir to $htdoc_root\n";

if((-d $project_name) && (-d $new_project_name)){
    print "$script_name: directories $project_name and $new_project_name both exist\n";
    exit(1);
} elsif(-d $new_project_name) {
    print "$script_name: $new_project_name already exists\n";
    exit(0);
} else {
    # All's well with the world; move the project dir:
    rename($project_name, $new_project_name)
        or die "$script_name: unable to rename $project_name to $new_project_name\n";
    print "$script_name: renamed $project_name to $new_project_name\n";
}

#---------------------------------------------------------------
# END MAIN
#---------------------------------------------------------------

# A crude attempt to overcome data tainting in perl:
#-------------------
sub detaint_array {
#-------------------
    my @@unclean = @@_;
    my @@clean = ();

    foreach(@@unclean){
        # We don't really have rules for this, so at the moment
        # this acts as a passthrough:
        $_ =~ m/^(.*)$/;
        push(@@clean,$1);
    }

    return(@@clean);
}

@


1.6
log
@Scripts now use IN_PRODUCTION to determine logging level
@
text
@a56 5
my $scripts_dir = $ENV{'SANDBOX'} . '/helm/perl/scripts';

require "$scripts_dir/ParentChildArgumentBridge.pl"
    or die "Require failed: $!\n";

d76 1
a76 1
print_log(1, "$script_name: beginning for project $project_name\n");
d79 1
a79 1
print_log(1, "$script_name: changed dir to $htdoc_root\n");
d82 1
a82 1
    print_log(1, "$script_name: directories $project_name and $new_project_name both exist\n");
d85 1
a85 1
    print_log(1, "$script_name: $new_project_name already exists\n");
d91 1
a91 1
    print_log(1, "$script_name: renamed $project_name to $new_project_name\n");
@


1.5
log
@It may or may not be a good idea, but here it is - the ability to edit
(rename) projects.
@
text
@d51 1
a51 1
# $Id: apache-project-edit,v 1.4 2000/11/12 22:57:33 dlr Exp $
d57 5
d81 1
a81 1
print "$script_name: beginning for project $project_name\n";
d84 1
a84 1
print "$script_name: changed dir to $htdoc_root\n";
d87 1
a87 1
    print "$script_name: directories $project_name and $new_project_name both exist\n";
d90 1
a90 1
    print "$script_name: $new_project_name already exists\n";
d96 1
a96 1
    print "$script_name: renamed $project_name to $new_project_name\n";
@


1.4
log
@Resolved merge conflicts.
@
text
@d51 1
a51 1
# $Id: apache-project-edit,v 1.1.1.1 2000/11/12 21:17:29 dlr Exp $
d62 35
a97 4

print "apache  : do nothing\n";

#TODO: private projects might have .htaccess guards? something else?
@


1.3
log
@Added crude subroutine to all child scripts to detaint @@ARGV.  At the moment,
this isn't doing any real detainting - just spitting the args back out to get
around warnings setuid generates.  Complications with the scripts' knowledge
of it's own working dir when it's called prevent the effective use of 'require'
in the child scripts, thus the redundancy of code in the children (for the time
being)
@
text
@d51 1
a51 1
# $Id: apache-project-edit,v 1.2 2000/09/13 21:55:36 kmaples Exp $
@


1.2
log
@Set PATH in child scripts to suppress -T warnings.
@
text
@d51 1
a51 1
# $Id: apache-project-edit,v 1.1 2000/04/29 00:04:10 jrobbins Exp $
d59 3
d67 17
@


1.1
log
@initial checkin
@
text
@d51 1
a51 1
# $Id: apache.pm,v 1.1 2000/03/24 20:33:58 jrobbins Exp $
d57 2
@


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
@d51 1
a51 1
# $Id: apache-project-edit,v 1.1 2000/10/05 20:05:49 jrobbins Exp $
a56 5
# For the sake of -T:
$ENV{'PATH'} = "/bin:/usr/bin:/usr/local/bin";
# Detaint the args by brute force:
@@ARGV = detaint_array(@@ARGV);

a61 17
# A crude attempt to overcome data tainting in perl:
#-------------------
sub detaint_array {
#-------------------
    my @@unclean = @@_;
    my @@clean = ();

    foreach(@@unclean){
        # We don't really have rules for this, so at the moment
        # this acts as a passthrough:
        $_ =~ m/^(.*)$/;
        push(@@clean,$1);
    }

    return(@@clean);
}

@


1.1.1.2
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d51 1
a51 1
# $Id: apache-project-edit,v 1.5 2001/01/05 23:31:11 kmaples Exp $
a61 35
# Process arguments
my $htdoc_root       = $ARGV[0] || '';
my $project_name     = $ARGV[1] || '';
my $new_project_name = $ARGV[2] || '';

# Grab just the filename portion of this script to use as a
# log identifier:
my $script_name = $0;
$script_name =~ s/^.*\/([^\/]+)$/  $1/;

#---------------------------------------------------------------
# MAIN
#---------------------------------------------------------------

print "$script_name: beginning for project $project_name\n";

chdir($htdoc_root) || die "$script_name: couldn't chdir to $htdoc_root: $!\n";
print "$script_name: changed dir to $htdoc_root\n";

if((-d $project_name) && (-d $new_project_name)){
    print "$script_name: directories $project_name and $new_project_name both exist\n";
    exit(1);
} elsif(-d $new_project_name) {
    print "$script_name: $new_project_name already exists\n";
    exit(0);
} else {
    # All's well with the world; move the project dir:
    rename($project_name, $new_project_name)
        or die "$script_name: unable to rename $project_name to $new_project_name\n";
    print "$script_name: renamed $project_name to $new_project_name\n";
}

#---------------------------------------------------------------
# END MAIN
#---------------------------------------------------------------
d63 4
@


