-
Notifications
You must be signed in to change notification settings - Fork 38
Add support for over-long filepaths via GNU extension and fix hardlinks #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for over-long filepaths via GNU extension and fix hardlinks #50
Conversation
7f87a34
to
452f667
Compare
There seems to be no interest of clc or anyone to maintain this package? I've since then forked it and will probably abandon that fork somtime soon in favor of libarchive. |
I'm going to reopen because I sincerly hope this package will get more active maintenance and this should be fixed. |
@hasufell My only critique don't think the addition of |
6a4f311
to
db12e9d
Compare
Updated and backported patch from hasufell@8e7b1d5 |
13d4557
to
17efd36
Compare
Added a fix for #35 |
a71015f
to
f2f96cd
Compare
Added fix for #63 |
b093976
to
8a53ab5
Compare
I do not particularly mind depending on |
I don't know what you mean by that. You'll have to be more specific. That's what PVP is for. |
8a53ab5
to
c067875
Compare
c067875
to
50e6536
Compare
I just realized the version is bumped to I removed |
58f1ac6
to
be0b663
Compare
Well, this is certainly a major bump according to PVP, but that's not my point. How disruptive is this change for clients (like, |
There's nothing disruptive about this. Instead of When |
I just built cabal-install with this branch. All it took was: --- a/cabal-install/src/Distribution/Client/SrcDist.hs
+++ b/cabal-install/src/Distribution/Client/SrcDist.hs
@@ -62,8 +62,9 @@ packageDirToSdist verbosity gpd dir = do
let prefix = prettyShow (packageId gpd)
modify (Set.insert prefix)
case Tar.toTarPath True prefix of
- Left err -> liftIO $ die' verbosity ("Error packing sdist: " ++ err)
- Right path -> tell [Tar.directoryEntry path]
+ Tar.This err -> liftIO $ die' verbosity ("Error packing sdist: " ++ show err)
+ Tar.These err _ -> liftIO $ die' verbosity ("Error packing sdist: " ++ show err)
+ Tar.That path -> tell [Tar.directoryEntry path]
for_ files $ \file -> do
let fileDir = takeDirectory (prefix </> file)
@@ -72,13 +73,15 @@ packageDirToSdist verbosity gpd dir = do
when needsEntry $ do
modify (Set.insert fileDir)
case Tar.toTarPath True fileDir of
- Left err -> liftIO $ die' verbosity ("Error packing sdist: " ++ err)
- Right path -> tell [Tar.directoryEntry path]
+ Tar.This err -> liftIO $ die' verbosity ("Error packing sdist: " ++ show err)
+ Tar.These err _ -> liftIO $ die' verbosity ("Error packing sdist: " ++ show err)
+ Tar.That path -> tell [Tar.directoryEntry path]
contents <- liftIO . fmap BSL.fromStrict . BS.readFile $ dir </> file
case Tar.toTarPath False (prefix </> file) of
- Left err -> liftIO $ die' verbosity ("Error packing sdist: " ++ err)
- Right path -> tell [(Tar.fileEntry path contents) { Tar.entryPermissions = Tar.ordinaryFilePermissions }]
+ Tar.This err -> liftIO $ die' verbosity ("Error packing sdist: " ++ show err)
+ Tar.These err _ -> liftIO $ die' verbosity ("Error packing sdist: " ++ show err)
+ Tar.That path -> tell [(Tar.fileEntry path contents) { Tar.entryPermissions = Tar.ordinaryFilePermissions }]
entries <- execWriterT (evalStateT entriesM mempty)
let -- Pretend our GZip file is made on Unix. To support over-long filepaths, the patch is as follows: --- a/cabal-install/src/Distribution/Client/SrcDist.hs
+++ b/cabal-install/src/Distribution/Client/SrcDist.hs
@@ -62,8 +62,9 @@ packageDirToSdist verbosity gpd dir = do
let prefix = prettyShow (packageId gpd)
modify (Set.insert prefix)
case Tar.toTarPath True prefix of
- Left err -> liftIO $ die' verbosity ("Error packing sdist: " ++ err)
- Right path -> tell [Tar.directoryEntry path]
+ Tar.This err -> liftIO $ die' verbosity ("Error packing sdist: " ++ show err)
+ Tar.These _ path -> tell [Tar.longLinkEntry prefix, Tar.directoryEntry path]
+ Tar.That path -> tell [Tar.directoryEntry path]
for_ files $ \file -> do
let fileDir = takeDirectory (prefix </> file)
@@ -72,13 +73,15 @@ packageDirToSdist verbosity gpd dir = do
when needsEntry $ do
modify (Set.insert fileDir)
case Tar.toTarPath True fileDir of
- Left err -> liftIO $ die' verbosity ("Error packing sdist: " ++ err)
- Right path -> tell [Tar.directoryEntry path]
+ Tar.This err -> liftIO $ die' verbosity ("Error packing sdist: " ++ show err)
+ Tar.These _ path -> tell [Tar.longLinkEntry fileDir, Tar.directoryEntry path]
+ Tar.That path -> tell [Tar.directoryEntry path]
contents <- liftIO . fmap BSL.fromStrict . BS.readFile $ dir </> file
case Tar.toTarPath False (prefix </> file) of
- Left err -> liftIO $ die' verbosity ("Error packing sdist: " ++ err)
- Right path -> tell [(Tar.fileEntry path contents) { Tar.entryPermissions = Tar.ordinaryFilePermissions }]
+ Tar.This err -> liftIO $ die' verbosity ("Error packing sdist: " ++ show err)
+ Tar.These _ path -> tell [Tar.longLinkEntry (prefix </> file), Tar.directoryEntry path]
+ Tar.That path -> tell [(Tar.fileEntry path contents) { Tar.entryPermissions = Tar.ordinaryFilePermissions }]
entries <- execWriterT (evalStateT entriesM mempty)
let -- Pretend our GZip file is made on Unix. |
678cfe0
to
9b5970c
Compare
What are the current action items needed to get this patch over the last few ready to merge hump? I’m happy to help however is needed |
Fixes #49 And #51
UTF8 filenames are still broken, but this is not in the scope of this PR. I tested this with the GHC bindist (packing and unpacking).