#!/bin/bash # Copyright © 2017 Hartmut Goebel # License: GNU Public License v3.0 or (at your choice) later PACKAGE="${1}" if [ -z "${PACKAGE}" ] ; then PACKAGE=$(ls -td /var/tmp/guix-build-*.drv-* /tmp/guix-build-"$PACKAGE"-* 2>/dev/null | head -1) echo >&2 "No package name given, using $PACKAGE" elif [ "${PACKAGE#/var/tmp/}" = "$PACKAGE" ] ; then PACKAGE=$(ls -td /var/tmp/guix-build-"$PACKAGE"-* /tmp/guix-build-"$PACKAGE"-* 2>/dev/null | head -1) fi if [ ! -d "$PACKAGE" ] ; then echo >&2 "Not found: $PACKAGE" exit 10 fi #echo "Using $PACKAGE" # TODO: Support containers: # guix environment -C foo --ad-hoc strace gdb # rm /bin/sh # to be really like in the guix-daemon environment inifile=$(mktemp) cat > $inifile </dev/null) . echo \$PWD EOF #echo '------------' ; cat $inifile ; echo '------------' env -i HOME=/tmp bash --noprofile --init-file $inifile rm -f $inifile