mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-04 22:07:27 +00:00
2d53c21eca
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93771 91177308-0d34-0410-b5e6-96231b3b80d8
38 lines
1.2 KiB
Bash
Executable File
38 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# This script makes a patch for LLVM ensuring the correct diff options and
|
|
# putting the files in a standard review order.
|
|
|
|
|
|
function error {
|
|
retcode="$?"
|
|
echo "mkpatch: error: $1 ($retcode)"
|
|
exit 1
|
|
}
|
|
|
|
if [ ! -e llvm.spec.in ] ; then
|
|
error "Please change directory to the LLVM top source directory"
|
|
fi
|
|
if [ "$#" -ne 1 ] ; then
|
|
error "usage: utils/mkpatch [PATCH_NAME]"
|
|
fi
|
|
NAME="$1"
|
|
echo "mkpatch: Generating differences on top level files"
|
|
svn diff -N -x -u > "$NAME".patch.raw 2>&1
|
|
echo "mkpatch: Generating differences on all directories"
|
|
svn diff -x -u >> "$NAME".patch.raw 2>&1 \
|
|
autoconf docs utils include lib/System lib/Support lib/VMCore lib/AsmParser \
|
|
lib/Bitcode lib/Analysis lib/Transforms lib/CodeGen lib/Target \
|
|
lib/ExecutionEngine lib/Linker \
|
|
tools test unittests runtime projects examples Xcode
|
|
|
|
echo "mkpatch: Removing cruft from the patch file"
|
|
sed -e '/^[?] .*/d' -e '/^cvs diff: Diffing/d' "$NAME".patch.raw | awk '\
|
|
BEGIN { deleting = 0; } \
|
|
/^Index: .*[.]cvs$/ { deleting = 1; fname=substr($0,7); \
|
|
print "Skipping: ", fname > "/dev/stderr"; } \
|
|
/^Index:.*/ && !/^Index: .*[.]cvs$/ { deleting = 0; } \
|
|
{ if (! deleting) { print; } } ' > "$NAME".patch || \
|
|
error "sed/awk cleanup failed"
|
|
|