Skip to content

Instantly share code, notes, and snippets.

@jdnavarro
Last active September 1, 2015 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdnavarro/c25a577617226e1101e0 to your computer and use it in GitHub Desktop.
Save jdnavarro/c25a577617226e1101e0 to your computer and use it in GitHub Desktop.
Obtain a cabal.config frozen with debian package versions
#!/bin/sh
set -e
type grep-aptavail >/dev/null 2>&1 || {
echo >&2 "grep-aptavail (dctrl-tools) needs to be installed";
exit 1;
}
. /etc/os-release
echo "-- $PRETTY_NAME"
echo "-- Created on $(date)"
grep-aptavail -F Ghc-Package . -s Ghc-Package -n \
| sort \
| perl -ne 'BEGIN {print "constraints:\n"} /^(.*)-([0-9\.]*)-(.*)$/; print " $1 ==$2,\n"' \
| sed '$s/,$//' \
@jdnavarro
Copy link
Author

Obviously, this should only work for debian based distros. I tested it only in debian jessie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment