From eddd0fe20c0ac9645874cca70349ccfe1967e627 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 5 Jun 2013 21:46:31 -0600 Subject: librechroot: fix clean-repo --- src/chroot-tools/librechroot | 2 +- test/librechroot-test.sh | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 55b3324..1247e3c 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -271,7 +271,7 @@ main() { run) archroot -r "$copydir" "$@";; enter) archroot -r "$copydir" bash;; clean-repo) - rm -rf "${copydir}/repo/*" + rm -rf "${copydir}"/repo/* make_empty_repo "$copydir" ;; esac diff --git a/test/librechroot-test.sh b/test/librechroot-test.sh index 9dc1b7d..06abd23 100644 --- a/test/librechroot-test.sh +++ b/test/librechroot-test.sh @@ -7,7 +7,7 @@ describe librechroot before() { _before librechroot mkdir -p "$XDG_CONFIG_HOME"/libretools - echo "CHROOTDIR='$tmpdir'" > "$XDG_CONFIG_HOME"/libretools/chroot.conf + echo "CHROOTDIR='$tmpdir/chrootdir'" > "$XDG_CONFIG_HOME"/libretools/chroot.conf echo "CHROOT='default'" >> "$XDG_CONFIG_HOME"/libretools/chroot.conf echo "CHROOTEXTRAPKG=()" >> "$XDG_CONFIG_HOME"/libretools/chroot.conf } @@ -23,6 +23,15 @@ it_creates_repo_for_new_chroots() { sudo -EH librechroot run test -r /repo/repo.db } +it_cleans_the_local_repo_correctly() { + require network sudo || return 0 + libremessages msg 'Creating a chroot, may take a few minutes' &>/dev/tty + sudo -EH librechroot make + sudo -EH librechroot clean-repo + sudo -EH librechroot run test -r /repo/repo.db + # TODO: inspect /repo/* more +} + it_displays_help_as_normal_user() { rm -rf "$XDG_CONFIG_HOME" librechroot help >$tmpdir/stdout 2>$tmpdir/stderr -- cgit v1.2.3-54-g00ecf