MyNixOS website logo
Description

Cabal file access.

cabal-file is a small library on top of the 'hackage-security' library for accessing the local Hackage repo index cache, and a command-line tool cblfile which can diff .cabal versions, list package versions, save a cabal file, and show metadata from the index. It uses simple-cabal to display package dependency lists.

cabal-file

cabal-file is a library on top of the hackage-security library for accessing cabal files and versions, and also a small tool for getting and comparing .cabal files.

Since it accesses package and .cabal file data directly from the local Hackage repo cache index tar archive under ~/.cabal/ it is quite fast.

Usage

List all Hackage packages:

$ cblfile list | grep ghcide
ghcide

List versions of a package:

$ cblfile list pandoc
0.4
:
:
2.9.2.1

Diff .cabal files of package versions

$ cblfile diff pandoc 2.8 2.9.2.1
--- pandoc-2.8.cabal    2020-05-24 19:47:58.487921450 +0800
+++ pandoc-2.9.2.1.cabal        2020-05-24 19:47:58.487921450 +0800
@@ -1,10 +1,10 @@
 name:            pandoc
-version:         2.8
+version:         2.9.2.1
 cabal-version:   2.0
:
:

Latest version of a package:

$ cblfile latest extra
1.7.1

Timestamp for the latest .cabal file (or for a specific version):

$ cblfile date dhall
2020-05-19 02:18:01 UTC

Save a .cabal file (latest or specific version)

$ cblfile get purescript
$ ls purescript.cabal
purescript.cabal

Check package source metadata:

$ cblfile metadata tls-1.5.4
Size: 150171
SHA256 Hash "ce42bfa581a50f62776581da4b86408ebb1a51bc6cb2f95ad0a2ac7caa19a437"

Depends output

cblfile depends outputs quite verbose package dependency lists.

Library

For library documentation see the Hackage.Index documentation.

For example usage see app/Cmds.hs.

Motivation

I originally wrote the depends command for displaying dependency information about packages in a more friendly way.

Later, since hdiff is out of sync for some packages, and I use it particularly for comparing versions of .cabal files, I decided to create the diff command. Realising I could pull .cabal files direct from the cabal index cache, the rest of cabal-file flowed on from there.

Related

If you want full diffs of Hackage sources you can try out cabal-diff from cabal-extras.

Metadata

Version

0.1.1

Executables (1)

  • bin/cblfile

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows