diff --git a/gentoostrap.sh b/gentoostrap.sh index 039fa54..88e6bbe 100755 --- a/gentoostrap.sh +++ b/gentoostrap.sh @@ -65,6 +65,12 @@ has() { return 0 } +# Helper functions +cleanup() { + [ -z "$1" ] && warn "No argument passed to cleanup" + rm -rf "$1" || warn "Failed to remove $1: $?" +} + # Core program functions printhelp() { cat << EOF @@ -167,7 +173,7 @@ main() { # TODO: That # Validate core program dependencies log "Validating dependencies" 2 - if ! has basename curl tar; then + if ! has basename curl systemd-nspawn tar; then error "Failed to find program: $_return" 1 fi