mirror of
https://github.com/arachsys/libelf.git
synced 2026-01-26 15:39:09 +00:00
Add maintainer update script
This script captures my process for merging changes from new upstream elfutils releases. It isn't obfuscated for portability as it is only intended for maintainer use and documentation.
This commit is contained in:
parent
b80c36da9d
commit
b3ab1bd9a4
2
Makefile
2
Makefile
@ -23,7 +23,7 @@ clean:
|
||||
libelf.a: $(LIBOBJS) Makefile
|
||||
$(AR) rcs $@ $(LIBOBJS)
|
||||
|
||||
libelf.so: $(PICOBJS) Makefile
|
||||
libelf.so: $(PICOBJS) Makefile
|
||||
$(CC) $(LDFLAGS) -shared -Wl,-soname,libelf.so.$(MAJOR) \
|
||||
-o $@ $(PICOBJS) $(LDLIBS)
|
||||
|
||||
|
||||
57
update
Executable file
57
update
Executable file
@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e -o pipefail
|
||||
shopt -s dotglob extglob nullglob
|
||||
cd -- "$(git -C "${0%/*}" rev-parse --show-toplevel)"
|
||||
|
||||
if [[ $@ != +([0-9])*(.+([0-9])) ]]; then
|
||||
echo "Usage: ${0##*/} UPSTREAM-VERSION"
|
||||
echo "Update upstream branch then merge changes into master."
|
||||
echo "This maintainer script does not attempt to be portable."
|
||||
exit 64
|
||||
elif ! git diff --exit-code --quiet; then
|
||||
echo "Uncommitted changes in the working directory"
|
||||
exit 1
|
||||
elif ! git diff --cached --exit-code --quiet; then
|
||||
echo "Uncommitted changes in the index"
|
||||
exit 1
|
||||
fi >&2
|
||||
|
||||
TMP=$(mktemp -d tmp-XXXXXX)
|
||||
trap 'rm -r $TMP' EXIT
|
||||
|
||||
echo "Downloading upstream files for version $1:"
|
||||
URL=https://sourceware.org/elfutils/ftp/$1/elfutils-$1.tar.bz2
|
||||
COLUMNS=64 curl -L -# "$URL" | tar -x -f - -C $TMP --strip-components=1
|
||||
|
||||
git checkout upstream
|
||||
git rm -q -r include src
|
||||
mkdir -p include src
|
||||
|
||||
for FILE in $TMP/libelf/*.[ch] $TMP/lib/crc32.c $TMP/lib/eu-config.h \
|
||||
$TMP/lib/fixedsizehash.h $TMP/lib/next_prime.c $TMP/lib/system.h; do
|
||||
sed ':a;s/[ \t]*$//;/^\n*$/{$d;N;ba}' "$FILE" >"src/${FILE##*/}"
|
||||
git add "src/${FILE##*/}"
|
||||
done
|
||||
|
||||
git mv src/gelf.h src/libelf.h src/nlist.h include
|
||||
|
||||
cp $TMP/COPYING-GPLV2 $TMP/COPYING-LGPLV3 .
|
||||
git add COPYING-GPLV2 COPYING-LGPLV3
|
||||
|
||||
if git diff --cached --exit-code --quiet; then
|
||||
echo "No upstream changes to merge"
|
||||
git checkout master
|
||||
else
|
||||
git commit -m "Update upstream files from elfutils $1"
|
||||
git checkout master
|
||||
git merge --no-commit upstream
|
||||
|
||||
sed -i "s/^MINOR *=.*/MINOR = $1/" Makefile
|
||||
git add Makefile
|
||||
git commit -m "Merge from upstream libelf $1"
|
||||
|
||||
echo "Merged libelf ready to review, build and test"
|
||||
echo "Sign: git tag -m libelf-$1 -s libelf-$1"
|
||||
echo "Push: git push --tags origin upstream master"
|
||||
fi
|
||||
Loading…
x
Reference in New Issue
Block a user