svn is no longer used

This commit is contained in:
Eric Berberich 2012-12-21 14:45:07 +01:00
parent ad04e6e835
commit bbec5643f8
23 changed files with 0 additions and 6325 deletions

View File

@ -1,282 +0,0 @@
### On Unix-like systems, put this file in ~/.subversion folder.
###
### On Win32 systems, put this file in
### C:\Document and Settings\username\Application data\Subversion folder
### (by the way, Application Data is usually a hidden directory).
###
### This file configures various client-side behaviors.
###
### The commented-out examples below are intended to demonstrate
### how to use this file.
### Section for authentication and authorization customizations.
[auth]
### Set store-passwords to 'no' to avoid storing passwords in the
### auth/ area of your config directory. It defaults to 'yes'.
### Note that this option only prevents saving of *new* passwords;
### it doesn't invalidate existing passwords. (To do that, remove
### the cache files by hand as described in the Subversion book.)
# store-passwords = no
### Set store-auth-creds to 'no' to avoid storing any subversion
### credentials in the auth/ area of your config directory.
### It defaults to 'yes'. Note that this option only prevents
### saving of *new* credentials; it doesn't invalidate existing
### caches. (To do that, remove the cache files by hand.)
# store-auth-creds = no
### Section for configuring external helper applications.
[helpers]
### Set editor to the command used to invoke your text editor.
### This will override the environment variables that Subversion
### examines by default to find this information ($EDITOR,
### et al).
# editor-cmd = editor (vi, emacs, notepad, etc.)
### Set diff-cmd to the absolute path of your 'diff' program.
### This will override the compile-time default, which is to use
### Subversion's internal diff implementation.
# diff-cmd = diff_program (diff, gdiff, etc.)
### Set diff3-cmd to the absolute path of your 'diff3' program.
### This will override the compile-time default, which is to use
### Subversion's internal diff3 implementation.
# diff3-cmd = diff3_program (diff3, gdiff3, etc.)
### Set diff3-has-program-arg to 'true' or 'yes' if your 'diff3'
### program accepts the '--diff-program' option.
# diff3-has-program-arg = [true | false]
### Section for configuring tunnel agents.
[tunnels]
### Configure svn protocol tunnel schemes here. By default, only
### the 'ssh' scheme is defined. You can define other schemes to
### be used with 'svn+scheme://hostname/path' URLs. A scheme
### definition is simply a command, optionally prefixed by an
### environment variable name which can override the command if it
### is defined. The command (or environment variable) may contain
### arguments, using standard shell quoting for arguments with
### spaces. The command will be invoked as:
### <command> <hostname> svnserve -t
### (If the URL includes a username, then the hostname will be
### passed to the tunnel agent as <user>@<hostname>.) If the
### built-in ssh scheme were not predefined, it could be defined
### as:
# ssh = $SVN_SSH ssh
### If you wanted to define a new 'rsh' scheme, to be used with
### 'svn+rsh:' URLs, you could do so as follows:
# rsh = rsh
### Or, if you wanted to specify a full path and arguments:
# rsh = /path/to/rsh -l myusername
### On Windows, if you are specifying a full path to a command,
### use a forward slash (/) or a paired backslash (\\) as the
### path separator. A single backslash will be treated as an
### escape for the following character.
### Section for configuring miscelleneous Subversion options.
[miscellany]
## Set global-ignores to a set of whitespace-delimited globs
## which Subversion will ignore in its 'status' output.
global-ignores = *.bak *.bk? *.old .DS_Store *.a *.o *.lib *.dll *.exe *.so *.so.* debug release Debug Release x64 *.blg *.cgallog *.aux *.maf *.hax *.hlg *.ilg *.pdflg *.log *.toc *.cgallog.tmp* *.inc *.dvi *.mtc* *.idx ProgramOutput* ErrorOutput* CompilerOutput* error.txt *.ncb *.suo contents.obv .xvpics semantic.cache doc_ps doc_html doc_pdf *.moc .*~ *~ .#* *.user *.aps doc_doxygen CMakeCache.txt CMakeFiles cmake_install.cmake Doxyfile *.dir ALL_BUILD.vcproj ZERO_CHECK.vcproj gmon.* .qglviewer.xml *.moc_parameters *.cpp_parameters *_moc.cpp ui_*.h qrc_*.cxx *.sbr .dir-locals.el *.tmp *.ilk *.pdb *.exe.* Makefile *.cpp.noheader *.h.noheader *.h.filename *.cpp.filename .scm-urls *.exp *.resource.txt *.manifest *.manifest.res *.vcproj *.sln *.depends
### Set log-encoding to the default encoding for log messages
# log-encoding = latin1
### Set use-commit-times to make checkout/update/switch/revert
### put last-committed timestamps on every file touched.
# use-commit-times = yes
### Set no-unlock to prevent 'svn commit' from automatically
### releasing locks on files.
# no-unlock = yes
## Set enable-auto-props to 'yes' to enable automatic properties
## for 'svn add' and 'svn import', it defaults to 'no'.
## Automatic properties are defined in the section 'auto-props'.
enable-auto-props = yes
### Section for configuring automatic properties.
### The format of the entries is:
### file-name-pattern = propname[=value][;propname[=value]...]
### The file-name-pattern can contain wildcards (such as '*' and '?').
### Caveat: file-name-patterns are case insensitive but you cannot have 2 rules
### that differ only by case. Workaround: use [] in pattern (not at start of line!).
### All entries which match will be applied to the file.
###
### Set property "svn:eol-style=native" for text files (default is binary).
### Set "svn:keywords=Author Date Id Revision URL" for text files (default is binary).
### Set "svn:executable" for Unix executable files.
### Set "svn:mime-type" for binary files (else SVN will attempt to guess this property).
[auto-props]
# Plain text formats
*.txt = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.hlp = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
dont_submit = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
AUTHORS = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
maintainer = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
README = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
LICENSE = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
TODO = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
TO_DO = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
INSTALL = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
INSTALLATION = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
COPYRIGHT = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
KNOWN_PROBLEMS = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
NOTICE = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
COPYING = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
CHANGES = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.win32 = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.MacOSX = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.log = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.cfg = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.config = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
# HTML formats
*.htm = svn:eol-style=native;svn:keywords=Author Date Id Revision URL;svn:mime-type=text/html
*.html = svn:eol-style=native;svn:keywords=Author Date Id Revision URL;svn:mime-type=text/html
*.shtml = svn:eol-style=native;svn:keywords=Author Date Id Revision URL;svn:mime-type=text/html
*.xml = svn:eol-style=native;svn:keywords=Author Date Id Revision URL;svn:mime-type=text/xml
*.xsl = svn:eol-style=native;svn:keywords=Author Date Id Revision URL;svn:mime-type=text/xml
*.css = svn:eol-style=native;svn:keywords=Author Date Id Revision URL;svn:mime-type=text/css
*.dtd = svn:eol-style=native;svn:keywords=Author Date Id Revision URL; svn:mime-type=text/xml
.htaccess = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
.htgroup = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
.htpasswd = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
# Latex formats
*.tex = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.inputs = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.bib = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.bst = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.sty = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.fd = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.aw = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.awi = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.lw = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.nw = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.fw = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.fwi = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
# Script formats
*.sh = svn:eol-style=LF;svn:keywords=Author Date Id Revision URL;svn:executable
*.csh = svn:eol-style=LF;svn:keywords=Author Date Id Revision URL;svn:executable
*.bat = svn:eol-style=CRLF;svn:keywords=Author Date Id Revision URL
*.run = svn:eol-style=native;svn:keywords=Author Date Id Revision URL;svn:executable
*.pl = svn:eol-style=native;svn:keywords=Author Date Id Revision URL;svn:executable
*.pm = svn:eol-style=native;svn:keywords=Author Date Id Revision URL;svn:executable
*.py = svn:eol-style=native;svn:keywords=Author Date Id Revision URL;svn:executable
cgal_test_with_cmake = svn:eol-style=LF;svn:keywords=Author Date Id Revision URL;svn:executable
*.cmd = svn:eol-style=LF;svn:keywords=Author Date Id Revision URL
*.dpatch = svn:eol-style=native;svn:keywords=Author Date Id Revision URL;svn:executable
# Code formats
*.[cC] = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.cpp = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.cxx = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.xpm = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.cc = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.tcc = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.stage_* = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.h = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.hpp = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.inl = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.ipp = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.tcc = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.f = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.m = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.mema = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.y = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.lex = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
makefile = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
makefile.* = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
makefile_* = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
Make[Ff]ile = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
Make[Ff]ile.* = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
Make[Ff]ile_* = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.[Mm]akefile = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
GNUmakefile = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
Makefilevc = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.mak = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.mk = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.kdevelop = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.kdevelop.filelist = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.kdevses = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.kdevelop.pcs = svn:mime-type=application/octet-stream
*.dsp = svn:eol-style=CRLF;svn:keywords=Author Date Id Revision URL
*.dsw = svn:eol-style=CRLF;svn:keywords=Author Date Id Revision URL
*.vcproj = svn:eol-style=CRLF;svn:keywords=Author Date Id Revision URL
*.vc = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.sln = svn:eol-style=CRLF;svn:keywords=Author Date Id Revision URL
*.suo = svn:mime-type=application/octet-stream
*.def = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.rc = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.rc2 = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.reg = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.manifest = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.ini = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.dxy = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
Doxyfile = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
# Image formats
*.png = svn:mime-type=image/png
*.gif = svn:mime-type=image/gif
*.icns = svn:mime-type=application/octet-stream
*.jpg = svn:mime-type=image/jpeg
*.jpeg = svn:mime-type=image/jpeg
*.bmp = svn:mime-type=image/bmp
*.ico = svn:mime-type=image/x-icon
*.tif = svn:mime-type=image/tiff
*.tiff = svn:mime-type=image/tiff
*.pcx = svn:mime-type=application/octet-stream
*.xbm = svn:mime-type=application/octet-stream
*.ppm = svn:mime-type=application/octet-stream
*.fig = svn:mime-type=application/octet-stream
*.xfig = svn:mime-type=application/octet-stream
*.ltex = svn:mime-type=application/octet-stream
# Meshes and 3D formats
*.off = svn:mime-type=application/octet-stream
*.obj = svn:mime-type=application/octet-stream
*.mtl = svn:mime-type=application/octet-stream
*.dxf = svn:mime-type=application/octet-stream
*.poly = svn:mime-type=application/octet-stream
*.mesh = svn:mime-type=application/octet-stream
*.nef = svn:mime-type=application/octet-stream
*.nef3 = svn:mime-type=application/octet-stream
*.spheres = svn:mime-type=application/octet-stream
# Postscript formats
*.pdf = svn:mime-type=application/pdf
*.ai = svn:mime-type=application/postscript
*.eps = svn:mime-type=application/postscript
*.ps = svn:mime-type=application/postscript
*.pstex = svn:mime-type=application/postscript
*.pstex_t = svn:mime-type=application/postscript
*.ipe = svn:mime-type=application/postscript
*.ips = svn:mime-type=application/postscript
*.plot = svn:mime-type=application/postscript
# Binary executables
*.dll = svn:mime-type=application/octet-stream
*.a = svn:mime-type=application/octet-stream
*.o = svn:mime-type=application/octet-stream
*.so = svn:mime-type=application/octet-stream
*.lib = svn:mime-type=application/octet-stream
*.exe = svn:mime-type=application/octet-stream
# Other text based data formats
*.mps = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.bff = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.spec = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.nsi = svn:eol-style=native;svn:keywords=Author Date Id Revision URL
*.patch = svn:mime-type=text/x-diff
# Other binary data formats
*.gz = svn:mime-type=application/gzip
*.tgz = svn:mime-type=application/gzip
*.zip = svn:mime-type=application/zip
*.tar = svn:mime-type=application/octet-stream
*.odg = svn:mime-type=application/octet-stream
*.ppt = svn:mime-type=application/vnd.ms-powerpoint
*.doc = svn:mime-type=application/msword
*.rtf = svn:mime-type=application/rtf
*.mw = svn:mime-type=application/octet-stream
*.mws = svn:mime-type=application/octet-stream
*.sxw = svn:mime-type=application/octet-stream
*.pmproj = svn:mime-type=application/octet-stream

