From: <mh...@us...> - 2003-05-24 14:42:11
|
Update of /cvsroot/phpwebsite-comm/CVSROOT In directory sc8-pr-cvs1:/tmp/cvs-serv13246 Added Files: enforce_directories enforce_naming enforce_permissions Log Message: added enforce scripts from sitedocs project --- NEW FILE: enforce_directories --- #!/bin/sh find /cvsroot/s/si/sitedocs -type d -name CVS -exec rm -Rf {} \; >/dev/null 2>&1 find /cvsroot/s/si/sitedocs -type d -name cvs -exec rm -Rf {} \; >/dev/null 2>&1 --- NEW FILE: enforce_naming --- #!/usr/bin/perl # enforce-naming.pl - Verify undesireable files (by name) are not committed # Copyright (C) 2002 Open Source Development Network. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. # Original version by: Jacob Moorman <mo...@so...> # $Id: enforce_naming,v 1.1 2003/05/24 14:41:09 mhnoyes Exp $ # This script will check for common naming violations which can result # in painful issues for end-users of this repository. # 1. Verify that we do not create a file named CVS or cvs # 2. Verify that we do not create a file with the same name as a directory # 3. Verify that all filenames, except Makefile, are lowercase # 4. Verify that all Makefiles are mixed case, properly $exit_val = 0; # Determine the directory of the commit $directory = @ARGV[0]; shift @ARGV; for (@ARGV) { # Verify that we do not create a file named CVS or cvs. if ($_ eq "cvs" or $_ eq "CVS") { print "Creation of files named CVS or cvs is prohibited. "; print "($directory/$_)\n"; $exit_val = 1; } # Verify that all files are lowercase, except Makefiles if ((substr($_, 0, 8) ne "Makefile") and (lc($_) ne $_)) { print "All filenames must be completely lowercase except "; print "Makefiles. ($directory/$_)\n"; $exit_val = 1; } # Verify that all Makefiles are properly mixed case (M UC, the rest LC) if ((substr(lc($_), 0, 8) eq "makefile") and (substr($_, 0, 8) ne "Makefile")) { print "All Makefiles must have proper case (M should be "; print "upper-case). ($directory/$_)\n"; $exit_val = 1; } # Verify that we are not committing a file of the same name # as a directory if (-d "$directory/$_") { print "There is already a directory of the same name as the "; print "file you are trying to commit. ($directory/$_)\n"; $exit_val = 1; } next; } exit ($exit_val); --- NEW FILE: enforce_permissions --- #!/bin/sh # This script will be used to enforce proper permissions on all files within # the repository. find /cvsroot/s/si/sitedocs -type d -exec chmod 2775 {} \; find /cvsroot/s/si/sitedocs/docshell/scripts -type f -exec chmod 0775 {} \; find /cvsroot/s/si/sitedocs/sitedocs/scripts -type f -exec chmod 0775 {} \; find /cvsroot/s/si/sitedocs/sitedocs -type f -name *.xml -exec chmod 0664 {} \; find /cvsroot/s/si/sitedocs/sitedocs -type f -name Makefile -exec chmod 0664 {} \; |