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

1.7
date	2001.01.05.23.31.11;	author kmaples;	state Exp;
branches;
next	1.6;

1.6
date	2001.01.04.18.25.34;	author kmaples;	state Exp;
branches;
next	1.5;

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

1.4
date	2000.09.14.19.02.22;	author kmaples;	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.33;	author dlr;	state Exp;
branches;
next	1.1.1.2;

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


desc
@@


1.9
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 -wU

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

# cvs-project-edit
# $Id: cvs-project-edit,v 1.7 2001/01/05 23:31:11 kmaples Exp $
# --------------------
# Provide operations for CVS as part of Tigris

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 $sandbox            = $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/;

# Paths and files derived from @@ARGV:
my $tigris_rep    = 'data/helm/cvs/repository';      # static portion off sbx
my $cvsroot       = "$sandbox/$tigris_rep";
my $project_dir   = "$cvsroot/$project_name";
my $new_project_dir = "$cvsroot/$new_project_name";

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

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


if(-d $project_dir && -d $new_project_dir){
    print "$script_name: directories $project_name and $new_project_name both exist\n";
    exit(1);
} elsif(-d $new_project_dir) {
    print "$script_name: $new_project_dir already exists\n";
    exit(0);
} else {
    # All's well with the world; move the project dir:
    rename($project_dir, $new_project_dir) 
        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);
}
__END__

@


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

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

d81 1
a81 1
print_log(1, "$script_name: beginning for project $project_name\n");
d85 1
a85 1
    print_log(1, "$script_name: directories $project_name and $new_project_name both exist\n");
d88 1
a88 1
    print_log(1, "$script_name: $new_project_dir already exists\n");
d94 1
a94 1
    print_log(1, "$script_name: renamed $project_name to $new_project_name\n");
@


1.7
log
@It may or may not be a good idea, but here it is - the ability to edit
(rename) projects.
@
text
@d50 1
a50 1
# $Id: cvs-project-edit,v 1.6 2001/01/04 18:25:34 kmaples Exp $
d56 5
d86 1
a86 1
print "$script_name: beginning for project $project_name\n";
d90 1
a90 1
    print "$script_name: directories $project_name and $new_project_name both exist\n";
d93 1
a93 1
    print "$script_name: $new_project_dir already exists\n";
d99 1
a99 1
    print "$script_name: renamed $project_name to $new_project_name\n";
@


1.6
log
@Out with the unnecessary, in with the preparatory.
@
text
@d50 1
a50 1
# $Id: cvs-project-edit,v 1.5 2000/11/12 22:57:33 dlr Exp $
d75 1
d77 23
a99 3



@


1.5
log
@Resolved merge conflicts.
@
text
@d50 1
a50 1
# $Id: cvs-project-edit,v 1.1.1.1 2000/11/12 21:17:33 dlr Exp $
d52 1
a52 1
# Provide operations for CVS as past of Tigris
d61 18
a79 2
print "cvs: do nothing, the project name cannot change\n";
# TODO: private projects could be handled differently
@


1.4
log
@Miscellaneous changes to resolve tainting problems with setuid scripts.
CVS child scripts are now, unfortunately, permitted to perform unsafe ops.
@
text
@d50 1
a50 1
# $Id: cvs-project-edit,v 1.3 2000/09/13 22:33:46 kmaples Exp $
@


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
@d1 1
a1 1
#!/usr/bin/perl -w
d50 1
a50 1
# $Id: cvs-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
@d50 1
a50 1
# $Id: cvs-project-edit,v 1.1 2000/04/29 00:04:10 jrobbins Exp $
d58 3
d64 18
@


1.1
log
@initial checkin
@
text
@d50 1
a50 1
# $Id: cvs.pm,v 1.1 2000/03/24 20:33:58 jrobbins Exp $
d56 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
@d1 1
a1 1
#!/usr/bin/perl -wU
d50 1
a50 1
# $Id: cvs-project-edit,v 1.1 2000/10/05 20:05:49 jrobbins Exp $
a55 5
# For the sake of -T:
$ENV{'PATH'} = "/bin:/usr/bin:/usr/local/bin";
# Detaint the args by brute force:
@@ARGV = detaint_array(@@ARGV);

a58 18

# 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);
}
__END__
@


1.1.1.2
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@d50 1
a50 1
# $Id: cvs-project-edit,v 1.7 2001/01/05 23:31:11 kmaples Exp $
d52 1
a52 1
# Provide operations for CVS as part of Tigris
a60 39
# Process arguments
my $sandbox            = $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/;

# Paths and files derived from @@ARGV:
my $tigris_rep    = 'data/helm/cvs/repository';      # static portion off sbx
my $cvsroot       = "$sandbox/$tigris_rep";
my $project_dir   = "$cvsroot/$project_name";
my $new_project_dir = "$cvsroot/$new_project_name";

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

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


if(-d $project_dir && -d $new_project_dir){
    print "$script_name: directories $project_name and $new_project_name both exist\n";
    exit(1);
} elsif(-d $new_project_dir) {
    print "$script_name: $new_project_dir already exists\n";
    exit(0);
} else {
    # All's well with the world; move the project dir:
    rename($project_dir, $new_project_dir) 
        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
#---------------------------------------------------------------
d62 2
@


