Skip to content

Instantly share code, notes, and snippets.

View DanielG's full-sized avatar

Daniel Gröber (dxld) DanielG

View GitHub Profile
#!/bin/sh
(
set -e
echo "======== ghc-pkg list ========"
ghc_ver=$(ghc --version | sed -r 's/.*[[:space:]]([0-9.]+)/\1/')
ghc-pkg list -v \
--global --user \
--package-db .cabal-sandbox/*-ghc-$ghc_ver-packages.conf.d 2>&1
#!/bin/sh
(
set -e
cd $(dirname $0)/..
echo "======== ghc-pkg list ========"
ghc_ver=$(ghc --version | sed -r 's/.*[[:space:]]([0-9.]+)/\1/')
ghc-pkg list -v \
FROM ubuntu:precise
RUN apt-get update && apt-get -y install ruby strace
ADD test.rb /root/test.rb
CMD []
ENTRYPOINT ["strace", "-f", "ruby", "/root/test.rb"]
execve("/usr/bin/ruby", ["ruby", "/root/test.rb"], [/* 3 vars */]) = 0
brk(0) = 0x1704000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9865fb0000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=7983, ...}) = 0
mmap(NULL, 7983, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9865fae000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
Warning: Permanently added '[localhost]:2022' (RSA) to the list of known hosts.
execve("/usr/bin/ruby", ["ruby", "/root/test.rb"], [/* 3 vars */]) = 0
brk(0) = 0x8ec000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7e5d9dd000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=7983, ...}) = 0
mmap(NULL, 7983, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7e5d9db000
close(3) = 0
Using a sandbox located at /home/carlo/ghc-mod/.cabal-sandbox
Searching for ghc in path.
Found ghc at /run/current-system/sw/bin/ghc
("/run/current-system/sw/bin/ghc",["--numeric-version"])
/run/current-system/sw/bin/ghc is version 7.6.3
looking for tool ghc-pkg near compiler in /run/current-system/sw/bin
found ghc-pkg in /run/current-system/sw/bin/ghc-pkg
("/run/current-system/sw/bin/ghc-pkg",["--version"])
/run/current-system/sw/bin/ghc-pkg is version 7.6.3
("/run/current-system/sw/bin/ghc",["--supported-languages"])
data ReqType = List
| Lang
| Flag
| Browse
| Check
| Expand
| Debug
| Info
| Type
| Split
Usage: ghc-mod [OPTIONS...] COMMAND [OPTIONS...]
*Global Options (OPTIONS)*
Global options can be specified before and after the command and
interspersed with command specific options
-v, --verbose
Be more verbose.
-l, --tolisp
Format output as an S-Expression
(defun ghc-run-ghc-mod (cmds &optional prog)
(let ((target (or prog ghc-module-command)))
(let ((cdir default-directory))
(with-temp-buffer
(cd cdir)
(apply 'ghc-call-process target nil t nil
(append (ghc-make-ghc-options) cmds))
(buffer-substring (point-min) (1- (point-max)))))))
#!/bin/sh
set -e
server=$1
shift
usage () {
printf '%s' "\
Usage: $0 [OPTIONS...] SERVER\n\
Options:\n\