From 1079962e4c06f88a54e50d997c1b7e84303d30b4 Mon Sep 17 00:00:00 2001 From: Bernhard Schmidt Date: Sat, 15 Aug 2020 21:29:50 +0200 Subject: New upstream version 2.5~beta1 --- dev-tools/lz4-rebaser.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100755 dev-tools/lz4-rebaser.sh (limited to 'dev-tools/lz4-rebaser.sh') diff --git a/dev-tools/lz4-rebaser.sh b/dev-tools/lz4-rebaser.sh new file mode 100755 index 0000000..03debcb --- /dev/null +++ b/dev-tools/lz4-rebaser.sh @@ -0,0 +1,68 @@ +#!/bin/sh +# lz4-rebaser.sh - Does the LZ4 rebase process in an automated fashion +# +# Copyright (C) 2017-2018 David Sommerseth +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# Basic shell sanity +set -eu + +# Simple argument control +if [ $# -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Check that we have the files we need before starting the rebase +LZ4_C="$1/lib/lz4.c" +LZ4_H="$1/lib/lz4.h" +if [ ! -r "$LZ4_C" -o ! -r "$LZ4_H" ]; then + echo "Could not locate $LZ4_H and/or $LZ4_C" + exit 1 +fi + +# Extract the upstream LZ4 commit base +lz4_tag="$(git --git-dir $1/.git tag --contains HEAD)" +lz4_commit="$(git --git-dir $1/.git rev-parse --short=20 HEAD)" + +# Do the rebase +srcroot="$(git rev-parse --show-toplevel)" +echo "* Copying upstream lz4.h to compat-lz4.h" +cp "$LZ4_H" "${srcroot}/src/compat/compat-lz4.h" + +echo "* Porting upstream lz4.c to compat-lz4.c" +{ + cat < "${srcroot}/src/compat/compat-lz4.c" + +echo "* Running 'git add'" +git add src/compat/compat-lz4.[ch] -- cgit v1.2.3