Skip to content

Commit

Permalink
feat(stack): Derive the VCS path from the subdir in the cabal file
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Jul 3, 2024
1 parent 4d49fc2 commit e4e4859
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1122,12 +1122,12 @@ packages:
type: "Git"
url: "https://github.com/haskell-compat/base-compat"
revision: ""
path: ""
path: "base-compat"
vcs_processed:
type: "Git"
url: "https://github.com/haskell-compat/base-compat.git"
revision: ""
path: ""
path: "base-compat"
- id: "Hackage:Compatibility:base-orphans:0.8"
purl: "pkg:hackage/Compatibility/[email protected]"
authors:
Expand Down Expand Up @@ -2399,12 +2399,12 @@ packages:
type: "Git"
url: "https://github.com/haskell/cabal/"
revision: ""
path: ""
path: "Cabal"
vcs_processed:
type: "Git"
url: "https://github.com/haskell/cabal.git"
revision: ""
path: ""
path: "Cabal"
- id: "Hackage:GHC:ghc-prim:0.5.3"
purl: "pkg:hackage/GHC/[email protected]"
declared_licenses:
Expand All @@ -2428,12 +2428,12 @@ packages:
type: "Git"
url: "http://git.haskell.org/ghc.git"
revision: ""
path: ""
path: "libraries/ghc-prim"
vcs_processed:
type: "Git"
url: "http://git.haskell.org/ghc.git"
revision: ""
path: ""
path: "libraries/ghc-prim"
- id: "Hackage:Generics:generics-sop:0.4.0.1"
purl: "pkg:hackage/Generics/[email protected]"
authors:
Expand Down Expand Up @@ -2803,12 +2803,12 @@ packages:
type: "Git"
url: "http://git.haskell.org/ghc.git"
revision: ""
path: ""
path: "libraries/base"
vcs_processed:
type: "Git"
url: "http://git.haskell.org/ghc.git"
revision: ""
path: ""
path: "libraries/base"
- id: "Hackage:System:directory:1.3.3.0"
purl: "pkg:hackage/System/[email protected]"
declared_licenses:
Expand Down Expand Up @@ -3110,12 +3110,12 @@ packages:
type: "Git"
url: "http://git.haskell.org/ghc.git"
revision: ""
path: ""
path: "libraries/template-haskell"
vcs_processed:
type: "Git"
url: "http://git.haskell.org/ghc.git"
revision: ""
path: ""
path: "libraries/template-haskell"
- id: "Hackage:Testing:QuickCheck:2.13.1"
purl: "pkg:hackage/Testing/[email protected]"
authors:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125482,12 +125482,12 @@ packages:
type: "Git"
url: "https://github.com/haskell-compat/base-compat"
revision: ""
path: ""
path: "base-compat"
vcs_processed:
type: "Git"
url: "https://github.com/haskell-compat/base-compat.git"
revision: ""
path: ""
path: "base-compat"
- id: "Hackage:Compatibility:base-compat-batteries:0.11.2"
purl: "pkg:hackage/Compatibility/[email protected]"
authors:
Expand Down Expand Up @@ -125524,12 +125524,12 @@ packages:
type: "Git"
url: "https://github.com/haskell-compat/base-compat"
revision: ""
path: ""
path: "base-compat-batteries"
vcs_processed:
type: "Git"
url: "https://github.com/haskell-compat/base-compat.git"
revision: ""
path: ""
path: "base-compat-batteries"
- id: "Hackage:Compatibility:base-orphans:0.8.4"
purl: "pkg:hackage/Compatibility/[email protected]"
authors:
Expand Down Expand Up @@ -126566,12 +126566,12 @@ packages:
type: "Git"
url: "git://github.com/vincenthz/hs-crypto-cipher"
revision: ""
path: ""
path: "types"
vcs_processed:
type: "Git"
url: "https://github.com/vincenthz/hs-crypto-cipher.git"
revision: ""
path: ""
path: "types"
- id: "Hackage:Cryptography:crypto-random:0.0.9"
purl: "pkg:hackage/Cryptography/[email protected]"
authors:
Expand All @@ -126598,12 +126598,12 @@ packages:
type: "Git"
url: "git://github.com/vincenthz/hs-crypto-random"
revision: ""
path: ""
path: "types"
vcs_processed:
type: "Git"
url: "https://github.com/vincenthz/hs-crypto-random.git"
revision: ""
path: ""
path: "types"
- id: "Hackage:Cryptography:cryptonite:0.26"
purl: "pkg:hackage/Cryptography/[email protected]"
authors:
Expand Down Expand Up @@ -126784,12 +126784,12 @@ packages:
type: "Git"
url: "https://github.com/vincenthz/hs-asn1"
revision: ""
path: ""
path: "encoding"
vcs_processed:
type: "Git"
url: "https://github.com/vincenthz/hs-asn1.git"
revision: ""
path: ""
path: "encoding"
- id: "Hackage:Data:asn1-parse:0.9.5"
purl: "pkg:hackage/Data/[email protected]"
authors:
Expand Down Expand Up @@ -126817,12 +126817,12 @@ packages:
type: "Git"
url: "https://github.com/vincenthz/hs-asn1"
revision: ""
path: ""
path: "parse"
vcs_processed:
type: "Git"
url: "https://github.com/vincenthz/hs-asn1.git"
revision: ""
path: ""
path: "parse"
- id: "Hackage:Data:asn1-types:0.3.4"
purl: "pkg:hackage/Data/[email protected]"
authors:
Expand Down Expand Up @@ -127875,12 +127875,12 @@ packages:
type: "Git"
url: "git://github.com/vincenthz/hs-certificate"
revision: ""
path: ""
path: "x509"
vcs_processed:
type: "Git"
url: "https://github.com/vincenthz/hs-certificate.git"
revision: ""
path: ""
path: "x509"
- id: "Hackage:Data:x509-store:1.6.7"
purl: "pkg:hackage/Data/[email protected]"
authors:
Expand Down Expand Up @@ -127908,12 +127908,12 @@ packages:
type: "Git"
url: "git://github.com/vincenthz/hs-certificate"
revision: ""
path: ""
path: "x509-store"
vcs_processed:
type: "Git"
url: "https://github.com/vincenthz/hs-certificate.git"
revision: ""
path: ""
path: "x509-store"
- id: "Hackage:Data:x509-system:1.6.6"
purl: "pkg:hackage/Data/[email protected]"
authors:
Expand All @@ -127940,12 +127940,12 @@ packages:
type: "Git"
url: "git://github.com/vincenthz/hs-certificate"
revision: ""
path: ""
path: "x509-system"
vcs_processed:
type: "Git"
url: "https://github.com/vincenthz/hs-certificate.git"
revision: ""
path: ""
path: "x509-system"
- id: "Hackage:Data:x509-validation:1.6.11"
purl: "pkg:hackage/Data/[email protected]"
authors:
Expand All @@ -127972,12 +127972,12 @@ packages:
type: "Git"
url: "git://github.com/vincenthz/hs-certificate"
revision: ""
path: ""
path: "x509-validation"
vcs_processed:
type: "Git"
url: "https://github.com/vincenthz/hs-certificate.git"
revision: ""
path: ""
path: "x509-validation"
- id: "Hackage:Data:yaml:0.11.5.0"
purl: "pkg:hackage/Data/[email protected]"
authors:
Expand Down Expand Up @@ -129070,12 +129070,12 @@ packages:
type: "Git"
url: "https://github.com/haskell/cabal/"
revision: ""
path: ""
path: "Cabal"
vcs_processed:
type: "Git"
url: "https://github.com/haskell/cabal.git"
revision: ""
path: ""
path: "Cabal"
- id: "Hackage:Distribution:cabal-doctest:1.0.8"
purl: "pkg:hackage/Distribution/[email protected]"
authors:
Expand Down Expand Up @@ -129135,12 +129135,12 @@ packages:
type: "Git"
url: "http://git.haskell.org/ghc.git"
revision: ""
path: ""
path: "libraries/ghc-prim"
vcs_processed:
type: "Git"
url: "http://git.haskell.org/ghc.git"
revision: ""
path: ""
path: "libraries/ghc-prim"
- id: "Hackage:Language:language-javascript:0.7.1.0"
purl: "pkg:hackage/Language/[email protected]"
authors:
Expand Down Expand Up @@ -129635,12 +129635,12 @@ packages:
type: "Git"
url: "https://github.com/vincenthz/hs-tls"
revision: ""
path: ""
path: "core"
vcs_processed:
type: "Git"
url: "https://github.com/vincenthz/hs-tls.git"
revision: ""
path: ""
path: "core"
- id: "Hackage:Network, Web:http-date:0.0.10"
purl: "pkg:hackage/Network%2C%20Web/[email protected]"
authors:
Expand Down Expand Up @@ -129800,12 +129800,12 @@ packages:
type: "Git"
url: "git://github.com/haskell/aeson.git"
revision: ""
path: ""
path: "attoparsec-iso8601"
vcs_processed:
type: "Git"
url: "https://github.com/haskell/aeson.git"
revision: ""
path: ""
path: "attoparsec-iso8601"
- id: "Hackage:Parsing:parsec:3.1.14.0"
purl: "pkg:hackage/Parsing/[email protected]"
authors:
Expand Down Expand Up @@ -129871,12 +129871,12 @@ packages:
type: "Git"
url: "https://gitlab.haskell.org/ghc/ghc.git"
revision: ""
path: ""
path: "libraries/base"
vcs_processed:
type: "Git"
url: "https://gitlab.haskell.org/ghc/ghc.git"
revision: ""
path: ""
path: "libraries/base"
- id: "Hackage:System:byteorder:1.0.4"
purl: "pkg:hackage/System/[email protected]"
authors:
Expand Down Expand Up @@ -130461,12 +130461,12 @@ packages:
type: "Git"
url: "https://gitlab.haskell.org/ghc/ghc.git"
revision: ""
path: ""
path: "libraries/template-haskell"
vcs_processed:
type: "Git"
url: "https://gitlab.haskell.org/ghc/ghc.git"
revision: ""
path: ""
path: "libraries/template-haskell"
- id: "Hackage:Template Haskell:th-lift-instances:0.1.18"
purl: "pkg:hackage/Template%20Haskell/[email protected]"
authors:
Expand Down Expand Up @@ -131016,12 +131016,12 @@ packages:
type: "Git"
url: "https://github.com/haskell-foundation/foundation"
revision: ""
path: ""
path: "basement"
vcs_processed:
type: "Git"
url: "https://github.com/haskell-foundation/foundation.git"
revision: ""
path: ""
path: "basement"
- id: "Hackage:Web:clientsession:0.9.1.2"
purl: "pkg:hackage/Web/[email protected]"
authors:
Expand Down
4 changes: 3 additions & 1 deletion plugins/package-managers/stack/src/main/kotlin/Stack.kt
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,12 @@ private fun parseCabalFile(cabal: String, identifierType: String): Package {

val vcsType = (map["source-repository-this-type"] ?: map["source-repository-head-type"]).orEmpty()
val vcsUrl = (map["source-repository-this-location"] ?: map["source-repository-head-location"]).orEmpty()
val vcsPath = (map["source-repository-this-subdir"] ?: map["source-repository-head-subdir"]).orEmpty()
val vcs = VcsInfo(
type = VcsType.forName(vcsType),
revision = map["source-repository-this-tag"].orEmpty(),
url = vcsUrl
url = vcsUrl,
path = vcsPath
)

val homepageUrl = map["homepage"].orEmpty()
Expand Down

0 comments on commit e4e4859

Please sign in to comment.