From e214ce9fa75a77436bbca77ffc9b78de31962277 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 28 Apr 2013 10:14:09 -0400 Subject: oh-installfiles: In mkdir cmd, rm / and 1+ chars. Previously, a pattern like `/usr/include/` in .pkg/files would cause oh-installfiles to run `mkdir -p .data//usr/include` and install headers in `.data/usr/include/include/`. Before: $ pkg=foo $ file=/usr/include $ echo mkdir -p "${pkg}.data/${file%/*}" mkdir -p foo.data//usr $ file=/usr/include/ $ echo mkdir -p "${pkg}.data/${file%/*}" mkdir -p foo.data//usr/include After: $ pkg=foo $ file=/usr/include $ echo mkdir -p "${pkg}.data/${file%/?*}" mkdir -p foo.data//usr $ file=/usr/include/ $ echo mkdir -p "${pkg}.data/${file%/?*}" mkdir -p foo.data//usr --- (limited to 'src') diff --git a/src/oh-installfiles.sh b/src/oh-installfiles.sh index 8538d8f..c9abd36 100644 --- a/src/oh-installfiles.sh +++ b/src/oh-installfiles.sh @@ -54,7 +54,7 @@ main() for file in "${dir}/"${pattern}; do [ -e "${file}" -o -L "${file}" ] || continue file="${file#${dir}}" - mkdir -p "${pkg}.data/${file%/*}" + mkdir -p "${pkg}.data/${file%/?*}" # TODO: If file, ln file. If dir, recursively mkdir and ln. mv "${PWD}/${dir}/${file}" "${pkg}.data/${file}" done -- cgit v0.9.1