File diff suppressed because it is too large Load Diff

View File

@ -1,208 +0,0 @@
package Mail::Sender;
%Mail::Sender::CTypes =
(
#-------------------------------------<TEXT>-----
'HTML', "text/html",
'HTM', "text/html",
'STM', "text/html",
'SHTML', "text/html",
'TXT', "text/plain",
'PREF', "text/plain",
'AIS', "text/plain",
'RTX', "text/richtext",
'TSV', "text/tab-separated-values",
'NFO', "text/warez-info",
'ETX', "text/x-setext",
'SGML', "text/x-sgml",
'SGM', "text/x-sgml",
'TALK', "text/x-speech",
'CGI', "text/plain", # we want these two as text files
'PL', "text/plain", # and not application/x-httpd-cgi
#-------------------------------------<IMAGE>----
'COD', "image/cis-cod",
'FID', "image/fif",
'GIF', "image/gif",
'ICO', "image/ico",
'IEF', "image/ief",
'JPEG', "image/jpeg",
'JPG', "image/jpeg",
'JPE', "image/jpeg",
'PNG', "image/png",
'TIF', "image/tiff",
'TIFF', "image/tiff",
'MCF', "image/vasa",
'RAS', "image/x-cmu-raster",
'CMX', "image/x-cmx",
'PCD', "image/x-photo-cd",
'PNM', "image/x-portable-anymap",
'PBM', "image/x-portable-bitmap",
'PGM', "image/x-portable-graymap",
'PPM', "image/x-portable-pixmap",
'RGB', "image/x-rgb",
'XBM', "image/x-xbitmap",
'XPM', "image/x-xpixmap",
'XWD', "image/x-xwindowdump",
#-------------------------------------<APPS>-----
'EXE', "application/octet-stream",
'BIN', "application/octet-stream",
'DMS', "application/octet-stream",
'LHA', "application/octet-stream",
'CLASS', "application/octet-stream",
'DLL', "application/octet-stream",
'AAM', "application/x-authorware-map",
'AAS', "application/x-authorware-seg",
'AAB', "application/x-authorware-bin",
'VMD', "application/vocaltec-media-desc",
'VMF', "application/vocaltec-media-file",
'ASD', "application/astound",
'ASN', "application/astound",
'DWG', "application/autocad",
'DSP', "application/dsptype",
'DFX', "application/dsptype",
'EVY', "application/envoy",
'SPL', "application/futuresplash",
'IMD', "application/immedia",
'HQX', "application/mac-binhex40",
'CPT', "application/mac-compactpro",
'DOC', "application/msword",
'ODA', "application/oda",
'PDF', "application/pdf",
'AI', "application/postscript",
'EPS', "application/postscript",
'PS', "application/postscript",
'PPT', "application/powerpoint",
'RTF', "application/rtf",
'APM', "application/studiom",
'XAR', "application/vnd.xara",
'ANO', "application/x-annotator",
'ASP', "application/x-asap",
'CHAT', "application/x-chat",
'BCPIO', "application/x-bcpio",
'VCD', "application/x-cdlink",
'TGZ', "application/x-compressed",
'Z', "application/x-compress",
'CPIO', "application/x-cpio",
'PUZ', "application/x-crossword",
'CSH', "application/x-csh",
'DCR', "application/x-director",
'DIR', "application/x-director",
'DXR', "application/x-director",
'FGD', "application/x-director",
'DVI', "application/x-dvi",
'LIC', "application/x-enterlicense",
'EPB', "application/x-epublisher",
'FAXMGR', "application/x-fax-manager",
'FAXMGRJOB', "application/x-fax-manager-job",
'FM', "application/x-framemaker",
'FRAME', "application/x-framemaker",
'FRM', "application/x-framemaker",
'MAKER', "application/x-framemaker",
'GTAR', "application/x-gtar",
'GZ', "application/x-gzip",
'HDF', "application/x-hdf",
'INS', "application/x-insight",
'INSIGHT', "application/x-insight",
'INST', "application/x-install",
'IV', "application/x-inventor",
'JS', "application/x-javascript",
'SKP', "application/x-koan",
'SKD', "application/x-koan",
'SKT', "application/x-koan",
'SKM', "application/x-koan",
'LATEX', "application/x-latex",
'LICMGR', "application/x-licensemgr",
'MAIL', "application/x-mailfolder",
'MIF', "application/x-mailfolder",
'NC', "application/x-netcdf",
'CDF', "application/x-netcdf",
'SDS', "application/x-onlive",
'SGI-LPR', "application/x-sgi-lpr",
'SH', "application/x-sh",
'SHAR', "application/x-shar",
'SWF', "application/x-shockwave-flash",
'SPRITE', "application/x-sprite",
'SPR', "application/x-sprite",
'SIT', "application/x-stuffit",
'SV4CPIO', "application/x-sv4cpio",
'SV4CRC', "application/x-sv4crc",
'TAR', "application/x-tar",
'TARDIST', "application/x-tardist",
'TCL', "application/x-tcl",
'TEX', "application/x-tex",
'TEXINFO', "application/x-texinfo",
'TEXI', "application/x-texinfo",
'T', "application/x-troff",
'TR', "application/x-troff",
'TROFF', "application/x-troff",
'MAN', "application/x-troff-man",
'ME', "application/x-troff-me",
'MS', "application/x-troff-ms",
'TVM', "application/x-tvml",
'TVM', "application/x-tvml",
'USTAR', "application/x-ustar",
'SRC', "application/x-wais-source",
'WKZ', "application/x-wingz",
'ZIP', "application/x-zip-compressed",
'ZTARDIST', "application/x-ztardist",
#-------------------------------------<AUDIO>----
'AU', "audio/basic",
'SND', "audio/basic",
'ES', "audio/echospeech",
'MID', "audio/midi",
'KAR', "audio/midi",
'MPGA', "audio/mpeg",
'MP2', "audio/mpeg",
'TSI', "audio/tsplayer",
'VOX', "audio/voxware",
'AIF', "audio/x-aiff",
'AIFC', "audio/x-aiff",
'AIFF', "audio/x-aiff",
'MID', "audio/x-midi",
'MP3', "audio/x-mpeg",
'MP2A', "audio/x-mpeg2",
'MPA2', "audio/x-mpeg2",
'M3U', "audio/x-mpegurl",
'MP3URL', "audio/x-mpegurl",
'PAT', "audio/x-pat",
'RAM', "audio/x-pn-realaudio",
'RPM', "audio/x-pn-realaudio-plugin",
'RA', "audio/x-realaudio",
'SBK', "audio/x-sbk",
'STR', "audio/x-str",
'WAV', "audio/x-wav",
#-------------------------------------<VIDEO>----
'MPEG', "video/mpeg",
'MPG', "video/mpeg",
'MPE', "video/mpeg",
'QT', "video/quicktime",
'MOV', "video/quicktime",
'VIV', "video/vivo",
'VIVO', "video/vivo",
'MPS', "video/x-mpeg-system",
'SYS', "video/x-mpeg-system",
'MP2V', "video/x-mpeg2",
'MPV2', "video/x-mpeg2",
'AVI', "video/x-msvideo",
'MV', "video/x-sgi-movie",
'MOVIE', "video/x-sgi-movie",
#-------------------------------------<EXTRA>----
'PDB', "chemical/x-pdb",
'XYZ', "chemical/x-pdb",
'CHM', "chemical/x-cs-chemdraw",
'SMI', "chemical/x-daylight-smiles",
'SKC', "chemical/x-mdl-isis",
'MOL', "chemical/x-mdl-molfile",
'RXN', "chemical/x-mdl-rxn",
'SMD', "chemical/x-smd",
'ACC', "chemical/x-synopsys-accord",
'ICE', "x-conference/x-cooltalk",
'SVR', "x-world/x-svr",
'WRL', "x-world/x-vrml",
'VRML', "x-world/x-vrml",
'VRJ', "x-world/x-vrt",
'VRJT', "x-world/x-vrt",
);
1;
# list of extensions by "Guillaume A." <webmaster@patchworks-et-boutons.com>

View File

