Mono has two built-in mechanisms for dealing with these differences:
(1) When mono is compiled with IS_PORTABILITY_SET, then in the mono CLR, for a unix system, AltDirectorySeparatorChar is defined as "\\". (Otherwise AltDirectorySeparatorChar is defined as "/")
(2) Running the mono app with the MONO_IOMAP=all environment variable set also sets the AltDirectorySeparatorChar to "\\" on Unix systems. However, running Umbraco with this environment variable set is slow and prone to crashes.
I am going to go for a third option, where I make the path character issues explicit in code (with help from the MultiPlatformHelper class):
(3) Resolving path separator character issues in the Umbraco code itself.
The changes so far impact the downloading and installation of packages.
Preliminaries
Developer > Packages
System.IO.DirectoryNotFoundException
Could not find a part of the path ".../umbraco/presentation/App_Data/packages/created/createdPackages.config".
If this directory / file is missing get it from a working install
Developer > Packages
You get this error after clicking "OK" to install a package
System.Web.HttpException
The resource cannot be found.
Details: Requested URL: /umbraco/developer/packages/proxy.htm
Why? Umbraco referrer url is:
http://our.umbraco.org/repo_viewproject?repoguid=65194810-1f85-11dd-bd0b-0800200c9a66&callback=127.0.0.1:8080/umbraco/developer/packages/proxy.htm?/umbraco/developer/packages/installer.aspx?repoguid=65194810-1f85-11dd-bd0b-0800200c9a66&version=v45&fullversion=4.7.2&uselegacyschema=false&dotnetversion=4.0.30319.17020&trustlevel=unrestricted&project_id=8189
Notice the casing.
Solutions: rename local Packages folder to packages, or set a symbolic link.
We ll do the symbolic link for now:
cd umbraco/presentation/umbraco/developer
ln -s Packages packages
Developer > Packages
System.Exception
Error - file not found. Could not find file named '.../umbraco/presentation/App_Data/packages\...
In .../umbraco/cms/businesslogic/Packager/Repositories/Repository.cs line 209,
Replace
"packages\\" + packageGuid + ".umb"
with
return String.Format ("packages{0}{0}{1}.umb", Path.DirectorySeparatorChar, packageGuid);
Now we are ready to proceed with the alterations:
Developer > Packages
System.IO.FileNotFoundException
Could not find file ".../umbraco/presentation/App_Data/fc9f3959-3764-4678-a14e-139974cbfe30/package.xml
Decompressed File names look like: 09b6762e-67b1-4cba-b0d9-14652ddcbb30\package
Replace .../umbraco/cms/businesslogic/Packager/Installer.cs line 963:964 with:
string entryName = theEntry.Name;
if (Path.DirectorySeparatorChar.ToString() == MultiPlatformHelper.UNIX_DIRSEP)
entryName = entryName.Replace(MultiPlatformHelper.WIN_DIRSEP, Path.DirectorySeparatorChar.ToString());
string directoryName = Path.GetDirectoryName(entryName);
string fileName = Path.GetFileName(entryName);
Developer > Packages
After installation we find under .../umbraco/presentation, a directory called:
...\umbraco\presentation\, which contains the package files.
In .../umbraco/cms/businesslogic/Packager/Installer.cs
Alter lines 814:815 to
if (Path.DirectorySeparatorChar.ToString() == MultiPlatformHelper.WIN_DIRSEP)
{
path = MultiPlatformHelper.ConvertPathFromUnixToWin(path);
fileName = MultiPlatformHelper.ConvertPathFromUnixToWin(fileName);
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.