- Timestamp:
- Nov 11, 2004, 10:55:09 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dasscm/dasscm
r189 r190 5 5 use strict; 6 6 7 use Env qw($DASSCM_PROD $DASSCM_REPO );7 use Env qw($DASSCM_PROD $DASSCM_REPO $USER $DASSCM_USER $DASSCM_PW); 8 8 use Cwd; 9 9 use File::Basename; … … 18 18 # 19 19 my $SVN = "svn "; 20 my $subversion_options = ""; 20 21 21 22 ##################################################################### … … 25 26 sub usage() 26 27 { 27 print "dasscm is intended to help versioning configuration files\n\n"; 28 29 print "usage: dasscm <subcommand> [options] [args]\n\n"; 28 print "usage: dasscm <subcommand> [options] [args]\n"; 29 print "\n"; 30 print "dasscm is intended to help versioning configuration files\n"; 31 print "\n"; 30 32 print "Available subcommands:\n"; 31 33 print " add <filename>\n"; … … 33 35 print " diff <filename>\n"; 34 36 print " help <subcommand>\n"; 37 print "\n"; 38 print "preperation:\n"; 39 print "check out the configuration repository, e.g.\n"; 40 print "svn checkout --no-auth-cache --username $USER https://dass-it.de/svn/lvermgeo/technical/config/\n"; 41 print "environment variables DASSCM_REPO, DASSCM_PROD and DASSCM_USER are evaluated.\n"; 42 print "\n"; 35 43 } 36 44 … … 48 56 # DASSCM_REPO 49 57 if ( ! $DASSCM_REPO ) { 50 die "Envirnonment variable DASSCM_REPO not set.\nSet DASSCM_REPO to the directory of the versioning system checkout for this machine. ";58 die "Envirnonment variable DASSCM_REPO not set.\nSet DASSCM_REPO to the directory of the versioning system checkout for this machine.\n"; 51 59 } 52 60 print "DASSCM_REPO: ".$DASSCM_REPO."\n"; … … 55 63 } 56 64 65 # User settings 66 # user root is not allowed for checkins. 67 # if user is root, DASSCM_USER has to be set, 68 # otherwise USER can be used 69 if ( "$USER" eq "root" ) { 70 if ( ! $DASSCM_USER ) { 71 die "Envirnonment variable DASSCM_USER not set.\nSet DASSCM_USER to your subversion user account.\n"; 72 } 73 $subversion_options .= " --no-auth-cache " 74 } elsif ( ! $DASSCM_USER ) { 75 $DASSCM_USER=$USER; 76 } 57 77 } 58 78 … … 147 167 148 168 # commit calls $EDITOR. uses "system" here, to display output 149 system( "$SVN commit $DASSCM_REPO" );169 system( "$SVN commit --username $DASSCM_USER $subversion_options $DASSCM_REPO" ); 150 170 # TODO: commit (-m) 151 171 … … 166 186 die; 167 187 } 188 189 copy( $filename_prod, $filename_repo ) or die $!; 168 190 169 191 # commit calls $EDITOR. uses "system" here, to display output 170 system( "$SVN commit $DASSCM_REPO" );192 system( "$SVN commit --username $DASSCM_USER $subversion_options $DASSCM_REPO" ); 171 193 # TODO: commit (-m) 172 194 }
Note:
See TracChangeset
for help on using the changeset viewer.