Last active
September 1, 2015 15:35
-
-
Save jdnavarro/c25a577617226e1101e0 to your computer and use it in GitHub Desktop.
Obtain a cabal.config frozen with debian package versions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/,$//' \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Obviously, this should only work for debian based distros. I tested it only in debian jessie.