summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-05 21:46:31 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-05 21:46:31 -0600
commiteddd0fe20c0ac9645874cca70349ccfe1967e627 (patch)
tree3efd3942feada93c9a41c4486f8a70aec3cedc65
parentadc6865b29b31a32cce195d6912af039ef7eab77 (diff)
librechroot: fix clean-repov20130605.1
-rwxr-xr-xsrc/chroot-tools/librechroot2
-rw-r--r--test/librechroot-test.sh11
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