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

Add cabal get --only-package-description #8263

Merged
merged 1 commit into from
Jul 4, 2022
Merged

Conversation

ulysses4ever
Copy link
Collaborator

@ulysses4ever ulysses4ever commented Jul 3, 2022

This is based on #1977 and #5162, with a hope to finally close #1954.


Please include the following checklist in your PR:

Please also shortly describe how you tested your change. Bonus points for added tests!

@ulysses4ever ulysses4ever force-pushed the t1954x branch 3 times, most recently from 64bd7f4 to 792ccc1 Compare July 3, 2022 14:34
@ulysses4ever
Copy link
Collaborator Author

Apart from modernizing the old code, I added a bit of docs and a changelog as requested by @jneira on #5162.

@ulysses4ever ulysses4ever marked this pull request as ready for review July 3, 2022 14:40
@ulysses4ever
Copy link
Collaborator Author

If anyone could help me with a test, I'd add one. My attempt so far:

import Test.Cabal.Prelude
main = cabalTest $ do
  -- cabal "update" [] -- could add that but it has no visible effect
  cabal
    "get"
    [ "text", "--only-package-description" ]

Which gives me:

-----BEGIN CABAL OUTPUT-----
Error: cabal: There is no package named 'text'. 
You may need to run 'cabal update' to get the latest list of available packages.
-----END CABAL OUTPUT-----

If add cabal "update" [] before the get, I get another error before that "no package names text" one:

-----BEGIN CABAL OUTPUT-----
No remote repositories configured
-----END CABAL OUTPUT-----

@ffaf1
Copy link
Collaborator

ffaf1 commented Jul 3, 2022 via email

@jneira
Copy link
Member

jneira commented Jul 3, 2022

Many thanks for continuing the work of #5162
It looks good to me, although a test would help to get it merged
Pinging @fgaz @gbaz as they talked about the relevance of the feature

With this option, 'cabal get' writes to the destination directory only the
package description already available locally in one of the repository
indices.

The basename of the file name written to inside the target directory is
the package-id rather than only the package name.

This is mostly based on haskell#1977

Co-authored-by: Miëtek Bak <mietek@bak.io>
Co-authored-by: Artem Pelenitsyn <a.pelenitsyn@gmail.com>
@ulysses4ever
Copy link
Collaborator Author

@ffaf1 thanks a lot for the pointer. @jneira a test added.

Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, many thanks for leveraging and completing the existing work

@jneira jneira merged commit 5159ffb into haskell:master Jul 4, 2022
@ulysses4ever ulysses4ever deleted the t1954x branch July 4, 2022 14:12
ulysses4ever added a commit to ulysses4ever/cabal that referenced this pull request Jul 4, 2022
With this option, 'cabal get' writes to the destination directory only the
package description already available locally in one of the repository
indices.

The basename of the file name written to inside the target directory is
the package-id rather than only the package name.

This is mostly based on haskell#1977

Co-authored-by: Miëtek Bak <mietek@bak.io>
Co-authored-by: Artem Pelenitsyn <a.pelenitsyn@gmail.com>

Co-authored-by: Herbert Valerio Riedel <hvr@gnu.org>
Co-authored-by: Miëtek Bak <mietek@bak.io>
ulysses4ever added a commit to ulysses4ever/cabal that referenced this pull request Jul 4, 2022
With this option, 'cabal get' writes to the destination directory only the
package description already available locally in one of the repository
indices.

The basename of the file name written to inside the target directory is
the package-id rather than only the package name.

This is mostly based on haskell#1977

Co-authored-by: Miëtek Bak <mietek@bak.io>
Co-authored-by: Artem Pelenitsyn <a.pelenitsyn@gmail.com>

Co-authored-by: Herbert Valerio Riedel <hvr@gnu.org>
Co-authored-by: Miëtek Bak <mietek@bak.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request: 'cabal get --only-package-description'
5 participants