summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-11-10 15:49:53 (EST)
committer P. J. McDermott <pjm@nac.net>2012-11-10 15:49:53 (EST)
commit5b32c55201104265a092403b0cd490a00989d8f3 (patch)
tree0c11ccb087ffbab2e5d8b0b88d0e500449eb457f
parent6ac848d88f4b1ff0b0468fad041b86dcc8764363 (diff)
Make ob-unpacksource a bit more robust.
Some tar archives (e.g. the GNU Binutils source archive) don't have explicit directory entries.
-rw-r--r--src/ob-unpacksource.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ob-unpacksource.sh b/src/ob-unpacksource.sh
index a603393..2454189 100644
--- a/src/ob-unpacksource.sh
+++ b/src/ob-unpacksource.sh
@@ -107,8 +107,8 @@ get_upstream_compression()
get_upstream_dir()
{
- upstream_ar_dir="$(tar "-t${upstream_ar_z}f" \
- "${upstream_ar}" | sed -n 's@^\(\./\|\)\([^/]*\)\(/\|\)$@\2@p')"
+ upstream_ar_dir="$(tar "-t${upstream_ar_z}f" "${upstream_ar}" | \
+ sed -n 's@^\(\./\|\)\([^/]*\)\(/\|\).*$@\2@p' | sort | uniq)"
case "$(echo "${upstream_ar_dir}" | grep -v '^$' | wc -l)" in
0)
ob_error "$(ob_get_msg 'no_upstream_dirs')"