@ -1,771 +0,0 @@
#!/usr/bin/env perl
# ====================================================================
# commit-email.pl: send a commit email for commit REVISION in
# repository REPOS to some email addresses.
#
# For usage, see the usage subroutine or run the script with no
# command line arguments.
#
# ====================================================================
# Copyright (c) 2000-2004 CollabNet. All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://subversion.tigris.org/license-1.html.
# If newer versions of this license are posted there, you may use a
# newer version instead, at your option.
#
# This software consists of voluntary contributions made by many
# individuals. For exact contribution history, see the revision
# history and logs, available at http://subversion.tigris.org/.
# ====================================================================
#
# Changes for CGAL project:
# - Email content modified to be closer to CVS commit email format
# - Email sent in both HTML + text
use lib "/home/groups/cgal/hooks/";
use Mail::Sender;
require 5.004; # This is when locale support was added.
# Use UTF-8 to display properly diacritic characters
$ENV{'LANG'} = 'en_US.UTF-8';
# Keep beginning of $data_ref up to $max_size size
sub cut_array
{
my $data_ref = shift @_;
my $max_size = shift @_;
my @new_data = ();
my $line;
my $total_size = 0;
for $line (@{$data_ref}) {
$total_size += length ($line);
if ($total_size > $max_size) {
push @new_data, "\n(snip)\n";
return @new_data;
}
push @new_data, $line;
}
return @new_data;
}
# Encode raw text as HTML text
sub html_encode
{
my $data_ref = shift @_;
my @new_data = ();
my $line;
for $line (@{$data_ref}) {
# Encode special characters ; < > SPACE
$line =~ s/&/&amp;/g;
$line =~ s/</&lt;/g;
$line =~ s/>/&gt;/g;
$line =~ s/ /&nbsp;/g;
# Encode new line
$line =~ s/\n/<br>\n/;
push @new_data, $line;
}
return @new_data;
}
# Encode raw text for HTML <pre> tag
sub encode_for_pre
{
my $data_ref = shift @_;
my @new_data = ();
my $line;
for $line (@{$data_ref}) {
# Encode special characters < >
$line =~ s/</&lt;/g;
$line =~ s/>/&gt;/g;
push @new_data, $line;
}
return @new_data;
}
# Turn on warnings the best way depending on the Perl version.
BEGIN {
if ( $] >= 5.006_000)
{ require warnings; import warnings; }
else
{ $^W = 1; }
}
use strict;
use Carp;
######################################################################
# Configuration section.
# Svnlook path.
my $svnlook = "/usr/bin/svnlook";
# By default, when a file is deleted from the repository, svnlook diff
# prints the entire contents of the file. If you want to save space
# in the log and email messages by not printing the file, then set
# $no_diff_deleted to 1.
my $no_diff_deleted = 1;
# ViewVC URL (specific to InriaGForge)
my $viewvc_url = "https://gforge.inria.fr/scm/viewvc.php";
# Since the path to svnlook depends upon the local installation
# preferences, check that the required programs exist to insure that
# the administrator has set up the script properly.
{
my $ok = 1;
foreach my $program ($svnlook)
{
if (-e $program)
{
unless (-x $program)
{
warn "$0: required program `$program' is not executable, ",
"edit $0.\n";
$ok = 0;
}
}
else
{
warn "$0: required program `$program' does not exist, edit $0.\n";
$ok = 0;
}
}
exit 1 unless $ok;
}
######################################################################
# Initial setup/command-line handling.
# Each value in this array holds a hash reference which contains the
# associated email information for one project. Start with an
# implicit rule that matches all paths.
my @project_settings_list = (&new_project);
# Process the command line arguments till there are none left. The
# first two arguments that are not used by a command line option are
# the repository path and the revision number.
my $repos;
my $rev;
# Use the reference to the first project to populate.
my $current_project = $project_settings_list[0];
# This hash matches the command line option to the hash key in the
# project. If a key exists but has a false value (''), then the
# command line option is allowed but requires special handling.
my %opt_to_hash_key = ('--from' => 'from_address',
'-h' => 'hostname',
'-l' => 'log_file',
'-m' => '',
'-r' => 'reply_to',
'-s' => 'subject_prefix');
while (@ARGV)
{
my $arg = shift @ARGV;
if ($arg =~ /^-/)
{
my $hash_key = $opt_to_hash_key{$arg};
unless (defined $hash_key)
{
die "$0: command line option `$arg' is not recognized.\n";
}
unless (@ARGV)
{
die "$0: command line option `$arg' is missing a value.\n";
}
my $value = shift @ARGV;
if ($hash_key)
{
$current_project->{$hash_key} = $value;
}
else
{
# Here handle -m.
unless ($arg eq '-m')
{
die "$0: internal error: should only handle -m here.\n";
}
$current_project = &new_project;
$current_project->{match_regex} = $value;
push(@project_settings_list, $current_project);
}
}
elsif ($arg =~ /^-/)
{
die "$0: command line option `$arg' is not recognized.\n";
}
else
{
if (! defined $repos)
{
$repos = $arg;
}
elsif (! defined $rev)
{
$rev = $arg;
}
else
{
push(@{$current_project->{email_addresses}}, $arg);
}
}
}
# If the revision number is undefined, then there were not enough
# command line arguments.
&usage("$0: too few arguments.") unless defined $rev;
# Check the validity of the command line arguments. Check that the
# revision is an integer greater than 0 and that the repository
# directory exists.
unless ($rev =~ /^\d+/ and $rev > 0)
{
&usage("$0: revision number `$rev' must be an integer > 0.");
}
unless (-e $repos)
{
&usage("$0: repos directory `$repos' does not exist.");
}
unless (-d _)
{
&usage("$0: repos directory `$repos' is not a directory.");
}
# Check that all of the regular expressions can be compiled and
# compile them.
{
my $ok = 1;
for (my $i=0; $i<@project_settings_list; ++$i)
{
my $match_regex = $project_settings_list[$i]->{match_regex};
# To help users that automatically write regular expressions
# that match the root directory using ^/, remove the / character
# because subversion paths, while they start at the root level,
# do not begin with a /.
$match_regex =~ s#^\^/#^#;
my $match_re;
eval { $match_re = qr/$match_regex/ };
if ($@)
{
warn "$0: -m regex #$i `$match_regex' does not compile:\n$@\n";
$ok = 0;
next;
}
$project_settings_list[$i]->{match_re} = $match_re;
}
exit 1 unless $ok;
}
######################################################################
# Harvest data using svnlook.
# Change into /tmp so that svnlook diff can create its .svnlook
# directory.
my $tmp_dir = '/tmp';
chdir($tmp_dir)
or die "$0: cannot chdir `$tmp_dir': $!\n";
# Get the author, date, and log from svnlook.
my @svnlooklines = &read_from_process($svnlook, 'info', $repos, '-r', $rev);
my $author = shift @svnlooklines;
my $date = shift @svnlooklines;
shift @svnlooklines;
my @log = map { "$_\n" } @svnlooklines;
# Figure out what directories have changed using svnlook.
my @dirschanged = &read_from_process($svnlook, 'dirs-changed', $repos,
'-r', $rev);
# Lose the trailing slash in the directory names if one exists, except
# in the case of '/'.
my $rootchanged = 0;
for (my $i=0; $i<@dirschanged; ++$i)
{
if ($dirschanged[$i] eq '/')
{
$rootchanged = 1;
}
else
{
$dirschanged[$i] =~ s#^(.+)[/\\]$#$1#;
}
}
# Figure out what files have changed using svnlook.
@svnlooklines = &read_from_process($svnlook, 'changed', $repos, '-r', $rev);
# Parse the changed nodes.
my @adds;
my @dels;
my @mods;
foreach my $line (@svnlooklines)
{
my $path = '';
my $code = '';
# Split the line up into the modification code and path, ignoring
# property modifications.
if ($line =~ /^(.). (.*)$/)
{
$code = $1;
$path = $2;
}
if ($code eq 'A')
{
push(@adds, $path);
}
elsif ($code eq 'D')
{
push(@dels, $path);
}
else
{
push(@mods, $path);
}
}
# Get the diff from svnlook.
my @no_diff_deleted = $no_diff_deleted ? ('--no-diff-deleted') : ();
my @difflines = &read_from_process($svnlook, 'diff', $repos,
'-r', $rev, @no_diff_deleted);
######################################################################
# Modified directory name collapsing.
# Collapse the list of changed directories only if the root directory
# was not modified, because otherwise everything is under root and
# there's no point in collapsing the directories, and only if more
# than one directory was modified.
my $commondir = '';
if (!$rootchanged and @dirschanged > 1)
{
my $firstline = shift @dirschanged;
my @commonpieces = split('/', $firstline);
foreach my $line (@dirschanged)
{
my @pieces = split('/', $line);
my $i = 0;
while ($i < @pieces and $i < @commonpieces)
{
if ($pieces[$i] ne $commonpieces[$i])
{
splice(@commonpieces, $i, @commonpieces - $i);
last;
}
$i++;
}
}
unshift(@dirschanged, $firstline);
if (@commonpieces)
{
$commondir = join('/', @commonpieces);
my @new_dirschanged;
foreach my $dir (@dirschanged)
{
if ($dir eq $commondir)
{
$dir = '.';
}
else
{
$dir =~ s#^$commondir/##;
}
push(@new_dirschanged, $dir);
}
@dirschanged = @new_dirschanged;
}
}
my $dirlist = join(' ', @dirschanged);
######################################################################
# Assembly of log message.
# Get project name (specific to InriaGForge)
my $project_name = $repos;
$project_name =~ s/\/svn\///;
$project_name =~ s/\/svnroot\///;
# Put together the body of the log message AS TEXT
my @body;
{
my $prev_rev = $rev - 1;
# Write summary
push(@body, "*Summary*\n");
push(@body, "\n");
push(@body, "Revision in ViewVC <$viewvc_url?revision=$rev&root=$project_name&view=rev>\n");
push(@body, "\n");
push(@body, "New Revision: $rev\n");
push(@body, "Author: $author\n");
push(@body, "Date: $date\n");
push(@body, "\n");
push(@body, "Log message:\n");
push(@body, @log);
push(@body, "\n");
# Added files list
if (@adds)
{
@adds = sort @adds;
push(@body, "*Added files*\n");
push(@body, "\n");
push(@body, map { /\/$/ ? "$_\n" : "$_ <$viewvc_url/$_?root=$project_name&revision=$rev&view=markup>\n" } @adds);
push(@body, "\n");
}
# Deleted files list
if (@dels)
{
@dels = sort @dels;
push(@body, "*Removed files*\n");
push(@body, "\n");
push(@body, map { "$_\n" } @dels);
push(@body, "\n");
}
# Modified files list
if (@mods)
{
@mods = sort @mods;
push(@body, "*Modified files*\n");
push(@body, "\n");
push(@body, map { "$_ <$viewvc_url/$_?root=$project_name&revision=$rev&r1=$prev_rev&r2=$rev>\n" } @mods);
push(@body, "\n");
}
push(@body, "\n");
# Write svn log
push(@body, "*Differences as text*\n");
push(@body, "\n");
@difflines = map { /[\r\n]+$/ ? $_ : "$_\n" } @difflines;
push(@body, @difflines);
# Truncate very long body
@body = cut_array(\@body, 30000);
# Add empty line to have a prettier output
# as Mailman will concatenate an "HTML attachment was scrubbed" comment
push(@body, "\n");
}
# Put together the body of the log message AS HTML
my @body_html;
{
my $prev_rev = $rev - 1;
# Write HTML header
push(@body_html, "<HTML>\n<HEAD>\n</HEAD>\n<BODY>\n");
# Write summary
push(@body_html, "<H3>Summary</H3>\n");
push(@body_html, "<a href=\"$viewvc_url?revision=$rev&amp;root=$project_name&amp;view=rev\">Revision in ViewVC</a><br>\n");
push(@body_html, "<br>\n");
push(@body_html, "New Revision: $rev<br>\n");
push(@body_html, "Author: $author<br>\n");
push(@body_html, "Date: $date<br>\n");
push(@body_html, "<br>\n");
push(@body_html, "Log message:<br>\n");
push(@body_html, "<pre>\n");
push(@body_html, encode_for_pre(\@log));
push(@body_html, "</pre>\n");
# Added files list
if (@adds)
{
@adds = sort @adds;
push(@body_html, "<H3>Added files</H3>\n");
push(@body_html, map { /\/$/ ? "$_<br>\n" : "<a href=\"$viewvc_url/$_?root=$project_name&amp;revision=$rev&amp;view=markup\">$_</a><br>\n" } @adds);
}
# Deleted files list
if (@dels)
{
@dels = sort @dels;
push(@body_html, "<H3>Removed files</H3>\n");
push(@body_html, map { "$_<br>\n" } @dels);
}
# Modified files list
if (@mods)
{
@mods = sort @mods;
push(@body_html, "<H3>Modified files</H3>\n");
push(@body_html, map { "<a href=\"$viewvc_url/$_?root=$project_name&amp;revision=$rev&amp;r1=$prev_rev&amp;r2=$rev\">$_</a><br>\n" } @mods);
}
# Write svn log (as plain text)
push(@body_html, "<H3>Differences as text</H3>\n");
push(@body_html, "<pre>\n");
@difflines = map { /[\r\n]+$/ ? $_ : "$_\n" } @difflines;
push(@body_html, encode_for_pre(\@difflines));
push(@body_html, "</pre>\n");
# Truncate very long body
@body_html = cut_array(\@body_html, 30000);
# Write HTML footer
push(@body_html, "</BODY>\n</HTML>\n");
}
# Go through each project and see if there are any matches for this
# project. If so, send the log out.
foreach my $project (@project_settings_list)
{
my $match_re = $project->{match_re};
my $match = 0;
foreach my $path (@dirschanged, @adds, @dels, @mods)
{
if ($path =~ $match_re)
{
$match = 1;
last;
}
}
next unless $match;
my @email_addresses = @{$project->{email_addresses}};
my $userlist = join(' ', @email_addresses);
my $to = join(', ', @email_addresses);
my $from_address = $project->{from_address};
my $hostname = $project->{hostname};
my $log_file = $project->{log_file};
my $reply_to = $project->{reply_to};
my $subject_prefix = $project->{subject_prefix};
my $subject;
if ($commondir ne '')
{
$subject = "r$rev - in $commondir: $dirlist";
}
else
{
$subject = "r$rev - $dirlist";
}
if ($subject_prefix =~ /\w/)
{
$subject = "$subject_prefix $subject";
}
my $mail_from = $author;
if ($from_address =~ /\w/)
{
$mail_from = $from_address;
}
elsif ($hostname =~ /\w/)
{
$mail_from = "$mail_from\@$hostname";
}
my $header;
#$header->{'debug'} = "/tmp/sendmail.log";
$header->{'to'} = $to;
$header->{'from'} = $mail_from;
$header->{'subject'} = $subject;
$header->{'replyto'} = $reply_to if $reply_to;
$header->{'smtp'} = 'localhost';
$header->{'multipart'} = 'alternative';
### Below, we set the content-type etc, but see these comments
### from Greg Stein on why this is not a full solution.
#
# From: Greg Stein <gstein@lyra.org>
# Subject: Re: svn commit: rev 2599 - trunk/tools/cgi
# To: dev@subversion.tigris.org
# Date: Fri, 19 Jul 2002 23:42:32 -0700
#
# Well... that isn't strictly true. The contents of the files
# might not be UTF-8, so the "diff" portion will be hosed.
#
# If you want a truly "proper" commit message, then you'd use
# multipart MIME messages, with each file going into its own part,
# and labeled with an appropriate MIME type and charset. Of
# course, we haven't defined a charset property yet, but no biggy.
#
# Going with multipart will surely throw out the notion of "cut
# out the patch from the email and apply." But then again: the
# commit emailer could see that all portions are in the same
# charset and skip the multipart thang.
#
# etc etc
#
# Basically: adding/tweaking the content-type is nice, but don't
# think that is the proper solution.
# Send mail via Mail::Sender
if (@email_addresses)
{
my $mail;
# Header
$mail = new Mail::Sender($header) or die "$0: cannot open mail connection: $!\n";
$mail->OpenMultipart($header) or die "$0: cannot open mail connection: $!\n";
# Mail as text
$mail->Part({ctype => 'text/plain; charset=UTF-8',
encoding => "quoted-printable",
disposition => 'NONE'
}) or warn "$0: cannot send mail: $!\n";
$mail->SendEnc(@body) or warn "$0: cannot send mail: $!\n";
# Mail as HTML
$mail->Part({ctype => 'text/html; charset=UTF-8',
encoding => "quoted-printable",
disposition => 'NONE'
}) or warn "$0: cannot send mail: $!\n";
$mail->SendEnc(@body_html) or warn "$0: cannot send mail: $!\n";
$mail->Close() or warn "$0: cannot close mail connection: $!\n";
}
# Dump the output to logfile (if its name is not empty).
if ($log_file =~ /\w/)
{
if (open(LOGFILE, ">> $log_file"))
{
print LOGFILE $header, @body;
close LOGFILE
or warn "$0: error in closing `$log_file' for appending: $!\n";
}
else
{
warn "$0: cannot open `$log_file' for appending: $!\n";
}
}
}
exit 0;
sub usage
{
warn "@_\n" if @_;
die "usage: $0 REPOS REVNUM [[-m regex] [options] [email_addr ...]] ...\n",
"options are\n",
" --from email_address Email address for 'From:' (overrides -h)\n",
" -h hostname Hostname to append to author for 'From:'\n",
" -l logfile Append mail contents to this log file\n",
" -m regex Regular expression to match committed path\n",
" -r email_address Email address for 'Reply-To:'\n",
" -s subject_prefix Subject line prefix\n",
"\n",
"This script supports a single repository with multiple projects,\n",
"where each project receives email only for commits that modify that\n",
"project. A project is identified by using the -m command line\n",
"with a regular expression argument. If a commit has a path that\n",
"matches the regular expression, then the entire commit matches.\n",
"Any of the following -h, -l, -r and -s command line options and\n",
"following email addresses are associated with this project. The\n",
"next -m resets the -h, -l, -r and -s command line options and the\n",
"list of email addresses.\n",
"\n",
"To support a single project conveniently, the script initializes\n",
"itself with an implicit -m . rule that matches any modifications\n",
"to the repository. Therefore, to use the script for a single\n",
"project repository, just use the other command line options and\n",
"a list of email addresses on the command line. If you do not want\n",
"a project that matches the entire repository, then use a -m with a\n",
"regular expression before any other command line options or email\n",
"addresses.\n",
"\n",
"Changes for CGAL project:\n",
"- Email content modified to be closer to CVS commit email format\n",
"- Email sent in both HTML + text\n";
}
# Return a new hash data structure for a new empty project that
# matches any modifications to the repository.
sub new_project
{
return {email_addresses => [],
from_address => '',
hostname => '',
log_file => '',
match_regex => '.',
reply_to => '',
subject_prefix => ''};
}
# Start a child process safely without using /bin/sh.
sub safe_read_from_pipe
{
unless (@_)
{
croak "$0: safe_read_from_pipe passed no arguments.\n";
}
my $pid = open(SAFE_READ, '-|');
unless (defined $pid)
{
die "$0: cannot fork: $!\n";
}
unless ($pid)
{
open(STDERR, ">&STDOUT")
or die "$0: cannot dup STDOUT: $!\n";
exec(@_)
or die "$0: cannot exec `@_': $!\n";
}
my @output;
while (<SAFE_READ>)
{
s/[\r\n]+$//;
push(@output, $_);
}
close(SAFE_READ);
my $result = $?;
my $exit = $result >> 8;
my $signal = $result & 127;
my $cd = $result & 128 ? "with core dump" : "";
if ($signal or $cd)
{
warn "$0: pipe from `@_' failed $cd: exit=$exit signal=$signal\n";
}
if (wantarray)
{
return ($result, @output);
}
else
{
return $result;
}
}
# Use safe_read_from_pipe to start a child process safely and return
# the output if it succeeded or an error message followed by the output
# if it failed.
sub read_from_process
{
unless (@_)
{
croak "$0: read_from_process passed no arguments.\n";
}
my ($status, @output) = &safe_read_from_pipe(@_);
if ($status)
{
return ("$0: `@_' failed with this output:", @output);
}
else
{
return @output;
}
}

