[PR #50] [MERGED] Support writing Tar archives (Debian packages) with long file names #202

Open
opened 2026-01-29 16:31:12 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/quamotion/dotnet-packaging/pull/50
Author: @qmfrederik
Created: 11/11/2017
Status: Merged
Merged: 11/13/2017
Merged by: @qmfrederik

Base: masterHead: fixes/deb-long-filename


📝 Commits (5)

  • 15a6104 Use Encoding.UTF8 on a byte array instead of a StreamReader to make sure we stop reading when we encounter a null (\0) character.
  • 015c0ce Support reading tar archives which contain entries with long (> 100 characters) file names
  • 39057a9 Support writing tar archives with file names > 99 characters
  • f8c62cb Fix typo
  • 9efde1c Support reading long link names, too

📊 Changes

10 files changed (+207 additions, -18 deletions)

View changed files

📝 Packaging.Targets.Tests/Deb/DebPackageReaderTests.cs (+47 -1)
Packaging.Targets.Tests/Deb/largefilename.deb (+0 -0)
📝 Packaging.Targets.Tests/IO/TarFileTests.cs (+53 -2)
Packaging.Targets.Tests/IO/largefilename.tar (+0 -0)
📝 Packaging.Targets.Tests/Packaging.Targets.Tests.csproj (+6 -0)
📝 Packaging.Targets/IO/Extensions.cs (+8 -2)
📝 Packaging.Targets/IO/LinuxFileMode.cs (+11 -1)
📝 Packaging.Targets/IO/TarFile.cs (+29 -1)
📝 Packaging.Targets/IO/TarFileCreator.cs (+50 -10)
📝 Packaging.Targets/IO/TarTypeFlag.cs (+3 -1)

📄 Description

The file name in the Tar entry header is limited to 100 characters.

When adding a file with a longer file name to a Tar archive, you need to create a new entry with the name ././@LongLink and type L (TarTypeFlag.LongName), which contains the file name in the file contents.

This PR adds support for reading/writing such tar archives.

Fixes #47


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/quamotion/dotnet-packaging/pull/50 **Author:** [@qmfrederik](https://github.com/qmfrederik) **Created:** 11/11/2017 **Status:** ✅ Merged **Merged:** 11/13/2017 **Merged by:** [@qmfrederik](https://github.com/qmfrederik) **Base:** `master` ← **Head:** `fixes/deb-long-filename` --- ### 📝 Commits (5) - [`15a6104`](https://github.com/quamotion/dotnet-packaging/commit/15a6104ff683ebff251f02fd91ba53050e440f43) Use Encoding.UTF8 on a byte array instead of a StreamReader to make sure we stop reading when we encounter a null (\0) character. - [`015c0ce`](https://github.com/quamotion/dotnet-packaging/commit/015c0ce8bf8670a66c9186fe4c282f9cdc4e47c0) Support reading tar archives which contain entries with long (> 100 characters) file names - [`39057a9`](https://github.com/quamotion/dotnet-packaging/commit/39057a96c98591a079e86cf99c2b173b574bd5f7) Support writing tar archives with file names > 99 characters - [`f8c62cb`](https://github.com/quamotion/dotnet-packaging/commit/f8c62cb26c2109085d7f439a74bdaad8d10da688) Fix typo - [`9efde1c`](https://github.com/quamotion/dotnet-packaging/commit/9efde1c0c60a42a3568f3b9bca21df295b753aff) Support reading long link names, too ### 📊 Changes **10 files changed** (+207 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `Packaging.Targets.Tests/Deb/DebPackageReaderTests.cs` (+47 -1) ➕ `Packaging.Targets.Tests/Deb/largefilename.deb` (+0 -0) 📝 `Packaging.Targets.Tests/IO/TarFileTests.cs` (+53 -2) ➕ `Packaging.Targets.Tests/IO/largefilename.tar` (+0 -0) 📝 `Packaging.Targets.Tests/Packaging.Targets.Tests.csproj` (+6 -0) 📝 `Packaging.Targets/IO/Extensions.cs` (+8 -2) 📝 `Packaging.Targets/IO/LinuxFileMode.cs` (+11 -1) 📝 `Packaging.Targets/IO/TarFile.cs` (+29 -1) 📝 `Packaging.Targets/IO/TarFileCreator.cs` (+50 -10) 📝 `Packaging.Targets/IO/TarTypeFlag.cs` (+3 -1) </details> ### 📄 Description The file name in the Tar entry header is limited to 100 characters. When adding a file with a longer file name to a Tar archive, you need to create a new entry with the name `././@LongLink` and type `L` (`TarTypeFlag.LongName`), which contains the file name in the file contents. This PR adds support for reading/writing such tar archives. Fixes #47 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 16:31:12 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dotnet-packaging#202