From 3b4594477f467c81096a085f43c2224983dede49 Mon Sep 17 00:00:00 2001 From: kichik Date: Sat, 1 Dec 2007 12:20:27 +0000 Subject: [PATCH] ensure bug #1835866 and #1831677 won't repeat git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5391 212acab6-be3b-0410-9dea-997c60f758d6 --- Scripts/release.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Scripts/release.py b/Scripts/release.py index 23874412..1601e37e 100644 --- a/Scripts/release.py +++ b/Scripts/release.py @@ -2,6 +2,7 @@ requires Python Image Library - http://www.pythonware.com/products/pil/ requires grep and diff - http://www.mingw.org/msys.shtml requires command line svn - http://subversion.tigris.org/ +requires pysvn - http://pysvn.tigris.org/ example release.cfg: ========================= @@ -59,6 +60,7 @@ import Image, ImageFont, ImageDraw from ConfigParser import ConfigParser from ftplib import FTP import time +import pysvn ### read config @@ -156,6 +158,45 @@ def RunTests(): 'tests failed - see test.log for details' ) +def TestSubversionEOL(): + print 'ensuring EOL...' + + from os import walk + from os.path import join + from os.path import splitext + + eoldict = { + '.nsh' : 'native', + '.nsi' : 'native', + '.txt' : 'native', + '.ini' : 'CRLF' + } + + exceptions = ['newfile.txt', 'oldfile.txt'] + + svn = pysvn.Client() + + for root, dirs, files in walk('..'): + if '.svn' not in dirs: + continue + + def versioned(f): + s = svn.status(join(root, f))[0].text_status + return s != pysvn.wc_status_kind.unversioned + + svn_files = filter(versioned, files) + svn_files = filter(lambda x: x not in exceptions, svn_files) + + for f in svn_files: + ext = splitext(f)[1] + if ext in eoldict.keys(): + eol = eoldict[ext] + s = svn.propget('svn:eol-style', join(root, f)).values() + if not s or s[0] != eol: + print '*** %s has bad eol-style' % f + log('*** %s has bad eol-style' % f) + exit() + def CreateMenuImage(): print 'creating images...' @@ -392,6 +433,7 @@ def CloseLog(): Confirm() StartLog() RunTests() +TestSubversionEOL() CreateMenuImage() CommitMenuImage() TestInstaller()