summaryrefslogtreecommitdiffstats
path: root/Utilities/Scripts/update-elf.bash
blob: 1a065bad8bd6cac2301c1f6e26ba68b5729ae7b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env bash

set -e
set -x
shopt -s dotglob

readonly name="elf"
readonly ownership="FreeBSD Upstream <kwrobot@kitware.com>"
readonly subtree="Utilities/cmelf"
readonly repo="https://github.com/freebsd/freebsd-src.git"
readonly tag="main"
readonly shortlog=false
readonly paths="
  sys/sys/elf32.h
  sys/sys/elf64.h
  sys/sys/elf_common.h
"

extract_source () {
    git_archive
    pushd "${extractdir}/${name}-reduced"
    echo "* -whitespace" > .gitattributes
    mv sys/sys/* .
    sed -i -e 's/<sys\/elf_common.h>/"elf_common.h"/g' -e 's/u_int32_t/uint32_t/g' *.h
    popd
}

. "${BASH_SOURCE%/*}/update-third-party.bash"