Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/freight-cache
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ cd "$VARLIB"
if [ -z "$*" ]
then
DIRS="$(
find "$VARLIB" -mindepth 2 -maxdepth 2 -type d -printf "%P\n" |
find "$VARLIB"/ -mindepth 2 -maxdepth 2 -type d -printf "%P\n" |
grep -v "^\\." |
tr "\n" " "
)"
Expand All @@ -100,7 +100,7 @@ do

# Parse the manager and distro out of the Freight library path.
DIR="$(readlink -f "$DIR")"
DIR="${DIR##"$VARLIB/"}"
DIR="${DIR##"$(readlink -f "$VARLIB")/"}"
MANAGER="$(dirname "$DIR")"
DIST="$(basename "$DIR")"

Expand Down
7 changes: 7 additions & 0 deletions test/apt_add.bats
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,10 @@ setup() {
assert_output "# [freight] added ${FIXTURES}/source_1.0.orig.tar.gz to apt/example"
test -e ${FREIGHT_LIB}/apt/example/source_1.0.orig.tar.gz
}

@test "freight-add handles VARLIB being a symlink" {
mv $FREIGHT_LIB ${FREIGHT_LIB}_real
ln -s ${FREIGHT_LIB}_real $FREIGHT_LIB
freight_add ${FIXTURES}/test_1.0_all.deb apt/example/comp
test -e ${FREIGHT_LIB}_real/apt/example/comp/test_1.0_all.deb
}
8 changes: 8 additions & 0 deletions test/apt_cache.bats
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,11 @@ setup() {
assert_output ""
test -e ${FREIGHT_CACHE}/pool/example/main/t/test/test_1.0_all.deb
}

@test "freight-cache handles VARLIB being a symlink" {
mv $FREIGHT_LIB ${FREIGHT_LIB}_real
ln -s ${FREIGHT_LIB}_real $FREIGHT_LIB
freight_cache
test -e ${FREIGHT_CACHE}/pool/example/comp/t/test/test_1.0_all.deb
test -e ${FREIGHT_CACHE}/pool/example/main/t/test/test_1.0_all.deb
}