SVN EOL and the WordPress.org repository

As you might now we’ve recently released Profile Builder e front-end registration, login and edit profile plugin.

All went well and we’ve got proper feedback. Apparently people liked the idea.

However, when the time came to put it on the repository things started to get weird. For reasons beyond my understanding, the profilebuilder.php and uninstall.php files were converted to Mac EndOfLine style once uploaded to the Repository (I’m a PC user). Because of this the plugin install would fail and didn’t even appear in the plugin listing in the backend, which is to be expected since the lines were all scrambled up.

After a bit of digging around I found about a SVN property called svn:eol-style that, when set to “native“, allows automatic conversion of end-of-lines, depending whether you are on Linux or Windows. Apparently this isn’t setup by default when you install Turtoise SVN.

To get is sorted you need to add some code to the config file in subversion.

Add this stuff at bottom of your local file ~/.subversion/config. For Windows 7 users this is normally found at
C:\Users\{username}\AppData\Roaming\Subversion\config

This will ensure that all new source files will have this property.

[miscellany]
enable-auto-props = yes
 
# Note: you may wish to add svn:keywords as well, depending on your project requirements
# E.g. svn:keywords=Date Author Id Revision HeadURL
 
# Do not default any files to svn:executable=*.
# This should only be done on an individual basis as required.
 
[auto-props]
INSTALL = svn:eol-style=native
KEYS = svn:eol-style=native
Makefile = svn:eol-style=native
LICENSE = svn:eol-style=native
NOTICE = svn:eol-style=native
README = svn:eol-style=native
abs-linkmap = svn:eol-style=native
abs-menulinks = svn:eol-style=native
*.aart = svn:eol-style=native
*.ac = svn:eol-style=native
*.am = svn:eol-style=native
*.apt = svn:eol-style=native
*.bat = svn:eol-style=native
*.bsh = svn:eol-style=native
*.c = svn:eol-style=native
*.cat = svn:eol-style=native
*.cgi = svn:eol-style=native
*.classpath = svn:eol-style=native
*.cmd = svn:eol-style=native
*.cnd = svn:eol-style=native
*.conf = svn:eol-style=native
*.config = svn:eol-style=native
*.cpp = svn:eol-style=native
*.css = svn:eol-style=native
*.cwiki = svn:eol-style=native
*.data = svn:eol-style=native
*.dcl = svn:eol-style=native
*.doc = svn:mime-type=application/msword
*.dsp = svn:eol-style=CRLF
*.dsw = svn:eol-style=CRLF
*.dtd = svn:eol-style=native
*.egrm = svn:eol-style=native
*.ent = svn:eol-style=native
*.ft = svn:eol-style=native
*.fn = svn:eol-style=native
*.fv = svn:eol-style=native
*.g = svn:eol-style=native
*.gif = svn:mime-type=image/gif
*.grm = svn:eol-style=native
*.gz = svn:mime-type=application/x-gzip
*.h = svn:eol-style=native
*.htc = svn:eol-style=native
.htaccess = svn:eol-style=native
*.handlers = svn:eol-style=native
*.html = svn:eol-style=native
*.ico = svn:mime-type=image/x-icon
*.ihtml = svn:eol-style=native
*.in = svn:eol-style=native
*.java = svn:eol-style=native
*.jmx = svn:eol-style=LF
*.jpg = svn:mime-type=image/jpeg
*.jsp = svn:eol-style=native
*.js = svn:eol-style=native
*.junit = svn:eol-style=native
*.jx = svn:eol-style=native
*.m = svn:eol-style=native
*.m4 = svn:eol-style=native
*.manifest = svn:eol-style=native
*.mdo = svn:eol-style=native
# markdown (CMS)
*.mdtext = svn:eol-style=native
*.meta = svn:eol-style=native
*.mf = svn:eol-style=native
*.MF = svn:eol-style=native
*.mod = svn:eol-style=native
*.ms = svn:eol-style=native
*.n3 = svn:eol-style=native
*.nroff = svn:eol-style=native
*.patch = svn:eol-style=native
*.pdf = svn:mime-type=application/pdf
*.pen = svn:eol-style=native
*.php = svn:eol-style=native
*.pl = svn:eol-style=native
*.pm = svn:eol-style=native
*.png = svn:mime-type=image/png
*.pod = svn:eol-style=native
*.pom = svn:eol-style=native
*.project = svn:eol-style=native
*.properties = svn:eol-style=native
*.py = svn:eol-style=native
*.rb = svn:eol-style=native
*.rdf = svn:eol-style=native
*.rnc = svn:eol-style=native
*.rng = svn:eol-style=native
*.rnx = svn:eol-style=native
*.roles = svn:eol-style=native
*.rss = svn:eol-style=native
# Restructured text (CMS)
*.rst = svn:eol-style=native
*.scala = svn:eol-style=native
*.schemas = svn:eol-style=native
*.sh = svn:eol-style=native
*.sql = svn:eol-style=native
*.svg = svn:eol-style=native
*.tar = svn:mime-type=application/octet-stream
*.tgz = svn:mime-type=application/octet-stream
*.tif = svn:mime-type=image/tiff
*.tiff = svn:mime-type=image/tiff
*.tld = svn:eol-style=native
*.txt = svn:eol-style=native
*.types = svn:eol-style=native
*.vm = svn:eol-style=native
*.vsl = svn:eol-style=native
*.wsdd = svn:eol-style=native
*.wsdl = svn:eol-style=native
*.xargs = svn:eol-style=native
*.xcat = svn:eol-style=native
*.xconf = svn:eol-style=native
*.xegrm = svn:eol-style=native
*.xgrm = svn:eol-style=native
*.xhtml = svn:eol-style=native
*.xhtml2 = svn:eol-style=native
*.xlex = svn:eol-style=native
*.xlog = svn:eol-style=native
*.xmap = svn:eol-style=native
*.xml = svn:eol-style=native
*.xroles = svn:eol-style=native
*.xsamples = svn:eol-style=native
*.xsd = svn:eol-style=native
*.xsl = svn:eol-style=native
*.xslt = svn:eol-style=native
*.xsp = svn:eol-style=native
*.xtest = svn:eol-style=native
*.xul = svn:eol-style=native
*.xweb = svn:eol-style=native
*.xwelcome = svn:eol-style=native

This config file comes from the apache website. Please note that you might not need all those file-types.

After you do this you still have to apply this to your existing SVN files.

Run a script to recursively set this property on all your source files. First, MAKE SURE YOU ARE UP TO DATE WITH THE REPOSITORY, WITH NO LOCAL CHANGES. Then: you can run this under your source folder:

    FOR /R %i IN (*.php;*.js;*.txt;*.html) DO svn propset svn:eol-style native %i

After these setting stuff came back to normal and I could install the plugin properly from the Repository.

While all this seams straight forward for me now, I had to spend more then 5 hours to figure it out. It was very frustrating seeing the plugin fail on install when the local version worked perfectly.

About Cristian Antohe

Cristian Antohe is the co-founder Cozmoslabs. He's a WordPress developer, web designer and Open Source fanatic. He's part of the team that developed Profile Builder and WordPress Creation Kit and also helps curate wpMail.me.

Find me on: Google + | Twitter

Leave a Reply

Your email address will not be published. Required fields are marked *


8 − seven =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>