https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91084

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is not a BSD problem, it's just a case of writing a portable shell script.

This should work:

--- a/contrib/download_prerequisites
+++ b/contrib/download_prerequisites
@@ -241,9 +241,15 @@ unset ar
 for ar in $(echo_archives)
 do
     package="${ar%.tar*}"
+    decompress_flag=
+    case $ar:$OS in
+      *.tar.gz:OpenBSD) decompress_flag=-z ;;
+      *.tar.bz2:OpenBSD) decompress_flag=-j ;;
+      *:OpenBSD) die "Unknown format: ${ar#*.tar}" ;;
+    esac
     if [ ${force} -gt 0 ]; then rm -rf "${directory}/${package}"; fi
     [ -e "${directory}/${package}" ]                                         
\
-        || ( cd "${directory}" && tar -xf "${ar}" )                          
\
+        || ( cd "${directory}" && tar $decompress_flag -xf "${ar}" )          
                \
         || die "Cannot extract package from ${ar}"
     unset package
 done

Reply via email to