From 5b32c55201104265a092403b0cd490a00989d8f3 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 10 Nov 2012 15:49:53 -0500 Subject: Make ob-unpacksource a bit more robust. Some tar archives (e.g. the GNU Binutils source archive) don't have explicit directory entries. --- (limited to 'src') 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')" -- cgit v0.9.1