Update references to hapi_src to hapi_impl and revert hapiRegisterCallbacks
[charm.git] / contrib / update-hwloc.sh
blob230e0cfaa458e1241da3293be0cd0e9fdbf35ffe
1 #!/bin/bash
3 if [[ -z "$1" ]]; then
4 echo "$0" '<hwloc-X.Y.Z.tar.(gz|bz2)>'
5 exit 0
6 fi
8 get_abs_filename()
10 echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
13 # Get the absolute path of the tarball now so it is valid after we chdir
14 input=$(get_abs_filename "$1")
16 pushd $(dirname "$0") > /dev/null
18 # Refresh the folder contents
19 rm -r hwloc
20 mkdir hwloc
21 cd hwloc
22 extension="${input##*.}"
23 if [ "$extension" = "gz" ]; then
24 tar -xzf "$input" --strip-components=1
25 elif [ "$extension" = "bz2" ]; then
26 tar -xjf "$input" --strip-components=1
27 else
28 echo "Error: Unexpected file type."
29 exit 1
32 # Strip out data unused by embedded builds to save the git repository and gathertree some work
33 DIST_SUBDIRS=( utils tests doc contrib/systemd doc/examples utils/hwloc utils/lstopo tests/linux tests/linux/allowed tests/linux/gather tests/xml tests/ports tests/rename )
34 EXTRA_DIST=( contrib/windows )
35 for i in "${DIST_SUBDIRS[@]}" "${EXTRA_DIST[@]}"; do
36 rm -rf "$i"
37 done
38 # Create stub automake files because the disabling is a configure-time option, so automake always checks them
39 for i in "${DIST_SUBDIRS[@]}"; do
40 mkdir -p "$i"
41 touch "$i/Makefile.am"
42 done
44 rm -f "configure" "Makefile.in" "include/Makefile.in" "src/Makefile.in"
46 touch tests/linux/allowed/test-topology.sh.am
47 touch tests/linux/gather/test-gather-topology.sh.am
48 touch tests/xml/test-topology.sh.am
49 touch doc/doxygen-config.cfg.am
50 touch tests/wrapper.sh.am
51 touch tests/linux/test-topology.sh.am
52 touch utils/hwloc/hwloc-assembler-remote.am
53 touch utils/hwloc/hwloc-compress-dir.am
54 touch utils/hwloc/hwloc-gather-topology.am
55 touch utils/hwloc/test-hwloc-annotate.sh.am
56 touch utils/hwloc/test-hwloc-assembler.sh.am
57 touch utils/hwloc/test-hwloc-calc.sh.am
58 touch utils/hwloc/test-hwloc-compress-dir.sh.am
59 touch utils/hwloc/test-hwloc-diffpatch.sh.am
60 touch utils/hwloc/test-hwloc-distances.sh.am
61 touch utils/hwloc/test-hwloc-distrib.sh.am
62 touch utils/hwloc/test-hwloc-info.sh.am
63 touch utils/hwloc/test-fake-plugin.sh.am
64 touch utils/lstopo/test-hwloc-ls.sh.am
66 popd > /dev/null
68 echo "Done. Please review the git history to see if there are any patches that should be cherry-picked and squashed."