Permalink
Browse files

Potential Bug in Mirror Name Guessing

I was stripping everything from the last . to the end, then taking the
basename.

That would have failed, though, on "blah/.local/meow" as it would have
stripped it to "blah/", then taken the basename.

Now I'm taking the basename of the whole thing, then removing the end.
  • Loading branch information...
1 parent ec92c36 commit 00241b538d2961a96fc19ccbc4b884ec923d94dc @psycotica0 committed Nov 13, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 build_mirror
View
@@ -12,7 +12,7 @@ if [ -z "$IMAGE_FILE" ]; then
fi
if [ -z "$MIRROR_NAME" ]; then
- MIRROR_NAME="$(basename "${IMAGE_FILE%.*}")"
+ MIRROR_NAME="$(basename "$IMAGE_FILE" | sed 's/\.[^.]*$//')"
fi
MIRROR_LOCATION="$DATA_LOCATION/$MIRROR_NAME"

0 comments on commit 00241b5

Please sign in to comment.