Skip to content
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

Fix #129 loadRawPackage works with submodules on Windows #131

Merged
merged 1 commit into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog for pantry

## v0.9.3.3

* Bug fix: On Windows, `loadPackageRaw` supports repositories with submodules,
as intended.

## v0.9.3.2

* Support `ansi-terminal-1.0.2`.
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: pantry
version: 0.9.3.2
version: 0.9.3.3
synopsis: Content addressable Haskell package management
description: Please see the README on GitHub at <https://github.com/commercialhaskell/pantry#readme>
category: Development
Expand Down
2 changes: 1 addition & 1 deletion pantry.cabal

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 13 additions & 7 deletions src/Pantry/Repo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,19 @@ archiveSubmodules tarball = do
then " --force-local "
else mempty
case tarType of
Gnu -> runGitCommand
[ "submodule"
, "foreach"
, "--recursive"
, "git -c core.autocrlf=false archive --prefix=$displaypath/ -o bar.tar HEAD; "
<> "tar" <> forceLocal <> " -Af " <> tarball <> " bar.tar"
]
Gnu -> do
-- Single quotation marks are required around tarball because otherwise,
-- in the foreach environment, the \ character in absolute paths on
-- Windows will be interpreted as escaping the following character.
let foreachCommand =
"git -c core.autocrlf=false archive --prefix=$displaypath/ -o bar.tar HEAD; "
<> "tar" <> forceLocal <> " -Af '" <> tarball <> "' bar.tar"
runGitCommand
[ "submodule"
, "foreach"
, "--recursive"
, foreachCommand
]
Bsd -> runGitCommand
[ "submodule"
, "foreach"
Expand Down