From 322c42c780833a52bd7cd0358a562ab243ecfbce Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 21 Feb 2008 17:51:06 +0000 Subject: [PATCH] Add /src/rebase The tool 'rebase' is needed to avoid memory region clashes between .dll files. This commit adds the infrastructure to recompile 'rebase.exe'. Just call /src/rebase/release.sh and you're fixed. Signed-off-by: Johannes Schindelin --- src/common/update-lib.sh | 93 ++++++++++++++++++++++++ src/rebase/.gitignore | 1 + src/rebase/patches/0001-Fix-for-stricter-g.patch | 44 +++++++++++ src/rebase/release.sh | 25 +++++++ 4 files changed, 163 insertions(+) create mode 100644 src/common/update-lib.sh create mode 100644 src/rebase/.gitignore create mode 100644 src/rebase/patches/0001-Fix-for-stricter-g.patch create mode 100644 src/rebase/release.sh diff --git a/src/common/update-lib.sh b/src/common/update-lib.sh new file mode 100644 index 00000000..126e6d17 --- /dev/null +++ b/src/common/update-lib.sh @@ -0,0 +1,93 @@ +#!/bin/sh + +# Make sure that the working directory is clean and does not have untracked +# files; otherwise our semi-automatic finding the new files will not work! + +die () { + echo "$*" >&2 + exit 1 +} + +check_pristine () { + (cd / && + git diff-files --quiet && + git diff-index --cached --quiet HEAD && + others="$(git ls-files --exclude-from=.gitignore \ + --exclude-per-directory=.gitignore --others)" && + test -z "$others") || + die "State not pristine enough for successful package update" +} + +# Remove old files stored in fileList.txt +pre_install () { + test -z "$FILELIST" && { + echo "No file list specified for pre_install" + exit 1 + } + test -s "$FILELIST" && + cat "$FILELIST" | (cd / && xargs git --ignore-unmatch rm) || + exit +} + +# update the index +post_install () { + (cd / && git add .) || exit + + git diff --cached --diff-filter=AM --name-only | + sed -e "s/^/\//" > "$FILELIST" || + exit + + git add "$FILELIST" || exit + + echo "Successfully built and installed $package $version" + echo "After checking the result, please commit (possibly with --amend)" + echo +} + +download () { + test -z "$tar" && + die "Script did not specify an archive" + test -f "$tar" || { + echo "Downloading $tar ..." + curl $url/$tar -o $tar || exit + } +} + +extract () { + test -z "$d" && + die "Script did not specify a directory" + test -d "$d" || { + echo "Unpacking $tar ..." + case "$tar" in + *.tar.gz|*.tgz) + tar -xzf "$tar" + ;; + *.tar.bz2|*.tbz) + tar -xjf "$tar" + ;; + *.zip) + unzip "$tar" + ;; + esac || exit + } +} + +setup () { + test -z "$d" && + die "Script did not specify a directory" + test -f "$d/Makefile" || + (cd "$d" && ./configure $configure_options) || exit +} + +compile () { + test -z "$d" && + die "Script did not specify a directory" + (cd "$d" && make) || exit +} + +download_extract_setup_and_compile () { + download && + extract && + setup && + compile || exit +} diff --git a/src/rebase/.gitignore b/src/rebase/.gitignore new file mode 100644 index 00000000..488448ef --- /dev/null +++ b/src/rebase/.gitignore @@ -0,0 +1 @@ +/rebase-* diff --git a/src/rebase/patches/0001-Fix-for-stricter-g.patch b/src/rebase/patches/0001-Fix-for-stricter-g.patch new file mode 100644 index 00000000..797abef9 --- /dev/null +++ b/src/rebase/patches/0001-Fix-for-stricter-g.patch @@ -0,0 +1,44 @@ +From 599129078e624f0026090b6efc1f3782401b02bf Mon Sep 17 00:00:00 2001 +From: Johannes Schindelin +Date: Thu, 21 Feb 2008 17:34:11 +0000 +Subject: [PATCH 1/1] Fix for stricter g++ + +Signed-off-by: Johannes Schindelin +--- + imagehelper/sections.cc | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/imagehelper/sections.cc b/imagehelper/sections.cc +index 9dee579..d981555 100644 +--- a/imagehelper/sections.cc ++++ b/imagehelper/sections.cc +@@ -285,7 +285,7 @@ bool Relocations::check(void) + if (debug) + std::cerr << "debug: checking relocations .... " << std::endl; + +- for (; (char *)&relocp->SizeOfBlock < (char *)relocs + size && relocp->SizeOfBlock != 0; ((char *)relocp) += relocp->SizeOfBlock) ++ for (; (char *)&relocp->SizeOfBlock < (char *)relocs + size && relocp->SizeOfBlock != 0; relocp = (PIMAGE_BASE_RELOCATION)(((char *)relocp) + relocp->SizeOfBlock)) + { + int NumOfRelocs = (relocp->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION)) / sizeof (WORD); + int va = relocp->VirtualAddress; +@@ -328,7 +328,7 @@ bool Relocations::fix(void) + if (debug) + std::cerr << "warning: fixing bad relocations .... "; + +- for (; (char *)&relocp->SizeOfBlock < (char *)relocs + size && relocp->SizeOfBlock != 0; ((char *)relocp) += relocp->SizeOfBlock) ++ for (; (char *)&relocp->SizeOfBlock < (char *)relocs + size && relocp->SizeOfBlock != 0; relocp = (PIMAGE_BASE_RELOCATION)(((char *)relocp) + relocp->SizeOfBlock)) + { + int NumOfRelocs = (relocp->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION)) / sizeof (WORD); + int va = relocp->VirtualAddress; +@@ -363,7 +363,7 @@ bool Relocations::relocate(int difference) + if (!relocs) + return false; + +- for (; (char *)&relocp->SizeOfBlock < (char *)relocs + size && relocp->SizeOfBlock != 0; ((char *)relocp) += relocp->SizeOfBlock) ++ for (; (char *)&relocp->SizeOfBlock < (char *)relocs + size && relocp->SizeOfBlock != 0; relocp = (PIMAGE_BASE_RELOCATION)(((char *)relocp) + relocp->SizeOfBlock)) + { + int NumOfRelocs = (relocp->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION)) / sizeof (WORD); + int va = relocp->VirtualAddress; +-- +1.5.3.6.2529.ga176-dirty + diff --git a/src/rebase/release.sh b/src/rebase/release.sh new file mode 100644 index 00000000..6da4cc45 --- /dev/null +++ b/src/rebase/release.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +cd "$(dirname "$0")" && . ../common/update-lib.sh + +package=rebase +version=2.4.2-1 +url=http://www.tishler.net/jason/software/rebase +d=rebase-$version +tar=$d-src.tar.bz2 +configure_options=--prefix= + +download && +extract && +test $d/.git || { + cd $d && + git init && + rm -rf .git/hooks && + git add . && + git commit -m initial && + git am ../patches/* +} && +compile && +cp $d/rebase.exe /bin/ && +(cd /bin && git add rebase.exe) && +echo "You can commit rebase.exe now" -- 2.11.4.GIT