View File

@ -1,50 +0,0 @@
#!/usr/bin/perl -w
use strict;
use lib "/home/groups/cgal/hooks/";
use Mail::Sender;
# Shift off any debug options.
my $debug = 0;
while (@ARGV and $ARGV[0] =~ /^-d(ebug)?$/) {
$debug++;
shift;
}
# Usage
unless (@ARGV > 2) {
print <<"EOF";
usage: $0 [-d] repos user capabilities
This script can be called from a pre-commit hook on either Windows or a Unix
like operating system. It implements the checks required to reject Unix
symbolic links, which are not valid (in fact: ignored) on Windows.
EOF
exit(0);
}
my $repo = shift @ARGV;
my $user = shift @ARGV;
my $capabilities_line = shift @ARGV;
my @capabilities = split(':', $capabilities_line);
if( not grep "mergeinfo",@capabilities ) {
}
my $subject = "CGAL svn: check-capabilities.pl";
my $header;
$header->{'to'} = "Laurent.Rineau\@geometryfactory.com";
$header->{'from'} = "$user\@users.gforge.inria.fr";
$header->{'subject'} = $subject;
$header->{'smtp'} = 'localhost';
$header->{'multipart'} = 'alternative';
#$header->{'debug'} = *main::STDERR;
my $mail = new Mail::Sender($header) or die "$0: cannot open mail connection: $!\n";
$mail->Open($header);
$mail->SendLineEnc("REPO: $repo\n",
"USER: $user\n",
"CAPS: $capabilities_line\n");
$mail->Close();
exit 0

View File

