Skip to content

Commit

Permalink
Merge pull request #131 from commercialhaskell/fix192-3
Browse files Browse the repository at this point in the history
Fix #129 loadRawPackage works with submodules on Windows
  • Loading branch information
mpilgrem authored Feb 25, 2024
2 parents 124fe5d + 838d367 commit c7e2506
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
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

0 comments on commit c7e2506

Please sign in to comment.