Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Add FreeBSD support to System.IO.Compression.ZipFile #2041

Merged
merged 1 commit into from
Jun 14, 2015

Conversation

janhenke
Copy link
Member

Adding support for FreeBSD to System.IO.Compression.ZipFile. PathInternal is identical to Linux, as they share the same file system requirements (paths are case sensitive and can contain all Unicode characters except NULL).

/cc @josteink @stephentoub

@josteink
Copy link
Member

I'm a bit weary about the code-duplication going on and I think we should have a future plan for getting some of the code which is common across Unixes merged into common files.

However I see the way things are done here adheres to the conventions and practices already in place in corefx for cross-platform support.

As such this LGTM.

@janhenke
Copy link
Member Author

I agree it does not seem a good path to add more platforms in the future. For now it seems the way to go, as it is the same structure across the different platforms.

The problem is that OS X is different from the other platforms. I still think this should be merged as it is. We need to discuss that issue in a wider range and implement a consistent solution later.

@stephentoub
Copy link
Member

I think the PathInternal files should be refactored slightly...

Today we have:

  • PathInternal.Windows.cs: contains a HasIllegalCharacters specific to Windows behavior and a GetComparison that's case-insensitive
  • PathInternal.Linux.cs contains a HasIllegalCharacters generally applicable to Unix and a GetComparison that's case-sensitive
  • PathInternal.OSX.cs contains a HasIllegalCharacters generally applicable to Unix and a GetComparison that's case-insensitive
    and now with this PR:
  • PathInternal.FreeBSD.cs: contains a HasIllegalCharacters specific to Windows behavior and a GetComparison that's case-sensitive

I suggest we change it to this:

  • PathInternal.Windows.cs: contains a HasIllegalCharacters specific to Windows behavior
  • PathInternal.Unix.cs: contains a HasIllegalCharacters specific Unix behavior
  • PathInternal.CaseSensitive.cs: contains a GetComparison that's case-sensitive
  • PathInternal.CaseInsensitive.cs: contains a GetComparison that's case-insensitive

Then we just include the right files in the right parts of the projects:

  • TargetsWindows gets PathInternal.Windows.cs and PathInternal.CaseInsensitive.cs
  • TargetsUnix gets PathInternal.Unix.cs
  • TargetsLinux and TargetsFreeBSD get PathInternal.CaseSensitive.cs
  • TargetsOSX gets PathInternal.CaseInsensitive.cs

I think that makes things cleaner and avoids unnecessary code duplication.

(This whole PathInternal.GetComparison thing will potentially change in the future if/when we're able to detect the right casing: #1086).

@stephentoub
Copy link
Member

If folks agree with that suggestion, I've submitted a PR (#2045) to refactor it accordingly. This PR could then be updated to use it once it's merged and avoid duplicating the files.

@janhenke
Copy link
Member Author

Originally I did not want to touch other code, but the path looks good. I am absolutely in favour of going ahead with it like you outlined.

@josteink
Copy link
Member

I'm perfectly fine with it. Go ahead :)

@ghost
Copy link

ghost commented Jun 14, 2015

@janhenke #2045 is merged. Time for a rebase! 😎

@janhenke janhenke force-pushed the System.IO.Compression.ZipFile branch from 69d63a2 to 0d78900 Compare June 14, 2015 20:06
@janhenke
Copy link
Member Author

With the re-factored code base the patch became much simpler.

@stephentoub
Copy link
Member

LGTM

@josteink
Copy link
Member

This is much better. LGTM.

stephentoub added a commit that referenced this pull request Jun 14, 2015
Add FreeBSD support to System.IO.Compression.ZipFile
@stephentoub stephentoub merged commit 8d2f914 into dotnet:master Jun 14, 2015
@janhenke janhenke deleted the System.IO.Compression.ZipFile branch June 15, 2015 05:49
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…sion.ZipFile

Add FreeBSD support to System.IO.Compression.ZipFile

Commit migrated from dotnet/corefx@8d2f914
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
5 participants