@ -1,263 +0,0 @@
#!/usr/bin/perl -w
# ====================================================================
# Copyright (c) 2000-2004 Collab Net. All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://subversion.tigris.org/license-1.html.
# If newer versions of this license are posted there, you may use a
# newer version instead, at your option.
#
# This software consists of voluntary contributions made by many
# individuals. For exact contribution history, see the revision
# history and logs, available at http://subversion.tigris.org/.
# ====================================================================
use strict;
require 5.004; # This is when locale support was added.
# This 'use encoding' and setting the LANG environment variable has the
# desired effect of handling the comparison of extended characters and
# preventing a commit.
#use encoding "utf8"; # LS 06/2006: commented out because it displays incorrectly
# filenames with diacritic characters on InriaGForge
$ENV{'LANG'} = 'en_US.UTF-8'; # LS 06/2006: 'en_GB.UTF-8' breaks svnlook on InriaGForge
# Please check the path to svn and svnlook is correct...
# LS 08/2006: request also path to svn.
my $svnlook;
my $svn;
if ($^O eq 'MSWin32') {
$svnlook = '"c:\Program Files\subversion\bin\svnlook.exe"';
$svn = '"c:\Program Files\subversion\bin\svn.exe"';
} else {
$svnlook = '/usr/bin/svnlook';
$svn = '/usr/bin/svn';
}
# This script can be called from a pre-commit hook on either Windows or a Unix
# like operating system. It implements the checks required to ensure that the
# repository acts in a way which is compatible with a case preserving but
# case insensitive file system.
#
# When a file is added this script checks the file tree in the repository for
# files which would be the same name on a case insensitive file system and
# rejects the commit.
#
# On a Unix system put this script in the hooks directory and add this to the
# pre-commit script:
#
# $REPOS/hooks/check-case-insensitive.pl "$REPOS" "$TXN" || exit 1
#
# On a windows machine add this to pre-commit.bat:
#
# perl <path-to-script>\check-case-insensitive.pl %1 %2
# if errorlevel 1 goto :ERROR
# exit 0
# :ERROR
# echo Error found in commit 1>&2
# exit 1
#
# You may need to change the setting of $svn and $svnlook to the path to the
# executable on your system.
#
# Turn on debug by adding up to three -debug options as the first options in
# the list. The more -debug options the more output. If you specify more
# than one the output goes into a file.
#
# If you have any problems with this script feel free to contact
# Martin Tomes <martin@tomes.org.uk>
# Bugfixes and some debug code added by Jeremy Bettis <jeremy@deadbeef.com>
my $openstr = '-|';
# Shift off any debug options.
my $debug = 0;
while (@ARGV and $ARGV[0] =~ /^-d(ebug)?$/) {
$debug++;
shift;
}
# If there is too much debug output to STDERR subversion doesn't like it, so,
# if a lot of output is expected send it to a file instead.
if ($debug > 1) { # LS 08/2006: compare to 1 to match comments
if ($^O eq 'MSWin32') {
open(STDERR, ">c:/svnlog.txt")
or die "$0: cannot open 'c:/svnlog.txt' for writing: $!\n";
} else {
open(STDERR, ">/tmp/svnlog.txt")
or die "$0: cannot open '/tmp/svnlog.txt' for writing: $!\n";
}
}
# Usage
unless (@ARGV > 1) {
die "usage: $0 [-d [-d [-d]]] repos txn [--revision]\n";
}
# Fetch the command line arguments.
my $repos = shift;
$repos =~ s/\/$//; # LS 08/2006: remove trailing slash
my $txn = shift;
# Jeremy Bettis <jeremy@deadbeef.com> wrote the $flag code and has this to
# say about it:
#
# The reason I did that was so that I could test the hook without actually
# doing a commit. Whenever I had a commit that succeeded in making a bad file
# or directory, or when a commit took too long I just did a sequence of
# operations like this:
#
# svnlook youngest path
# (it tells me that HEAD is 987 or whatever)
# check-case-insensitive.pl -debug path 987 -r
# and then the check-case-insensitive.pl passes -r to svn/svnlook instead of
# --transaction.
my $flag = '--transaction';
$flag = shift if @ARGV;
# Each added path put here.
my @added;
# LS 08/2006: Each removed path put here.
my @removed;
# LS 08/2006: Each modified directory put here.
my @modified_dirs;
# The file tree as a hash, index lower cased name, value actual name.
my %tree;
# Command being executed.
my $cmd;
print STDERR "LANG=", $ENV{'LANG'}, "\n" if ($debug and defined($ENV{'LANG'}));
# Get lists of added and removed files.
local *SVNLOOK;
$cmd = "$svnlook changed \"$repos\" $flag $txn";
print STDERR "$cmd\n" if ($debug);
open(SVNLOOK, $openstr, $cmd)
or die("$0: cannot open '$cmd' pipe for reading: $!\n");
while (<SVNLOOK>) {
chomp;
if (/^A\s+(\S.*)/) {
push @added, $1;
}
# LS 08/2006: Get also the list of removed files.
elsif (/^D\s+(\S.*)/) {
push @removed, $1;
}
}
close SVNLOOK;
# Trace
if ($debug) {
print STDERR "Added " . ($#added + 1) . " item(s):\n";
foreach my $itm (@added) {
print STDERR " $itm\n";
}
print STDERR "Removed " . ($#removed + 1) . " item(s):\n";
foreach my $itm (@removed) {
print STDERR " $itm\n";
}
}
unless (@added) {
print STDERR "No files added\n" if ($debug);
# No added files so no problem.
exit(0);
}
# LS 08/2006: Get the list of *all* modified directories.
$cmd = "$svnlook dirs-changed \"$repos\" $flag $txn";
print STDERR "$cmd\n" if ($debug);
open(SVNLOOK, $openstr, $cmd)
or die("$0: cannot open '$cmd' pipe for reading: $!\n");
while (<SVNLOOK>) {
chomp;
print STDERR " ", $_, "\n" if ($debug > 2);
# There isn't a leading slash on $changed but there is a trailing one. When
# it is the root of the repository the / is a pain, so always remove the
# trailing slash and put it back in where needed.
$_ =~ s/\/$//;
push @modified_dirs, $_;
}
close SVNLOOK;
# LS 08/2006: We will check transations against HEAD and revisions against the previous commit.
my $lastrev = "";
unless ($flag eq '--transaction') {
$lastrev = "--revision " . ($txn-1);
}
# Get the modified directories' content at the previous revision and turn the output into
# complete paths for each file.
# LS 08/2006: large rewrite with 'svn ls' instead of 'svnlook tree' (which is too slow)
local *SVN;
foreach my $changed (@modified_dirs) {
$cmd = "$svn ls \"file://$repos/$changed\" $lastrev";
print STDERR "$cmd\n" if ($debug);
open(SVN, $openstr, $cmd)
or die("$0: cannot open '$cmd' pipe for reading: $!\n");
while (<SVN>) {
chomp;
if (/^(.*)\/$/) { # Is a directory.
my $name = $1 . '/';
my $index;
if ($changed eq '') {
$index = $name;
} else {
$index = $changed . '/' . $name;
}
$index =~ s/\/$//; # LS 06/2006: Remove trailing slash to compare file and folders
$index = lc($index);
$tree{$index} = $name; # Index the hash with case folded name.
print STDERR "\$tree{$index}=$name (dir)\n" if ($debug > 1);
} else { # This is a real file name, not a directory.
my $name = $_;
my $index;
if ($changed eq '') {
$index = $name;
} else {
$index = $changed . '/' . $name;
}
$index = lc($index);
$tree{$index} = $name; # Index the hash with case folded name.
print STDERR "\$tree{$index}=$name\n" if ($debug > 1);
}
}
close SVN;
}
# LS 08/2006: remove deleted paths from %tree
foreach my $newfile (@removed) {
$newfile =~ s/\/$//;
my $lcnewfile = lc($newfile);
print STDERR "Delete \$tree{$lcnewfile}\n" if ($debug > 1);
delete($tree{$lcnewfile});
}
# Check each added file
my $failmsg;
my %newtree;
foreach my $newfile (@added) {
$newfile =~ s/\/$//; # LS 06/2006: Remove trailing slash to compare file and folders
my $lcnewfile = lc($newfile);
print STDERR "Checking \$tree{$lcnewfile}\n" if ($debug > 1);
if (exists($tree{$lcnewfile})) {
$failmsg .= "\n $newfile already exists as " . $tree{$lcnewfile};
}
elsif (exists($newtree{$lcnewfile})) {
$failmsg .= "\n $newfile also added as " . $newtree{$lcnewfile};
}
$newtree{$lcnewfile} = $newfile;
}
if (defined($failmsg)) {
print STDERR "\nFile name case conflict(s) found:\n" . $failmsg . "\n";
exit 1;
}
exit 0;

View File

@ -1,202 +0,0 @@
#!/usr/bin/perl -w
# ====================================================================
# check-characters.pl
# Laurent Saboret, INRIA, 2006
#
# This script can be called from a pre-commit hook on either Windows or a Unix
# like operating system. It implements the checks required to ensure that the
# repository accepts only file/folder names compatible with Windows/Unix/Mac
# file systems (plus SVN own requirements).
#
# When a file is added this script checks the file name. If it
# fails one of the requirements below, the commit is rejected.
# SVN requirements:
# - Control characters 0x0 to 0x1f and 0x7f are not supported
# (see http://subversion.tigris.org/issues/show_bug.cgi?id=1954).
# Unix file system (including Linux and MacOSX):
# - Characters \0 and / are not supported
# (see http://svn.haxx.se/dev/archive-2002-04/0144.shtml).
# Windows file systems FAT and NTFS:
# - Control characters 0x0 to 0x1f are not supported.
# - Characters / \ : * ? " < > | are not supported.
# - Filenames CON, PRN, AUX, NUL, COM1 to COM9, LPT1 to LPT9 and CLOCK$ are reserved,
# even with a path or an extension.
# - A filename cannot end by . or SPACE characters.
# (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp)
#
# On a Unix system put this script in the hooks directory and add this to the
# pre-commit script:
# $REPOS/hooks/check-characters.pl "$REPOS" "$TXN" || exit 1
#
# On a windows machine add this to pre-commit.bat:
# perl <path-to-script>\check-characters.pl %1 %2
# if errorlevel 1 goto :ERROR
# exit 0
# :ERROR
# echo Error found in commit 1>&2
# exit 1
#
# You may need to change the setting of $svnlook to the path to the
# executable on your system.
#
# Turn on debug by adding a -debug option as the first option in the list.
#
# Note: this script was created from Collab Net check-case-insensitive.pl
# ====================================================================
use strict;
require 5.004; # This is when locale support was added.
use Encode;
$ENV{'LANG'} = 'en_US.UTF-8';
$ENV{'LC_CTYPE'} = 'en_US.UTF-8';
binmode STDERR, ":utf8";
# Please check the path to svnlook is correct...
my $svnlook;
if ($^O eq 'MSWin32') {
$svnlook = '"c:\Program Files\subversion\bin\svnlook.exe"';
} else {
$svnlook = '/usr/bin/svnlook';
}
# Shift off any debug options.
my $debug = 0;
while (@ARGV and $ARGV[0] =~ /^-d(ebug)?$/) {
$debug++;
shift;
}
# Usage
unless (@ARGV > 1) {
print <<"END_USAGE";
usage: $0 [-d] repos txn [--revision]
This script can be called from a pre-commit hook on either Windows or a Unix
like operating system. It implements the checks required to ensure that the
repository accepts only file/folder names compatible with Windows/Unix/Mac
file systems (plus SVN own requirements).
END_USAGE
exit(0);
}
# Fetch the command line arguments.
my $repos = shift;
my $txn = shift;
# Jeremy Bettis <jeremy@deadbeef.com> wrote the $flag code and has this to
# say about it:
#
# The reason I did that was so that I could test the hook without actually
# doing a commit. Whenever I had a commit that succeeded in making a bad file
# or directory, or when a commit took too long I just did a sequence of
# operations like this:
#
# svnlook youngest path
# (it tells me that HEAD is 987 or whatever)
# check-characters.pl -debug path 987 -r
# and then the check-characters.pl passes -r to svnlook instead of
# --transaction.
my $flag = '--transaction';
$flag = shift if @ARGV;
# Each added path put here.
my @added;
# Command being executed.
my $cmd;
print STDERR "LANG=", $ENV{'LANG'}, "\n" if ($debug and defined($ENV{'LANG'}));
print STDERR "LC_CTYPE=", $ENV{'LC_CTYPE'}, "\n" if ($debug and defined($ENV{'LC_CTYPE'}));
# Get a list of added files.
local *SVNLOOK;
$cmd = "$svnlook changed \"$repos\" $flag $txn";
print STDERR "$cmd\n" if ($debug);
open(SVNLOOK, '-|:utf8', $cmd)
or die("$0: cannot open '$cmd' pipe for reading: $!\n");
while (<SVNLOOK>) {
chomp;
if (/^A\s+(\S.*)/) {
push @added, $1;
}
}
close SVNLOOK;
# Trace
if ($debug) {
print STDERR "Added " . ($#added + 1) . " item(s):\n";
foreach my $itm (@added) {
print STDERR " $itm\n";
}
}
# Stop if no added files
unless (@added) {
print STDERR "No files added\n" if ($debug);
# No added files so no problem.
exit(0);
}
# Check each added file
my $failmsg;
foreach my $newfile (@added) {
# Get basename
$newfile =~ s/\/$//; # Remove trailing slash from folders
$newfile =~ s/.*\///; # Remove path
if ($debug) {
print STDERR "Checking $newfile\n";
print STDERR " as unicode: ";
my @unicode_chars = split //, $newfile;
map { print STDERR "$_ (" . ord($_) . ") " } @unicode_chars;
print STDERR "\n";
print STDERR " as UTF-8: ";
my $utf8_raw_string = Encode::encode("UTF-8", $newfile);
my @utf8_octets = split //, $utf8_raw_string;
map { print STDERR "$_ (" . ord($_) . ") " } @utf8_octets;
print STDERR "\n";
}
# SVN requirements:
# - Control characters 0x0 to 0x1f and 0x7f are not supported
# (see http://subversion.tigris.org/issues/show_bug.cgi?id=1954).
if ($newfile =~ m/([\x00-\x1F\x7f])/) {
$failmsg .= "\n $newfile contains an invalid control character (0x00-0x1f 0x7f).\n";
next;
}
# Unix file system (including Linux and MacOSX):
# - Characters \0 and / are not supported
# (see http://svn.haxx.se/dev/archive-2002-04/0144.shtml).
if ($newfile =~ m/[\x00\/]/) {
$failmsg .= "\n $newfile contains a character invalid on Unix (\\0 \/).\n";
next;
}
# Windows file systems FAT and NTFS:
# - Control characters 0x0 to 0x1f are not supported.
# - Characters / \ : * ? " < > | are not supported.
# - Filenames CON, PRN, AUX, NUL, COM1 to COM9, LPT1 to LPT9 and CLOCK$ are reserved,
# even with a path or an extension.
# - A filename cannot end by . or SPACE characters.
# (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp)
if ($newfile =~ m/[\x00-\x1F\/\\\:\*\?\"\<\>\|]/) {
$failmsg .= "\n $newfile contains a character invalid on Windows (0x00-0x1f \/ \\ \: \* \? \" \< \> \|).\n";
next;
}
if ($newfile =~ m/^(CON|PRN|AUX|NUL|COM\d|LPT\d|CLOCK\$)(\..*)?$/i) {
$failmsg .= "\n $newfile is a reserved filename on Windows.\n";
next;
}
if ($newfile =~ m/[\. ]$/) {
$failmsg .= "\n $newfile is illegal. Windows filenames cannot end by . or SPACE characters.\n";
next;
}
}
if (defined($failmsg)) {
print STDERR "\nInvalid file name(s) found:\n" . $failmsg . "\n";
exit 1;
}
exit 0;

View File

@ -1,143 +0,0 @@
#!/usr/bin/perl -w
# ====================================================================
# check-symlinks.pl
# Laurent Saboret, INRIA, 2006
#
# This script can be called from a pre-commit hook on either Windows or a Unix
# like operating system. It implements the checks required to reject Unix
# symbolic links, which are not valid (in fact: ignored) on Windows.
#
# When a file is added this script checks if it is a symbolic link. If it
# is, the commit is rejected.
#
# On a Unix system put this script in the hooks directory and add this to the
# pre-commit script:
# $REPOS/hooks/check-symlinks.pl "$REPOS" "$TXN" || exit 1
#
# On a windows machine add this to pre-commit.bat:
# perl <path-to-script>\check-symlinks.pl %1 %2
# if errorlevel 1 goto :ERROR
# exit 0
# :ERROR
# echo Error found in commit 1>&2
# exit 1
#
# You may need to change the setting of $svnlook to the path to the
# executable on your system.
#
# Turn on debug by adding a -debug option as the first option in the list.
#
# Note: this script was created from Collab Net check-case-insensitive.pl
# ====================================================================
use strict;
require 5.004; # This is when locale support was added.
$ENV{'LANG'} = 'en_US.UTF-8';
# Please check the path to svnlook is correct...
my $svnlook;
if ($^O eq 'MSWin32') {
$svnlook = '"c:\Program Files\subversion\bin\svnlook.exe"';
} else {
$svnlook = '/usr/bin/svnlook';
}
my $openstr = '-|';
# Shift off any debug options.
my $debug = 0;
while (@ARGV and $ARGV[0] =~ /^-d(ebug)?$/) {
$debug++;
shift;
}
# Usage
unless (@ARGV > 1) {
print <<"END_USAGE";
usage: $0 [-d] repos txn [--revision]
This script can be called from a pre-commit hook on either Windows or a Unix
like operating system. It implements the checks required to reject Unix
symbolic links, which are not valid (in fact: ignored) on Windows.
END_USAGE
exit(0);
}
# Fetch the command line arguments.
my $repos = shift;
my $txn = shift;
# Jeremy Bettis <jeremy@deadbeef.com> wrote the $flag code and has this to
# say about it:
#
# The reason I did that was so that I could test the hook without actually
# doing a commit. Whenever I had a commit that succeeded in making a bad file
# or directory, or when a commit took too long I just did a sequence of
# operations like this:
#
# svnlook youngest path
# (it tells me that HEAD is 987 or whatever)
# check-symlinks.pl -debug path 987 -r
# and then the check-symlinks.pl passes -r to svnlook instead of
# --transaction.
my $flag = '--transaction';
$flag = shift if @ARGV;
# Each added path put here.
my @added;
# Command being executed.
my $cmd;
print STDERR "LANG=", $ENV{'LANG'}, "\n" if ($debug and defined($ENV{'LANG'}));
# Get a list of added files.
local *SVNLOOK;
$cmd = "$svnlook changed \"$repos\" $flag $txn";
print STDERR "$cmd\n" if ($debug);
open(SVNLOOK, $openstr, $cmd)
or die("$0: cannot open '$cmd' pipe for reading: $!\n");
while (<SVNLOOK>) {
chomp;
if (/^A\s+(\S.*)/) {
push @added, $1;
}
}
close SVNLOOK;
# Trace
if ($debug) {
print STDERR "Added " . ($#added + 1) . " item(s):\n";
foreach my $itm (@added) {
print STDERR " $itm\n";
}
}
# Stop if no added files
unless (@added) {
print STDERR "No files added\n" if ($debug);
# No added files so no problem.
exit(0);
}
# Check each added file
my $failmsg;
foreach my $newfile (@added) {
$cmd = "$svnlook proplist \"$repos\" \"$newfile\" $flag $txn";
print STDERR "$cmd\n" if ($debug);
open(SVNLOOK, $openstr, $cmd)
or die("$0: cannot open '$cmd' pipe for reading: $!\n");
while (<SVNLOOK>) {
chomp;
if (/\bsvn:special\b/) {
$failmsg .= "\n $newfile is a symbolic link.\n";
next;
}
}
close SVNLOOK;
}
if (defined($failmsg)) {
print STDERR "\nInvalid file(s) found:\n" . $failmsg . "\n";
exit 1;
}
exit 0;

View File

@ -1,49 +0,0 @@
#!/bin/sh
# POST-COMMIT HOOK
#
# The post-commit hook is invoked after a commit. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-commit' with the following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] REV (the number of the revision just committed)
#
# The default working directory for the invocation is undefined, so
# the program should set one explicitly if it cares.
#
# Because the commit has already completed and cannot be undone,
# the exit code of the hook program is ignored. The hook program
# can use the 'svnlook' utility to help it examine the
# newly-committed tree.
#
# On a Unix system, the normal procedure is to have 'post-commit'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'post-commit' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'post-commit.bat' or 'post-commit.exe',
# but the basic idea is the same.
REPOS="$1"
REV="$2"
# InriaGForge default mail notification
#/usr/lib/subversion/hook-scripts/commit-email.pl "$REPOS" "$REV" -h users.gforge.inria.fr cgal-commits@lists.gforge.inria.fr
# Mail notification customized for CGAL
/home/groups/cgal/hooks/cgal-commit-email.pl "$REPOS" "$REV" -h users.gforge.inria.fr cgal-commits@lists.gforge.inria.fr
#/home/groups/cgal/hooks/cgal-commit-email.pl "$REPOS" "$REV" -h users.gforge.inria.fr Laurent.Rineau@geometryfactory.com
#/home/groups/cgal/hooks/cgal-commit-email.pl "$REPOS" "$REV" -h users.gforge.inria.fr sebastien.loriot@cgal.org
# Add that exit to workaround the fact that
# GForge adds lines automatically to post-commit
exit 0
#begin added by svncommitemail
/usr/lib/subversion/hook-scripts/commit-email.pl "$REPOS" "$REV" -h users.gforge.inria.fr cgal-commits@lists.gforge.inria.fr
#end added by svncommitemail

View File

@ -1,50 +0,0 @@
#!/bin/sh
# POST-COMMIT HOOK
#
# The post-commit hook is invoked after a commit. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-commit' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] REV (the number of the revision just committed)
#
# The default working directory for the invocation is undefined, so
# the program should set one explicitly if it cares.
#
# Because the commit has already completed and cannot be undone,
# the exit code of the hook program is ignored. The hook program
# can use the 'svnlook' utility to help it examine the
# newly-committed tree.
#
# On a Unix system, the normal procedure is to have 'post-commit'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'post-commit' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'post-commit.bat' or 'post-commit.exe',
# but the basic idea is the same.
#
# The hook program typically does not inherit the environment of
# its parent process. For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program, the
# culprit may be unusual (or missing) environment variables.
#
# Here is an example hook script, for a Unix /bin/sh interpreter.# For more examples and pre-written hooks, see those in
# the Subversion repository at
# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
REPOS="$1"
REV="$2"
/usr/lib/subversion/hook-scripts/commit-email.pl "$REPOS" "$REV" commit-watchers@example.org
log-commit.py --repository "$REPOS" --revision "$REV"

View File

@ -1,44 +0,0 @@
#!/bin/sh
# POST-LOCK HOOK
#
# The post-lock hook is run after a path is locked. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-lock' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] USER (the user who created the lock)
#
# The paths that were just locked are passed to the hook via STDIN (As
# of Subversion 1.2, only one path is passed per invocation, but the
# plan is to pass all locked paths at once in Subversion 1.3 and
# later).
#
# The default working directory for the invocation is undefined, so
# the program should set one explicitly if it cares.
#
# Because the lock has already been created and cannot be undone,
# the exit code of the hook program is ignored. The hook program
# can use the 'svnlook' utility to help it examine the
# newly-created lock.
#
# On a Unix system, the normal procedure is to have 'post-lock'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'post-lock' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'post-lock.bat' or 'post-lock.exe',
# but the basic idea is the same.
#
# Here is an example hook script, for a Unix /bin/sh interpreter:
REPOS="$1"
USER="$2"
# Send email to interested parties, let them know a lock was created:
mailer.py lock "$REPOS" "$USER" /path/to/mailer.conf

View File

@ -1,50 +0,0 @@
#!/bin/sh
# POST-REVPROP-CHANGE HOOK
#
# The post-revprop-change hook is invoked after a revision property
# has been added, modified or deleted. Subversion runs this hook by
# invoking a program (script, executable, binary, etc.) named
# 'post-revprop-change' (for which this file is a template), with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] REV (the revision that was tweaked)
# [3] USER (the username of the person tweaking the property)
# [4] PROPNAME (the property that was changed)
# [5] ACTION (the property was 'A'dded, 'M'odified, or 'D'eleted)
#
# [STDIN] PROPVAL ** the old property value is passed via STDIN.
#
# Because the propchange has already completed and cannot be undone,
# the exit code of the hook program is ignored. The hook program
# can use the 'svnlook' utility to help it examine the
# new property value.
#
# On a Unix system, the normal procedure is to have 'post-revprop-change'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'post-revprop-change' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'post-revprop-change.bat' or 'post-revprop-change.exe',
# but the basic idea is the same.
#
# The hook program typically does not inherit the environment of
# its parent process. For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program, the
# culprit may be unusual (or missing) environment variables.
REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"
/usr/lib/subversion/hook-scripts/commit-email.pl --revprop-change "$REPOS" "$REV" "$USER" "$PROPNAME" -h users.gforge.inria.fr cgal-commits@lists.gforge.inria.fr

View File

@ -1,57 +0,0 @@
#!/bin/sh
# POST-REVPROP-CHANGE HOOK
#
# The post-revprop-change hook is invoked after a revision property
# has been added, modified or deleted. Subversion runs this hook by
# invoking a program (script, executable, binary, etc.) named
# 'post-revprop-change' (for which this file is a template), with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] REV (the revision that was tweaked)
# [3] USER (the username of the person tweaking the property)
# [4] PROPNAME (the property that was changed)
# [5] ACTION (the property was 'A'dded, 'M'odified, or 'D'eleted)
#
# [STDIN] PROPVAL ** the old property value is passed via STDIN.
#
# Because the propchange has already completed and cannot be undone,
# the exit code of the hook program is ignored. The hook program
# can use the 'svnlook' utility to help it examine the
# new property value.
#
# On a Unix system, the normal procedure is to have 'post-revprop-change'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'post-revprop-change' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'post-revprop-change.bat' or 'post-revprop-change.exe',
# but the basic idea is the same.
#
# The hook program typically does not inherit the environment of
# its parent process. For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program, the
# culprit may be unusual (or missing) environment variables.
#
# Here is an example hook script, for a Unix /bin/sh interpreter.
# For more examples and pre-written hooks, see those in
# the Subversion repository at
# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"
/usr/lib/subversion/hook-scripts/commit-email.pl --revprop-change "$REPOS" "$REV" "$USER" "$PROPNAME" watchers@example.org

View File

@ -1,42 +0,0 @@
#!/bin/sh
# POST-UNLOCK HOOK
#
# The post-unlock hook runs after a path is unlocked. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-unlock' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] USER (the user who destroyed the lock)
#
# The paths that were just unlocked are passed to the hook via STDIN
# (As of Subversion 1.2, only one path is passed per invocation, but
# the plan is to pass all locked paths at once in Subversion 1.3 and
# later).
#
# The default working directory for the invocation is undefined, so
# the program should set one explicitly if it cares.
#
# Because the lock has already been destroyed and cannot be undone,
# the exit code of the hook program is ignored.
#
# On a Unix system, the normal procedure is to have 'post-unlock'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'post-unlock' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'post-unlock.bat' or 'post-unlock.exe',
# but the basic idea is the same.
#
# Here is an example hook script, for a Unix /bin/sh interpreter:
REPOS="$1"
USER="$2"
# Send email to interested parties, let them know a lock was removed:
mailer.py unlock "$REPOS" "$USER" /path/to/mailer.conf

View File

@ -1,85 +0,0 @@
#!/bin/bash
# PRE-COMMIT HOOK
#
# The pre-commit hook is invoked before a Subversion txn is
# committed. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-commit' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] TXN-NAME (the name of the txn about to be committed)
#
# The default working directory for the invocation is undefined, so
# the program should set one explicitly if it cares.
#
# If the hook program exits with success, the txn is committed; but
# if it exits with failure (non-zero), the txn is aborted, no commit
# takes place, and STDERR is returned to the client. The hook
# program can use the 'svnlook' utility to help it examine the txn.
#
# On a Unix system, the normal procedure is to have 'pre-commit'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT ***
# *** FOR REVISION PROPERTIES (like svn:log or svn:author). ***
#
# This is why we recommend using the read-only 'svnlook' utility.
# In the future, Subversion may enforce the rule that pre-commit
# hooks should not modify the versioned data in txns, or else come
# up with a mechanism to make it safe to do so (by informing the
# committing client of the changes). However, right now neither
# mechanism is implemented, so hook writers just have to be careful.
#
# Note that 'pre-commit' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'pre-commit.bat' or 'pre-commit.exe',
# but the basic idea is the same.
#
# The hook program typically does not inherit the environment of
# its parent process. For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program, the
# culprit may be unusual (or missing) environment variables.
REPOS="$1"
TXN="$2"
# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | /usr/bin/perl -e 'while(<>) { /[a-zA-Z0-9]/ && exit 0 }; exit 1' > /dev/null
if [[ $? != 0 ]]; then
echo "" >&2
echo "Invalid commit message" >&2
exit 1
fi
# Freeze trunk
if $SVNLOOK dirs-changed -t "$TXN" "$REPOS" | grep -qE '^trunk'; then
echo "" >&2
echo "trunk is now read-only!" >&2
exit 1
fi
# Check that the author of this commit has the rights to perform
# the commit on the files and directories being modified.
#/usr/lib/subversion/hook-scripts/commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1
# Check that transaction will not create files/folders
# whose name differ only by case (illegal on Windows).
/home/groups/cgal/hooks/check-case-insensitive.pl "$REPOS" "$TXN" || exit 1
# Ensure that the repository accepts only file/folder names
# compatible with Windows/Unix/Mac file systems (plus SVN own requirements).
/home/groups/cgal/hooks/check-characters.pl "$REPOS" "$TXN" || exit 1
# Reject Unix symbolic links, which are not valid (in fact: ignored) on Windows.
/home/groups/cgal/hooks/check-symlinks.pl "$REPOS" "$TXN" || exit 1
# All checks passed, so allow the commit.
exit 0

View File

@ -1,69 +0,0 @@
#!/bin/sh
# PRE-COMMIT HOOK
#
# The pre-commit hook is invoked before a Subversion txn is
# committed. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-commit' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] TXN-NAME (the name of the txn about to be committed)
#
# The default working directory for the invocation is undefined, so
# the program should set one explicitly if it cares.
#
# If the hook program exits with success, the txn is committed; but
# if it exits with failure (non-zero), the txn is aborted, no commit
# takes place, and STDERR is returned to the client. The hook
# program can use the 'svnlook' utility to help it examine the txn.
#
# On a Unix system, the normal procedure is to have 'pre-commit'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# *** NOTE: THE HOOK PROGRAM MUST NOT MODIFY THE TXN, EXCEPT ***
# *** FOR REVISION PROPERTIES (like svn:log or svn:author). ***
#
# This is why we recommend using the read-only 'svnlook' utility.
# In the future, Subversion may enforce the rule that pre-commit
# hooks should not modify the versioned data in txns, or else come
# up with a mechanism to make it safe to do so (by informing the
# committing client of the changes). However, right now neither
# mechanism is implemented, so hook writers just have to be careful.
#
# Note that 'pre-commit' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'pre-commit.bat' or 'pre-commit.exe',
# but the basic idea is the same.
#
# The hook program typically does not inherit the environment of
# its parent process. For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program, the
# culprit may be unusual (or missing) environment variables.
#
# Here is an example hook script, for a Unix /bin/sh interpreter.# For more examples and pre-written hooks, see those in
# the Subversion repository at
# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
REPOS="$1"
TXN="$2"
# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | \
grep "[a-zA-Z0-9]" > /dev/null || exit 1
# Check that the author of this commit has the rights to perform
# the commit on the files and directories being modified.
/usr/lib/subversion/hook-scripts/commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1
# All checks passed, so allow the commit.
exit 0

View File

@ -1,64 +0,0 @@
#!/bin/sh
# PRE-LOCK HOOK
#
# The pre-lock hook is invoked before an exclusive lock is
# created. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-lock' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] PATH (the path in the repository about to be locked)
# [3] USER (the user creating the lock)
#
# The default working directory for the invocation is undefined, so
# the program should set one explicitly if it cares.
#
# If the hook program exits with success, the lock is created; but
# if it exits with failure (non-zero), the lock action is aborted
# and STDERR is returned to the client.
# On a Unix system, the normal procedure is to have 'pre-lock'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'pre-lock' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'pre-lock.bat' or 'pre-lock.exe',
# but the basic idea is the same.
#
# Here is an example hook script, for a Unix /bin/sh interpreter:
REPOS="$1"
PATH="$2"
USER="$3"
# If a lock exists and is owned by a different person, don't allow it
# to be broken.
# (Maybe this script could send email to the to the lock owner?)
SVNLOOK=/usr/local/bin/svnlook
GREP=/bin/grep
SED=/bin/sed
LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \
$GREP '^Owner:' | $SED 's/Owner: //'`
# If we get no result from svnlook, there's no lock, allow the lock to
# happen:
if [ "$LOCK_OWNER" == "" ]; then
exit 0
fi
# If the person locking matches the lock's owner, allow the lock to
# happen:
if [ "$LOCK_OWNER" == "$USER" ]; then
exit 0
fi
# Otherwise, we've got an owner mismatch, so return failure:
echo "Error: $PATH already locked by ${LOCK_OWNER}." 1>&2
exit 1

View File

@ -1,63 +0,0 @@
#!/bin/sh
# PRE-REVPROP-CHANGE HOOK
#
# The pre-revprop-change hook is invoked before a revision property
# is added, modified or deleted. Subversion runs this hook by invoking
# a program (script, executable, binary, etc.) named 'pre-revprop-change'
# (for which this file is a template), with the following ordered
# arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] REVISION (the revision being tweaked)
# [3] USER (the username of the person tweaking the property)
# [4] PROPNAME (the property being set on the revision)
# [5] ACTION (the property is being 'A'dded, 'M'odified, or 'D'eleted)
#
# [STDIN] PROPVAL ** the new property value is passed via STDIN.
#
# If the hook program exits with success, the propchange happens; but
# if it exits with failure (non-zero), the propchange doesn't happen.
# The hook program can use the 'svnlook' utility to examine the
# existing value of the revision property.
#
# WARNING: unlike other hooks, this hook MUST exist for revision
# properties to be changed. If the hook does not exist, Subversion
# will behave as if the hook were present, but failed. The reason
# for this is that revision properties are UNVERSIONED, meaning that
# a successful propchange is destructive; the old value is gone
# forever. We recommend the hook back up the old value somewhere.
#
# On a Unix system, the normal procedure is to have 'pre-revprop-change'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'pre-revprop-change' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'pre-revprop-change.bat' or 'pre-revprop-change.exe',
# but the basic idea is the same.
#
# The hook program typically does not inherit the environment of
# its parent process. For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program, the
# culprit may be unusual (or missing) environment variables.
REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5" # empty on 06/15/2006
case "$PROPNAME" in
svn:log|CGAL:*)
exit 0;
;;
*)
echo "Changing revision properties other than svn:log is prohibited" >&2
exit 1
esac

View File

@ -1,66 +0,0 @@
#!/bin/sh
# PRE-REVPROP-CHANGE HOOK
#
# The pre-revprop-change hook is invoked before a revision property
# is added, modified or deleted. Subversion runs this hook by invoking
# a program (script, executable, binary, etc.) named 'pre-revprop-change'
# (for which this file is a template), with the following ordered
# arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] REVISION (the revision being tweaked)
# [3] USER (the username of the person tweaking the property)
# [4] PROPNAME (the property being set on the revision)
# [5] ACTION (the property is being 'A'dded, 'M'odified, or 'D'eleted)
#
# [STDIN] PROPVAL ** the new property value is passed via STDIN.
#
# If the hook program exits with success, the propchange happens; but
# if it exits with failure (non-zero), the propchange doesn't happen.
# The hook program can use the 'svnlook' utility to examine the
# existing value of the revision property.
#
# WARNING: unlike other hooks, this hook MUST exist for revision
# properties to be changed. If the hook does not exist, Subversion
# will behave as if the hook were present, but failed. The reason
# for this is that revision properties are UNVERSIONED, meaning that
# a successful propchange is destructive; the old value is gone
# forever. We recommend the hook back up the old value somewhere.
#
# On a Unix system, the normal procedure is to have 'pre-revprop-change'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'pre-revprop-change' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'pre-revprop-change.bat' or 'pre-revprop-change.exe',
# but the basic idea is the same.
#
# The hook program typically does not inherit the environment of
# its parent process. For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program, the
# culprit may be unusual (or missing) environment variables.
#
# Here is an example hook script, for a Unix /bin/sh interpreter.
# For more examples and pre-written hooks, see those in
# the Subversion repository at
# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
REPOS="$1"
REV="$2"
USER="$3"
PROPNAME="$4"
ACTION="$5"
if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi
echo "Changing revision properties other than svn:log is prohibited" >&2
exit 1

View File

@ -1,60 +0,0 @@
#!/bin/sh
# PRE-UNLOCK HOOK
#
# The pre-unlock hook is invoked before an exclusive lock is
# destroyed. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-unlock' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] PATH (the path in the repository about to be unlocked)
# [3] USER (the user destroying the lock)
#
# The default working directory for the invocation is undefined, so
# the program should set one explicitly if it cares.
#
# If the hook program exits with success, the lock is destroyed; but
# if it exits with failure (non-zero), the unlock action is aborted
# and STDERR is returned to the client.
# On a Unix system, the normal procedure is to have 'pre-unlock'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'pre-unlock' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'pre-unlock.bat' or 'pre-unlock.exe',
# but the basic idea is the same.
#
# Here is an example hook script, for a Unix /bin/sh interpreter:
REPOS="$1"
PATH="$2"
USER="$3"
# If a lock is owned by a different person, don't allow it be broken.
# (Maybe this script could send email to the to the lock owner?)
SVNLOOK=/usr/local/subversion/bin/svnlook
GREP=/bin/grep
SED=/bin/sed
LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \
$GREP '^Owner: ' | $SED 's/Owner: //'`
# If we get no result from svnlook, there's no lock, return success:
if [ "$LOCK_OWNER" == "" ]; then
exit 0
fi
# If the person unlocking matches the lock's owner, return success:
if [ "$LOCK_OWNER" == "$USER" ]; then
exit 0
fi
# Otherwise, we've got an owner mismatch, so return failure:
echo "Error: $PATH locked by ${LOCK_OWNER}." 1>&2
exit 1

View File

@ -1,89 +0,0 @@
#!/bin/sh
# START-COMMIT HOOK
#
# The start-commit hook is invoked before a Subversion txn is created
# in the process of doing a commit. Subversion runs this hook
# by invoking a program (script, executable, binary, etc.) named
# 'start-commit' (for which this file is a template)
# with the following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] USER (the authenticated user attempting to commit)
#
# The default working directory for the invocation is undefined, so
# the program should set one explicitly if it cares.
#
# If the hook program exits with success, the commit continues; but
# if it exits with failure (non-zero), the commit is stopped before
# a Subversion txn is created, and STDERR is returned to the client.
#
# On a Unix system, the normal procedure is to have 'start-commit'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'start-commit' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'start-commit.bat' or 'start-commit.exe',
# but the basic idea is the same.
#
# The hook program typically does not inherit the environment of
# its parent process. For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program, the
# culprit may be unusual (or missing) environment variables.
#
# Here is an example hook script, for a Unix /bin/sh interpreter.# For more examples and pre-written hooks, see those in
# the Subversion repository at
# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
REPOS="$1"
USER="$2"
CAPABILITIES="$3"
SVNLOOK=/usr/bin/svnlook
#if [ "$USER" = "lrineau" ]; then
# exec >&2
# if ! echo "$CAPABILITIES" | grep -q mergeinfo; then
# echo "*"
# echo "* ERROR: Your version of Subversion does not handle mergeinfo correctly."
# echo "* Your Subversion client is too old. svn>=1.5 is required to commit in CGAL repository."
# echo "* Please install a newer one from:"
# echo "* http://tortoisesvn.tigris.org/ for Windows"
# echo "* or
# echo "* -- Laurent Rineau, 2010/03/12"
# echo "*"
# exit 1
# fi
#fi
if "$SVNLOOK" cat "$REPOS" branches/next/Maintenance/git/authors-file.txt | grep -qE "^$USER =" >&2; then
echo >/dev/null
# Commit will be accepted
else
echo "---------------------------------------------------------------------------" >&2
echo "CGAL commit rejected!" >&2
echo "" >&2
echo "Your username $USER cannot be found in the following file:" >&2
echo " branches/next/Maintenance/git/authors-file.txt" >&2
echo "For that reason your commit has been rejected." >&2
echo "Ask another CGAL developer to fill the file for you (in the 'next' branch)." >&2
echo "" >&2
echo " (check added by Laurent Rineau at the Tel Aviv CGAL developers meeting," >&2
echo " 22 May 2012)" >&2
echo "---------------------------------------------------------------------------" >&2
exit 1
fi
#/home/groups/cgal/hooks/check-capabilities.pl "$REPOS" "$USER" "$CAPABILITIES"
# All checks passed, so allow the commit.
exit 0

View File

@ -1,53 +0,0 @@
#!/bin/sh
# START-COMMIT HOOK
#
# The start-commit hook is invoked before a Subversion txn is created
# in the process of doing a commit. Subversion runs this hook
# by invoking a program (script, executable, binary, etc.) named
# 'start-commit' (for which this file is a template)
# with the following ordered arguments:
#
# [1] REPOS-PATH (the path to this repository)
# [2] USER (the authenticated user attempting to commit)
#
# The default working directory for the invocation is undefined, so
# the program should set one explicitly if it cares.
#
# If the hook program exits with success, the commit continues; but
# if it exits with failure (non-zero), the commit is stopped before
# a Subversion txn is created, and STDERR is returned to the client.
#
# On a Unix system, the normal procedure is to have 'start-commit'
# invoke other programs to do the real work, though it may do the
# work itself too.
#
# Note that 'start-commit' must be executable by the user(s) who will
# invoke it (typically the user httpd runs as), and that user must
# have filesystem-level permission to access the repository.
#
# On a Windows system, you should name the hook program
# 'start-commit.bat' or 'start-commit.exe',
# but the basic idea is the same.
#
# The hook program typically does not inherit the environment of
# its parent process. For example, a common problem is for the
# PATH environment variable to not be set to its usual value, so
# that subprograms fail to launch unless invoked via absolute path.
# If you're having unexpected problems with a hook program, the
# culprit may be unusual (or missing) environment variables.
#
# Here is an example hook script, for a Unix /bin/sh interpreter.# For more examples and pre-written hooks, see those in
# the Subversion repository at
# http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/ and
# http://svn.collab.net/repos/svn/trunk/contrib/hook-scripts/
REPOS="$1"
USER="$2"
commit-allower.pl --repository "$REPOS" --user "$USER" || exit 1
special-auth-check.py --user "$USER" --auth-level 3 || exit 1
# All checks passed, so allow the commit.
exit 0

View File

@ -1,64 +0,0 @@
// Takes filenames as argument, and prints a warning for each too long line
// (>= 80 characters).
// First argument is the name of the directory.
// Following arguments are file names in this directory.
// Directory must not contain "/test".
// File names must end with ".h", ".hpp", ".C", ".c", ".cpp".
//
// Sylvain Pion. 2001, 2003, 2004.
// $Date$
// $Revision$
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
int main(int argc, char **argv)
{
if (argc < 3) {
std::cerr << "Input file name(s) as argument" << std::endl;
return -1;
}
// Check we are not in test directory.
std::string dirname (argv[1]);
if (dirname.find("/test") != std::string::npos)
return 0;
// Iterate over all files.
for (int file = 2; file < argc; ++file) {
std::string filename(argv[file]);
// Test if filename ends with ".h", ".hpp", ".C", ".c", ".cpp".
if (filename.find(".h") == std::string::npos &&
filename.find(".hpp") == std::string::npos &&
filename.find(".c") == std::string::npos &&
filename.find(".C") == std::string::npos &&
filename.find(".cpp") == std::string::npos)
continue;
std::ifstream iFile(filename.c_str());
if (!iFile.is_open())
std::cerr << "could not open file " << filename << std::endl;
unsigned line_number=0;
std::string line;
while (getline(iFile, line)) {
++line_number;
// We don't warn if line_number <= 20 because the headers usually
// emit the warning validly.
if (line.size() >= 80 && line_number > 20) {
std::cerr << std::endl << std::endl << std::endl
<< "WARNING WARNING WARNING : Line " << line_number
<< " of file " << filename
<< " is too long (" << line.size() << " characters)"
<< std::endl << std::endl << std::endl;
}
}
}
return 0;
}